[llvm] 19ace44 - [TargetLowering] Use SETCC input type to call getBooleanContents instead of the setcc result type.

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 5 23:16:10 PST 2020


Author: Craig Topper
Date: 2020-01-05T23:15:49-08:00
New Revision: 19ace449a3da4058428495283b3b15826f8d7d34

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

LOG: [TargetLowering] Use SETCC input type to call getBooleanContents instead of the setcc result type.

This isn't a functonal change since we also check the bit width is the
same and the input type is integer. This guarantees the input and
output type are the same. But passing the input type makes the code
more readable.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
index f6e96d22c779..21c8bde43641 100644
--- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
@@ -1261,7 +1261,7 @@ bool TargetLowering::SimplifyDemandedBits(
     // -1, we may be able to bypass the setcc.
     if (DemandedBits.isSignMask() &&
         Op0.getScalarValueSizeInBits() == BitWidth &&
-        getBooleanContents(VT) ==
+        getBooleanContents(Op0.getValueType()) ==
             BooleanContent::ZeroOrNegativeOneBooleanContent) {
       // If we're testing X < 0, then this compare isn't needed - just use X!
       // FIXME: We're limiting to integer types here, but this should also work


        


More information about the llvm-commits mailing list