[llvm] 37e17f2 - [DAG] MatchRotate - remove (redundant) legal type check.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 2 04:38:57 PDT 2021


Author: Simon Pilgrim
Date: 2021-11-02T11:24:50Z
New Revision: 37e17f278fb5eee02010d9190ed19a649ffe2646

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

LOG: [DAG] MatchRotate - remove (redundant) legal type check.

Rely on the hasOperation() instead - as commented on D77804, the mid-term intention is to recognise rotate/funnel-by-constant pre-legalization to help avoid SimplifyDemandedBits regressions.

Added: 
    

Modified: 
    llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 4753d27380282..a6f2328d2cc2f 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -6980,10 +6980,7 @@ SDValue DAGCombiner::MatchFunnelPosNeg(SDValue N0, SDValue N1, SDValue Pos,
 // a rot[lr]. This also matches funnel shift patterns, similar to rotation but
 // with 
diff erent shifted sources.
 SDValue DAGCombiner::MatchRotate(SDValue LHS, SDValue RHS, const SDLoc &DL) {
-  // Must be a legal type.  Expanded 'n promoted things won't work with rotates.
   EVT VT = LHS.getValueType();
-  if (!TLI.isTypeLegal(VT))
-    return SDValue();
 
   // The target must have at least one rotate/funnel flavor.
   bool HasROTL = hasOperation(ISD::ROTL, VT);


        


More information about the llvm-commits mailing list