diff --git a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp index 2ec9f84f48ecb..338145b86490a 100644 --- a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp +++ b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp @@ -15381,8 +15381,7 @@ static SDValue foldTruncStoreOfExt(SelectionDAG &DAG, SDNode *N) { if (Store->getMemoryVT() != Orig.getValueType()) return SDValue(); return DAG.getStore(Store->getChain(), SDLoc(Store), Orig, - Store->getBasePtr(), Store->getPointerInfo(), - Store->getAlign()); + Store->getBasePtr(), Store->getMemOperand()); } return SDValue(); diff --git a/llvm/test/CodeGen/AArch64/volatile-combine.ll b/llvm/test/CodeGen/AArch64/volatile-combine.ll new file mode 100644 index 0000000000000..32fea1990ce79 --- /dev/null +++ b/llvm/test/CodeGen/AArch64/volatile-combine.ll @@ -0,0 +1,10 @@ +; RUN: llc -mtriple=arm64-apple-ios %s -o - -stop-after=finalize-isel 2>&1 | FileCheck %s + +define void @foo(i64 %a, i64 %b, i32* %ptr) { +; CHECK-LABEL: name: foo +; CHECK: STRWui {{.*}} (volatile store (s32) into %ir.ptr) + %sum = add i64 %a, 1 + %sum.32 = trunc i64 %sum to i32 + store volatile i32 %sum.32, i32* %ptr + ret void +}