From fa566233706ce8345f2c0152b51312a217b848c9 Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Mon, 12 Oct 2020 15:55:18 +0100 Subject: [PATCH] [InstCombine] matchFunnelShift - remove shift value commutation. NFCI. After rG02295e6d1a15 we no longer need to invert the shift values for fshr - this is just hidden at the moment as funnel shifts only ever match for constant values so never use the fshr "Sub on SHL" path. --- llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp b/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp index 06168e2..d2d2cec 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp @@ -2140,8 +2140,7 @@ static Instruction *matchFunnelShift(Instruction &Or) { Intrinsic::ID IID = IsFshl ? Intrinsic::fshl : Intrinsic::fshr; Function *F = Intrinsic::getDeclaration(Or.getModule(), IID, Or.getType()); - return IntrinsicInst::Create( - F, {IsFshl ? ShVal0 : ShVal1, IsFshl ? ShVal1 : ShVal0, ShAmt}); + return IntrinsicInst::Create(F, {ShVal0, ShVal1, ShAmt}); } /// Attempt to combine or(zext(x),shl(zext(y),bw/2) concat packing patterns. -- 2.7.4