Skip to content

Commit 7feafa0

Browse files
committed
[ARM] Fix pointer offset when splitting stores from VMOVDRR
We were not accounting for the pointer offset when splitting a store from a VMOVDRR node, which could lead to incorrect aliasing info. In this case it is the fneg via integer arithmetic that gives us a store->load pair that we started getting wrong. Differential Revision: https://reviews.llvm.org/D88653
1 parent aacfe2b commit 7feafa0

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

llvm/lib/Target/ARM/ARMISelLowering.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14546,15 +14546,15 @@ static SDValue PerformSTORECombine(SDNode *N,
1454614546
SDValue BasePtr = St->getBasePtr();
1454714547
SDValue NewST1 = DAG.getStore(
1454814548
St->getChain(), DL, StVal.getNode()->getOperand(isBigEndian ? 1 : 0),
14549-
BasePtr, St->getPointerInfo(), St->getAlignment(),
14549+
BasePtr, St->getPointerInfo(), St->getOriginalAlign(),
1455014550
St->getMemOperand()->getFlags());
1455114551

1455214552
SDValue OffsetPtr = DAG.getNode(ISD::ADD, DL, MVT::i32, BasePtr,
1455314553
DAG.getConstant(4, DL, MVT::i32));
1455414554
return DAG.getStore(NewST1.getValue(0), DL,
1455514555
StVal.getNode()->getOperand(isBigEndian ? 0 : 1),
14556-
OffsetPtr, St->getPointerInfo(),
14557-
std::min(4U, St->getAlignment() / 2),
14556+
OffsetPtr, St->getPointerInfo().getWithOffset(4),
14557+
St->getOriginalAlign(),
1455814558
St->getMemOperand()->getFlags());
1455914559
}
1456014560

llvm/test/CodeGen/Thumb2/vmovdrroffset.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ define arm_aapcs_vfpcc double @zero(double %a, double %b, double %c) {
2121
; CHECK-NEXT: vmov r2, r3, d8
2222
; CHECK-NEXT: vmov r0, r1, d0
2323
; CHECK-NEXT: bl __aeabi_dadd
24+
; CHECK-NEXT: str r1, [sp, #4]
2425
; CHECK-NEXT: mov r4, r0
2526
; CHECK-NEXT: ldrb.w r0, [sp, #7]
26-
; CHECK-NEXT: str r1, [sp, #4]
2727
; CHECK-NEXT: eor r0, r0, #128
2828
; CHECK-NEXT: strb.w r0, [sp, #7]
2929
; CHECK-NEXT: vmov r0, r1, d9

0 commit comments

Comments
 (0)