Commit Graph

26 Commits

Author SHA1 Message Date
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
Dmitri Hrybenko
61286f0260 Fix warnings produced by a newer version of Clang
Swift SVN r25257
2015-02-12 23:50:47 +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
Adrian Prantl
c41b30299f Audit all SILPasses to ensure that new instructions are never created
without a valid SILDebugScope. An assertion in IRGenSIL prevents future
optimizations from regressing in this regard.
Introducing SILBuilderWithScope and SILBuilderwithPostprocess to ease the
transition.

This patch is large, but mostly mechanical.
<rdar://problem/18494573> Swift: Debugger is not stopping at the set breakpoint

Swift SVN r22978
2014-10-28 01:49:11 +00:00
Chris Lattner
afea47b621 rename "destroy_value" to "release_value", part of rdar://15889208.
Swift SVN r15777
2014-04-02 05:33:52 +00:00
Chris Lattner
a0a65c0ea2 change the sil parser/printer to use retain_value instead of copy_value.
Swift SVN r15776
2014-04-02 05:22:41 +00:00
Chris Lattner
6540423613 rename CopyValueInst -> RetainValueInst. The .sil syntax
isn't changed yet.


Swift SVN r15775
2014-04-02 05:11:31 +00:00
Joe Groff
584009d27e SIL: Remove copy_value's result.
We won't have any types where copying has an effect on the bit pattern (except for blocks, which need special handling anyway), and copy_value having a result makes optimizations more complex, so remove it.

Swift SVN r15640
2014-03-30 03:40:45 +00:00
Chris Lattner
001c1890e5 put all the SIL*Transform classes in anonymous namespaces, there is
no need for their symbols to be exported out of their implementation
file.


Swift SVN r14714
2014-03-06 01:49:53 +00:00
Michael Gottesman
8e60748959 Fix up two pass names.
Swift SVN r14244
2014-02-21 23:39:01 +00:00
Andrew Trick
731000b4cd Added -sil-print-all and -sil-verify-all options.
Swift SVN r13662
2014-02-07 23:07:11 +00:00
Nadav Rotem
27a1a63134 Remove unneeded empty virtual destructors.
Swift SVN r13599
2014-02-06 22:24:33 +00:00
Nadav Rotem
1ef0d157ca PassManager: Inject the function/module into the Transformation.
Now the pass does not need to know about the pass manager. We also don't have
runOnFunction or runOnModule anymore because the trnasformation knows
which module it is processing. The Pass itself knows how to invalidate the
analysis, based on the injected pass manager that is internal to the
transformation.

Now our DCE transformation looks like this:

class DCE : public SILModuleTransform {
  void run() {
    performSILDeadCodeElimination(getModule());
    invalidateAnalysis(SILAnalysis::InvalidationKind::All);
  }
};





Swift SVN r13598
2014-02-06 22:11:21 +00:00
Nadav Rotem
31cb4c4ec7 Teach LowerAggregate to invalidate analysis only if a change was made.
Swift SVN r13589
2014-02-06 18:06:16 +00:00
Nadav Rotem
99b075c32a Rename SILFunctionTrans -> SILFunctionTransform
Swift SVN r13536
2014-02-06 01:32:10 +00:00
Nadav Rotem
f8c7b54d28 Delete the unused performXXX() functions.
Swift SVN r13531
2014-02-06 00:57:28 +00:00
Michael Gottesman
631f9326ab [PM] Change enum => enum class everywhere in the PM code. Additionally fix some typos.
Swift SVN r13507
2014-02-05 21:25:15 +00:00
Nadav Rotem
baa1d1679a Teach some of the passes about the new PM.
Swift SVN r13494
2014-02-05 18:58:23 +00:00
Michael Gottesman
493ebd7cb7 [lower-aggregate-instrs] Change copy_addr lowering so that it emits lowered {copy,destroy}_values.
Swift SVN r11766
2013-12-31 04:10:18 +00:00
Michael Gottesman
95cef2498c [lower-aggregate-instrs] Change destroy_addr so that it emits lowered destroy values.
Now after the SSA boundary has been crossed the only destroy_values that exist
are from enums.

Swift SVN r11756
2013-12-31 01:38:23 +00:00
Michael Gottesman
ef9d8d8346 [lower-aggregate-instrs] Teach lower-aggregate-instrs how to use TypeLowering to produce "lowered" copy_values.
Swift SVN r11754
2013-12-31 01:10:46 +00:00
Michael Gottesman
f84ca4c921 [lower-aggregate-instrs] Change one usage of !isAddressOnly => isLoadable.
Swift SVN r11752
2013-12-31 00:18:36 +00:00
Michael Gottesman
4db62e36f3 [lower-aggregate-instrs] Fixed thinko by changing a conditional check to an assert.
destroy_value should only be called on loadable types (hence the assert).

Swift SVN r11751
2013-12-31 00:12:10 +00:00
Michael Gottesman
61b7382a1f [lower-aggregate-instrs] Use TypeLowering to lower destroy_value recursively (avoiding enums).
Swift SVN r11749
2013-12-30 23:07:33 +00:00
Michael Gottesman
542b782352 Remove period.
Swift SVN r11740
2013-12-30 08:24:44 +00:00
Michael Gottesman
612d622290 Rename current SILSROA => SILLowerAggregateInstrs.
Swift SVN r11739
2013-12-30 08:21:19 +00:00