[llvm] 33112cb - [DAGCombiner] Remove unnecessary assert from getShiftAmountTy wrapper. NFC

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 4 19:06:18 PDT 2024


Author: Craig Topper
Date: 2024-07-04T19:05:54-07:00
New Revision: 33112cbf59d838d25a4bf2a8c539d1aceda191c7

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

LOG: [DAGCombiner] Remove unnecessary assert from getShiftAmountTy wrapper. NFC

The same assert appears in the TargetLowering function.

Refine comment to describe as a convenience wrapper and leave it to
TargetLowering documentation to explain.

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 13b599565f326..b13f6bcf3ebc1 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -843,10 +843,8 @@ namespace {
 
     SelectionDAG &getDAG() const { return DAG; }
 
-    /// Returns a type large enough to hold any valid shift amount - before type
-    /// legalization these can be huge.
+    /// Convenience wrapper around TargetLowering::getShiftAmountTy.
     EVT getShiftAmountTy(EVT LHSTy) {
-      assert(LHSTy.isInteger() && "Shift amount is not an integer type!");
       return TLI.getShiftAmountTy(LHSTy, DAG.getDataLayout());
     }
 


        


More information about the llvm-commits mailing list