Skip to content

Commit a26f92b

Browse files
committed
fixup! [llvm][RISCV] Support RISCV vector tuple type in llvm IR
1 parent 9b920d1 commit a26f92b

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

clang/utils/TableGen/RISCVVEmitter.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,9 +218,7 @@ static unsigned getSegInstLog2SEW(StringRef InstName) {
218218
#undef KEY_VAL_ALL_NF
219219
#undef KEY_VAL
220220

221-
if (SegInsts.contains(InstName))
222-
return SegInsts[InstName];
223-
return 0;
221+
return SegInsts.lookup(InstName);
224222
}
225223

226224
void emitCodeGenSwitchBody(const RVVIntrinsic *RVVI, raw_ostream &OS) {

llvm/include/llvm/IR/Type.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ class Type {
266266
return getTypeID() == ScalableVectorTyID || getTypeID() == FixedVectorTyID;
267267
}
268268

269-
// True if this is an instance of TargetExtType of RISCV vector tuple.
269+
// True if this is an instance of TargetExtType of RISC-V vector tuple.
270270
bool isRISCVVectorTupleTy() const;
271271

272272
/// Return true if this type could be converted with a lossless BitCast to

llvm/lib/IR/Type.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -852,16 +852,17 @@ static TargetTypeInfo getTargetTypeInfo(const TargetExtType *Ty) {
852852
return TargetTypeInfo(ScalableVectorType::get(Type::getInt1Ty(C), 16),
853853
TargetExtType::HasZeroInit);
854854

855-
// RISCV vector tuple type. The layout is represented as the type that needs
855+
// RISC-V vector tuple type. The layout is represented as the type that needs
856856
// the same number of vector registers(VREGS) as this tuple type, represented
857857
// as <vscale x (VREGS * 8) x i8>.
858858
if (Name == "riscv_vec_tuple") {
859859
unsigned TotalNumElts =
860860
std::max(cast<ScalableVectorType>(Ty->getTypeParameter(0))
861861
->getMinNumElements(),
862-
8UL) *
862+
(uint64_t)8) *
863863
Ty->getIntParameter(0);
864-
return TargetTypeInfo(ScalableVectorType::get(Type::getInt8Ty(C), TotalNumElts));
864+
return TargetTypeInfo(
865+
ScalableVectorType::get(Type::getInt8Ty(C), TotalNumElts));
865866
}
866867

867868
return TargetTypeInfo(Type::getVoidTy(C));

0 commit comments

Comments
 (0)