Skip to content

Commit 8c44a72

Browse files
committed
fixup! [llvm][RISCV] Support RISCV vector tuple type in llvm IR
1 parent c2a7f4b commit 8c44a72

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
@@ -262,7 +262,7 @@ class Type {
262262
return getTypeID() == ScalableVectorTyID || getTypeID() == FixedVectorTyID;
263263
}
264264

265-
// True if this is an instance of TargetExtType of RISCV vector tuple.
265+
// True if this is an instance of TargetExtType of RISC-V vector tuple.
266266
bool isRISCVVectorTupleTy() const;
267267

268268
/// 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
@@ -840,16 +840,17 @@ static TargetTypeInfo getTargetTypeInfo(const TargetExtType *Ty) {
840840
return TargetTypeInfo(ScalableVectorType::get(Type::getInt1Ty(C), 16),
841841
TargetExtType::HasZeroInit);
842842

843-
// RISCV vector tuple type. The layout is represented as the type that needs
843+
// RISC-V vector tuple type. The layout is represented as the type that needs
844844
// the same number of vector registers(VREGS) as this tuple type, represented
845845
// as <vscale x (VREGS * 8) x i8>.
846846
if (Name == "riscv_vec_tuple") {
847847
unsigned TotalNumElts =
848848
std::max(cast<ScalableVectorType>(Ty->getTypeParameter(0))
849849
->getMinNumElements(),
850-
8UL) *
850+
(uint64_t)8) *
851851
Ty->getIntParameter(0);
852-
return TargetTypeInfo(ScalableVectorType::get(Type::getInt8Ty(C), TotalNumElts));
852+
return TargetTypeInfo(
853+
ScalableVectorType::get(Type::getInt8Ty(C), TotalNumElts));
853854
}
854855

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

0 commit comments

Comments
 (0)