From dfaf3291d9ec18b0f7b206d8717b4fd5d0297bee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorsten=20Sch=C3=BCtt?= Date: Fri, 5 Jul 2024 00:07:27 +0200 Subject: [PATCH] small fix --- llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp | 2 +- llvm/test/CodeGen/AArch64/GlobalISel/combine-integer.mir | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp b/llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp index 14382477a61dc0..88441a5de62c77 100644 --- a/llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp +++ b/llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp @@ -7548,7 +7548,7 @@ bool CombinerHelper::matchFoldC1Minus2MinusC2(const MachineInstr &MI, MatchInfo = [=](MachineIRBuilder &B) { auto Const = B.buildConstant(DstTy, *MaybeC1 - *MaybeC2); - B.buildSub(Dst, Sub2->getRHSReg(), Const); + B.buildSub(Dst, Const, Sub2->getRHSReg()); }; return true; diff --git a/llvm/test/CodeGen/AArch64/GlobalISel/combine-integer.mir b/llvm/test/CodeGen/AArch64/GlobalISel/combine-integer.mir index e1859ef26a7136..2f10a497fa74cb 100644 --- a/llvm/test/CodeGen/AArch64/GlobalISel/combine-integer.mir +++ b/llvm/test/CodeGen/AArch64/GlobalISel/combine-integer.mir @@ -332,7 +332,7 @@ body: | ; CHECK-NEXT: {{ $}} ; CHECK-NEXT: %a:_(s64) = COPY $x0 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 -49 - ; CHECK-NEXT: %sub:_(s64) = G_SUB %a, [[C]] + ; CHECK-NEXT: %sub:_(s64) = G_SUB [[C]], %a ; CHECK-NEXT: $x0 = COPY %sub(s64) ; CHECK-NEXT: RET_ReallyLR implicit $x0 %a:_(s64) = COPY $x0