Skip to content

Commit 8a4b095

Browse files
committed
[RISCV][TLI/TTI] Reject scalable offsets in isLegalAddressing mode
None of our addressing modes support a scalable offset. I could not figure out how to get LSR to actually try such a formula, but let's be defensive and explicitly prevent this case from being considered a valid address mode match.
1 parent b7db119 commit 8a4b095

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

llvm/lib/Target/RISCV/RISCVISelLowering.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1835,6 +1835,10 @@ bool RISCVTargetLowering::isLegalAddressingMode(const DataLayout &DL,
18351835
if (AM.BaseGV)
18361836
return false;
18371837

1838+
// None of our addressing modes allows a scalable offset
1839+
if (AM.ScalableOffset)
1840+
return false;
1841+
18381842
// RVV instructions only support register addressing.
18391843
if (Subtarget.hasVInstructions() && isa<VectorType>(Ty))
18401844
return AM.HasBaseReg && AM.Scale == 0 && !AM.BaseOffs;

0 commit comments

Comments
 (0)