Skip to content

Commit 2bc2211

Browse files
jiahanxie353chencha3
authored andcommitted
[GISEL][RISCV] IRTranslator for scalable vector load (llvm#80006)
Add IRTranslator for scalable vector load instruction and include corresponding tests with alignment argument included, which can be smaller/equal/larger than element size or smaller/equal/larger than the minimum total vector size.
1 parent e309c05 commit 2bc2211

File tree

3 files changed

+951
-4
lines changed

3 files changed

+951
-4
lines changed

llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1363,9 +1363,8 @@ static bool isSwiftError(const Value *V) {
13631363

13641364
bool IRTranslator::translateLoad(const User &U, MachineIRBuilder &MIRBuilder) {
13651365
const LoadInst &LI = cast<LoadInst>(U);
1366-
1367-
unsigned StoreSize = DL->getTypeStoreSize(LI.getType());
1368-
if (StoreSize == 0)
1366+
TypeSize StoreSize = DL->getTypeStoreSize(LI.getType());
1367+
if (StoreSize.isZero())
13691368
return true;
13701369

13711370
ArrayRef<Register> Regs = getOrCreateVRegs(LI);

llvm/lib/Target/RISCV/RISCVISelLowering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20909,7 +20909,7 @@ bool RISCVTargetLowering::fallBackToDAGISel(const Instruction &Inst) const {
2090920909
if (Op == Instruction::Add || Op == Instruction::Sub ||
2091020910
Op == Instruction::And || Op == Instruction::Or ||
2091120911
Op == Instruction::Xor || Op == Instruction::InsertElement ||
20912-
Op == Instruction::Xor || Op == Instruction::ShuffleVector)
20912+
Op == Instruction::ShuffleVector || Op == Instruction::Load)
2091320913
return false;
2091420914

2091520915
if (Inst.getType()->isScalableTy())

0 commit comments

Comments
 (0)