Skip to content

Commit

Permalink
[TargetLowering] Use SETCC input type to call getBooleanContents inst…
Browse files Browse the repository at this point in the history
…ead 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.
  • Loading branch information
topperc committed Jan 6, 2020
1 parent 8aae645 commit 19ace44
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
Expand Up @@ -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
Expand Down

0 comments on commit 19ace44

Please sign in to comment.