forked from OSchip/llvm-project
[aarch64][globalisel] Fix a crash in selectAddrModeIndexed() caused by incorrect G_FRAME_INDEX handling
The wrong operand was being rendered to the result instruction. The crash was detected by Bitcode/simd_ops/AArch64_halide_runtime.bc llvm-svn: 315890
This commit is contained in:
parent
6621cf67cf
commit
01805b6747
|
@ -1497,7 +1497,11 @@ AArch64InstructionSelector::selectAddrModeIndexed(MachineOperand &Root,
|
|||
unsigned Scale = Log2_32(Size);
|
||||
if ((RHSC & (Size - 1)) == 0 && RHSC >= 0 && RHSC < (0x1000 << Scale)) {
|
||||
if (LHSDef->getOpcode() == TargetOpcode::G_FRAME_INDEX)
|
||||
LHSDef = MRI.getVRegDef(LHSDef->getOperand(1).getReg());
|
||||
return {{
|
||||
[=](MachineInstrBuilder &MIB) { MIB.add(LHSDef->getOperand(1)); },
|
||||
[=](MachineInstrBuilder &MIB) { MIB.addImm(RHSC >> Scale); },
|
||||
}};
|
||||
|
||||
return {{
|
||||
[=](MachineInstrBuilder &MIB) { MIB.add(LHS); },
|
||||
[=](MachineInstrBuilder &MIB) { MIB.addImm(RHSC >> Scale); },
|
||||
|
|
Loading…
Reference in New Issue