Previously, the definite init pass would check to see if there was a
load available to optimize out the load of a non-trivial assign. Now
we just unconditionally lower an assign to a load/copy/store sequence,
and lead later load elimination zap the load if it is redundant.
This allows us to remove the old mechanics for doing reasoning about
load elimination, including all the "AccessPath" stuff.
Swift SVN r9340
into SSA form, moving to resolving rdar://15170149.
Instead of promoting loads in the middle of the process of proving
that everything passes DI requirements, do this after a full element
is ok.
Doing this requires changing just about everything about how we modeled
elements and subelements being promoted, but this is good for a lot of
reasons:
1) we now don't eagerly scalarize all loads to struct members, now we
just scalarize top-level tuples. This is good for preserving higher
level operations.
2) Even without scalarization, we can still model things at an extremely
fine grain, but we can also keep aggregate operations together.
This means that load promotion doesn't insert a kajillion
struct_extract + struct sequences to decompose then recompose things.
This is just patch #1 of a series, but this is the bulk of the hard work.
Swift SVN r9338
set. This is the last fix required to get copy_addr to forward to the
load in this trivial example from rdar://15170149:
func testTrivial(a : @inout Int) -> Int {
return a
}
on to more testing.
Swift SVN r9167
pass to be -definite-init instead of -memory-promotion, rename the
entrypoint for the pass to match, and tidy various and sundry comments.
Swift SVN r8927