Skip to content

Commit c62626a

Browse files
committed
Comment
1 parent a861421 commit c62626a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

llvm/lib/Support/KnownBits.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -632,6 +632,10 @@ static KnownBits computeForSatAddSub(bool Add, bool Signed,
632632
// we can rule out a direction at least.
633633
KnownBits UnsignedLHS = LHS;
634634
KnownBits UnsignedRHS = RHS;
635+
// Get version of LHS/RHS with clearer signbit. This allows us to detect
636+
// how the addition/subtraction might overflow into the signbit. Then
637+
// using the actual known signbits of LHS/RHS, we can figure out which
638+
// overflows are/aren't possible.
635639
UnsignedLHS.One.clearSignBit();
636640
UnsignedLHS.Zero.setSignBit();
637641
UnsignedRHS.One.clearSignBit();

0 commit comments

Comments
 (0)