Skip to content

Commit da201aa

Browse files
author
eopXD
committed
[RISCV][NFC] Remove *= operator for LMULType
LMULType always manipulate on Log2LMUL, let all manipulations go through LMULType::MulLog2LMUL. Reviewed By: khchen Differential Revision: https://reviews.llvm.org/D126042
1 parent 8680300 commit da201aa

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

clang/include/clang/Support/RISCVVIntrinsicUtils.h

-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ struct LMULType {
156156
std::string str() const;
157157
llvm::Optional<unsigned> getScale(unsigned ElementBitwidth) const;
158158
void MulLog2LMUL(int Log2LMUL);
159-
LMULType &operator*=(uint32_t RHS);
160159
};
161160

162161
class RVVType;

clang/lib/Support/RISCVVIntrinsicUtils.cpp

+3-9
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,6 @@ VScaleVal LMULType::getScale(unsigned ElementBitwidth) const {
7777

7878
void LMULType::MulLog2LMUL(int log2LMUL) { Log2LMUL += log2LMUL; }
7979

80-
LMULType &LMULType::operator*=(uint32_t RHS) {
81-
assert(isPowerOf2_32(RHS));
82-
this->Log2LMUL = this->Log2LMUL + Log2_32(RHS);
83-
return *this;
84-
}
85-
8680
RVVType::RVVType(BasicType BT, int Log2LMUL,
8781
const PrototypeDescriptor &prototype)
8882
: BT(BT), LMUL(LMULType(Log2LMUL)) {
@@ -628,17 +622,17 @@ void RVVType::applyModifier(const PrototypeDescriptor &Transformer) {
628622
switch (static_cast<VectorTypeModifier>(Transformer.VTM)) {
629623
case VectorTypeModifier::Widening2XVector:
630624
ElementBitwidth *= 2;
631-
LMUL *= 2;
625+
LMUL.MulLog2LMUL(1);
632626
Scale = LMUL.getScale(ElementBitwidth);
633627
break;
634628
case VectorTypeModifier::Widening4XVector:
635629
ElementBitwidth *= 4;
636-
LMUL *= 4;
630+
LMUL.MulLog2LMUL(2);
637631
Scale = LMUL.getScale(ElementBitwidth);
638632
break;
639633
case VectorTypeModifier::Widening8XVector:
640634
ElementBitwidth *= 8;
641-
LMUL *= 8;
635+
LMUL.MulLog2LMUL(3);
642636
Scale = LMUL.getScale(ElementBitwidth);
643637
break;
644638
case VectorTypeModifier::MaskVector:

0 commit comments

Comments
 (0)