From: Volkan Keles Date: Tue, 15 Sep 2020 23:40:38 +0000 (-0700) Subject: GlobalISel: Fix a failing combiner test X-Git-Tag: llvmorg-13-init~11962 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=79378b1b757d5c981e60320f5a735f3e356557a0;p=platform%2Fupstream%2Fllvm.git GlobalISel: Fix a failing combiner test test/CodeGen/AArch64/GlobalISel/combine-trunc.mir was failing due to the different order for evaluating function arguments. This patch updates the related code to fix the issue. --- diff --git a/llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp b/llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp index 7421599..5e2b862 100644 --- a/llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp +++ b/llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp @@ -2113,8 +2113,9 @@ bool CombinerHelper::applyCombineTruncOfShl( Register ShiftSrc = MatchInfo.first; Register ShiftAmt = MatchInfo.second; Builder.setInstrAndDebugLoc(MI); - Builder.buildShl(DstReg, Builder.buildTrunc(DstTy, ShiftSrc), - Builder.buildTrunc(DstTy, ShiftAmt), SrcMI->getFlags()); + auto TruncShiftSrc = Builder.buildTrunc(DstTy, ShiftSrc); + auto TruncShiftAmt = Builder.buildTrunc(DstTy, ShiftAmt); + Builder.buildShl(DstReg, TruncShiftSrc, TruncShiftAmt, SrcMI->getFlags()); MI.eraseFromParent(); return true; }