Skip to content

Commit a342803

Browse files
committed
add comment
1 parent d04840c commit a342803

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

llvm/lib/Target/AArch64/AArch64CollectLOH.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,10 @@ static bool isCandidateStore(const MachineInstr &MI, const MachineOperand &MO) {
230230
case AArch64::STNPSi:
231231
case AArch64::STNPDi:
232232
case AArch64::STNPQi:
233+
// We can only optimize the index operand.
234+
// In case we have str xA, xB, [xA, #imm] or str xA, xB [xB, #imm], this is
235+
// two different uses of xA or xB and we cannot fold, otherwise the xA or xB
236+
// stored may be wrong, even if #imm == 0.
233237
return MO.getOperandNo() == 2 &&
234238
MI.getOperand(0).getReg() != MI.getOperand(2).getReg() &&
235239
MI.getOperand(1).getReg() != MI.getOperand(2).getReg();

0 commit comments

Comments
 (0)