tuple-producing results (like those produced by folding overflow builtins).
Before the pass would just RAUW the apply_inst with a tuple_inst, but this
would leave around a bunch of tuple extracts. Now we seek and destroy them.
This unblocks other transformations and allows the stdlib to shrink by another
1700 LOC.
Swift SVN r9900
This pass is a port of InstCombine from LLVM to SIL. Thus if you are familiar
with the code from InstCombine you will feel right at home.
Keep in mind that in order to help with review, this is just a skeleton with no
optimizations in it besides a simple DCE based off of isInstructionTriviallyDead
(which this patch exposes in Local.h like LLVM does) to ensure that trivial
testing of the pass can be accomplished since otherwise it would do nothing
implying that no tests could be written at all.
I additionally modified one test which no longer passed due to SILCombine
removing 1x unused metatype instruction from the standard library.
Swift SVN r9404
- Introduces the Builtin
- If the first parameter evaluates to '1', the dataflow diagnostics pass produces a diagnostic.
- The Builtin gets cleaned up before IRGen, but not before SIL serialization.
This patch also removes the current, overflow warning and XFAILs one of the tests. The other test is switched to use Builtin.staticReport.
TODO:
- Utilize the other parameters to the builtin - the Message and IsError flag.
- Use this Builtin within the stdlib.
Swift SVN r8939
And use them to decide if an llvm intrinsic apply instruction can be considered dead.
(This is a hack because it uses LLVM Global context. However, we already use
this approach elsewhere.)
Swift SVN r7404
Make the functions support a wider range of builtins and store types to make
it possible.
This is an optimization - the cached ID will be used for builtin identification,
instead of retrieval of the string name and using it as the key.
Swift SVN r7390
It would be good if LLVM provided mechanism to find out which intrinsics do not have side effects.
Currently, just ensure that everything we might constant fold is in that category.
Swift SVN r7312