[llvm] [DAGCombiner] Attempt to fold 'add' nodes to funnel-shift or rotate (PR #125612)

Justin Fargnoli via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 17 11:09:49 PDT 2025


================
@@ -8379,7 +8383,7 @@ static bool matchRotateSub(SDValue Pos, SDValue Neg, unsigned EltSize,
   // NOTE: We can only do this when matching operations which won't modify the
   // least Log2(EltSize) significant bits and not a general funnel shift.
   unsigned MaskLoBits = 0;
-  if (IsRotate && isPowerOf2_64(EltSize)) {
+  if (IsRotate && !FromAdd && isPowerOf2_64(EltSize)) {
----------------
justinfargnoli wrote:

Is it incorrect to do this for `add`? Or do we just not want to? 

https://github.com/llvm/llvm-project/pull/125612


More information about the llvm-commits mailing list