This commits moves the code that accesses the operands after the point where
we identify the builtins and know they have two operands.
rdar://20711757
Swift SVN r27810
This commit splits DominanceAnalysis into two analysis (Dom and PDom) that
can be cached and invalidates using the common FunctionAnalysisBase interface
independent of one another.
Swift SVN r26643
The overflow check for X * 1 does not guard the check for X * -1
because X could be MIN_INT, and MIN_INT*-1 overflows. In the new code
we check that the new multiplier is smaller (not smaller or equal).
Swift SVN r26553
Previously we were removing overflow checks if a previous (or future) check
used a smaller multiplier. However, this logic is incorrect for signed integers
because it does not consider underflows (example, x * 10 vs. x * -100000).
The code now checks that the multiplier that's dominated by another check is
closer or equal to zero (the absolute value is smaller or equal to the
guarding multiplier).
Swift SVN r26550
Use the knowledge of previous (or future) overflow checks to remove multiplication by smaller values.
For example:
x * 100
x * 10 // can remove this overflow checks.
Swift SVN r26543
The old invalidation lattice was incorrect because changes to control flow could cause changes to the
call graph, so we've decided to change the way passes invalidate analysis. In the new scheme, the lattice
is replaced with a list of traits that passes preserve or invalidate. The current traits are Calls and Branches.
Now, passes report which traits they preserve, which is the opposite of the previous implementation where
passes needed to report what they invalidate.
Node: I tried to limit the changes in this commit to mechanical changes to ease the review. I will cleanup some
of the code in a following commit.
Swift SVN r26449
If X is known to be smaller than some other number then we can add a 1 to X.
If X is known to be grater than some other number then we can subtract 1 from X.
func add1_signed_branch(x : Int, y : Int) {
if (x < y) {
sink(x + 1) // remove
sink(x + 2) // keep
}
}
Swift SVN r26016