[PATCH] D68232: [DAGCombine] Match a greater range of rotate when not all bits are demanded.

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 1 01:31:33 PDT 2019


RKSimon added a comment.

vector tests?



================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:6376
+  return MatchRotate(LHS, RHS, DL,
+                     APInt::getMaxValue(LHS.getValueType().getSizeInBits()));
+}
----------------
Shouldn't this be: APInt::getMaxValue(LHS.getScalarValueSizeInBits()) ?

TBH I'd prefer getAllOnesValue as well as it avoids the signed/unsigned ambiguity of getMaxValue.


================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:6475
+        APInt::getMaxValue(RotAmount).zextOrTrunc(DemandedBits.getBitWidth());
+    if ((DemandedBits & RotMask) != DemandedBits)
+      return false;
----------------
isSubsetOf ?


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68232/new/

https://reviews.llvm.org/D68232





More information about the llvm-commits mailing list