[llvm] fa56623 - [InstCombine] matchFunnelShift - remove shift value commutation. NFCI.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 12 07:59:22 PDT 2020


Author: Simon Pilgrim
Date: 2020-10-12T15:55:18+01:00
New Revision: fa566233706ce8345f2c0152b51312a217b848c9

URL: https://github.com/llvm/llvm-project/commit/fa566233706ce8345f2c0152b51312a217b848c9
DIFF: https://github.com/llvm/llvm-project/commit/fa566233706ce8345f2c0152b51312a217b848c9.diff

LOG: [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.

Added: 
    

Modified: 
    llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp b/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
index 06168e2424ef..d2d2cecb9a65 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.


        


More information about the llvm-commits mailing list