Commit Graph

23 Commits

Author SHA1 Message Date
Nadav Rotem
240ff14db1 Split DominanceAnalysis into Dom and PDom using FunctionAnalysisBase.
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
2015-03-27 20:54:28 +00:00
Nadav Rotem
d78b376d07 [passes] Replace the old invalidation lattice with a new invalidation scheme.
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
2015-03-23 21:18:58 +00:00
Chris Lattner
4f708c049b fix const correctness and standardize on names for the successor list of
TerminatorInsts.  Now you can walk over the successor list of a terminator
and actually modify the SILSuccessor directly, allowing better CFG
transformations.  NFC.




Swift SVN r26140
2015-03-14 17:52:27 +00:00
Arnold Schwaighofer
b31875ab82 LICM: Hoist loads from outer loops too
So far we only hoisted from innermost loops because we did not summarize the
effect of sub loops.

Swift SVN r25873
2015-03-09 01:17:30 +00:00
Arnold Schwaighofer
88aba043a4 LICM: Add a driver for propagating loop summary information up the call tree
NFC yet.

Swift SVN r25872
2015-03-09 01:17:29 +00:00
Arnold Schwaighofer
b4dc51c65f LICM: Cleanup code
NFC.

Swift SVN r25871
2015-03-09 01:17:29 +00:00
Arnold Schwaighofer
bc39e75469 LICM: Better readability for debug output
NFC.

Swift SVN r25870
2015-03-09 01:17:28 +00:00
Arnold Schwaighofer
f7c01f2061 Nuke isReadNone function
We can now compute the same result with Inst.mayReadOrWriteMemory(). NFC.

Swift SVN r25743
2015-03-04 05:03:45 +00:00
Arnold Schwaighofer
951dc2875a Nuke isSideEffectFree
We can now compute the same result with Inst.mayHaveSideEffects(). NFC.

Swift SVN r25742
2015-03-04 05:03:44 +00:00
Arnold Schwaighofer
aa3aa24373 LICM: Improve debug output
Swift SVN r25613
2015-02-27 22:07:35 +00:00
Arnold Schwaighofer
1db4d69fd8 LICM: Hoist side-effect free instructions in outer loops
Swift SVN r25612
2015-02-27 22:07:34 +00:00
Michael Gottesman
93b92a8f9f Add in Passes.def for metaprogramming with SILPassKinds.
This simplifies some code in SILOpt and SILPasses. The real reason to do it is
to use it to procedurally generate random pipelines.

Swift SVN r23996
2014-12-17 23:56:26 +00:00
Arnold Schwaighofer
db079f30a1 LICM: Don't give up when there are no reads
I saw no impact on performance.

Swift SVN r23844
2014-12-10 18:34:15 +00:00
Arnold Schwaighofer
d1ec60f7d0 LICM: Report when we have hoisted instructions
We were not printing out changed functions in sil-print-all because of the
missing reporting.

Swift SVN r23649
2014-12-03 15:14:07 +00:00
Arnold Schwaighofer
cf34cad390 LICM: Sink fix_lifetime
The vectorizer will be blocked by the presence of fix_lifetime calls. Sink them
to the exit block if there are no reference count effecting instructions in the
loop.

rdar://18840949

Swift SVN r23131
2014-11-06 21:17:37 +00:00
Joe Groff
3f23b82e6d SIL: Rename SILGlobalAddr to GlobalAddr.
All globals are SIL globals now.

Swift SVN r22827
2014-10-18 17:08:28 +00:00
Joe Groff
e3f9a2035c SIL: Move SILGen and passes over to use "builtin" instead of "apply (builtin_function_ref)".
Swift SVN r22785
2014-10-15 23:37:22 +00:00
Joe Groff
bb46f4bbd9 SIL: Remove the global_addr instruction.
It's no longer needed now that we always lower to SIL globals.

Swift SVN r22693
2014-10-12 17:19:06 +00:00
Manman Ren
a952c556c9 [Global Opt] replace GlobalAddrInst with SILGlobalAddrInst.
Update SILGen to create SILGlobalVariable and SILGlobalAddrInst instead of
GlobalAddrInst. When we see a definition for a global variable, we create
the corrsponding SILGlobalVariable definition.

When creating SILGlobalVariable from a global VarDecl, we mangle the global
VarDecl in the same way as we mangle it at IRGen. The SILLinkage is also
set in the same way as we set it at IRGen.

At IRGen, we use the associated VarDecl for SILGlobalVariable if it exists,
to have better debugging information.

We set the initializer for SILGlobalVariable definition only.

We also handle SILGlobalAddrInst in various SILPasses, in the similar way
as we handle GlobalAddrInst.

rdar://15493694


Swift SVN r21887
2014-09-11 20:00:39 +00:00
Michael Gottesman
24c138f29c Move SILLoopInfo into swiftSIL from swiftSILAnalysis so that we match the separation in between analysis and IR entities.
This follows the model of dominance info and allows me to create reachability
methods on SILBasicBlock without creating dependencies from swiftSIL to
swiftSILAnalysis.

Swift SVN r21866
2014-09-11 03:03:06 +00:00
Manman Ren
85b752987a [LICM] move cond_fails down to enable register promotion at llvm level.
This together with loop rotate will move load & store out of the
loop with overflow check.

Fix the performance difference and improve performance for all 4 versions
in rdar://17451529


Swift SVN r19986
2014-07-15 21:19:30 +00:00
Arnold Schwaighofer
ae5cd10b48 LICM: remove redundant check
An AllocStackInst isa AllocationInst. Thanks MikeG for noticing.

Swift SVN r19715
2014-07-09 00:15:56 +00:00
Arnold Schwaighofer
51eb9269ab Add a SIL LICM pass
The main purpose of this pass is to hoist invariant loads out of loops. This
will enable llvm to vectorize loops with array accesses in Ofast once we hoist
the makeUnique functions.

Disabled for now.

rdar://17142604

Swift SVN r19713
2014-07-08 23:51:48 +00:00