Commit Graph

64 Commits

Author SHA1 Message Date
Joe Groff
0518f2067f Revert "SIL: Drop the upcast_existential* instructions."
This reverts commit r22333.

Swift SVN r22337
2014-09-28 18:41:05 +00:00
Joe Groff
727c9b5ed7 SIL: Drop the upcast_existential* instructions.
Swift SVN r22333
2014-09-28 16:38:13 +00:00
Doug Gregor
c504086266 Revert r21707 "Remove the SIL is_nonnull instruction. It's no longer useful."
We want to be able to work around problems with non-failable
Objective-C initializers actually failing, which can happen when the
API audit data incorrectly marks an initializer as non-failable.



Swift SVN r21711
2014-09-04 17:26:34 +00:00
Doug Gregor
cdf94885ae Remove the SIL is_nonnull instruction. It's no longer useful.
Swift SVN r21707
2014-09-04 15:56:12 +00:00
Roman Levenstein
933e4bff17 [sil-simplify] Peepholes for (trunc (s_to_u (zext x)))->x and (trunc (u_to_s (zext (lshr x 1) Word -> Int64)) Int64 -> Word) -> (lshr x 1).
Related to rdar://17433082 and rdar://17406327

Swift SVN r21700
2014-09-04 10:27:08 +00:00
Michael Gottesman
8287d986d6 [patternmatch] Create matchers for all unary instructions that enable further matchers to be applied to the unary instructions argument.
Swift SVN r21539
2014-08-28 20:46:22 +00:00
Pete Cooper
f4a2e8294b Make PatternMatch behave the same for ApplyInst arguments, regardless of whether we are matching a SILValue or another subpattern. The problem here was that we'd access arguments in one path but operands in another. Test case to follow soon
Swift SVN r19000
2014-06-19 15:59:58 +00:00
Pete Cooper
73bda9a8ed Clean up pattern match m_zero and m_One to avoid duplication. Thanks Jordan for the feedback
Swift SVN r18870
2014-06-13 17:11:47 +00:00
Pete Cooper
9c00e8a55a Simplify add/sub/mul overflow intrinsics where one operand is a 0 or 1
Swift SVN r18857
2014-06-13 06:06:53 +00:00
Michael Gottesman
fd0a78b301 [sil-combine] Canonicalize index_raw_addr byte indexing operations => index_addr object size indexing operations.
This should eliminate pointless operations that get added to our inline
cost itinerary.

rdar://15567647
rdar://16762768
rdar://16832529

Swift SVN r17644
2014-05-07 22:01:30 +00:00
Michael Gottesman
7e95367de9 [PatternMatch] Change m_Apply_Ty => Apply_match to match the rest of the matcher structs.
Swift SVN r10734
2013-12-02 22:20:08 +00:00
Michael Gottesman
81ab6382b9 Add a template specialization to PatternMatch::match for SILValue to eliminate need for match(&*Value) to match.
I also updated the relevant code to use match(Value) instead of match(&*Value).

Swift SVN r10659
2013-11-22 06:37:13 +00:00
Michael Gottesman
a18e25f314 Add SILArgument/SILUndef includes to PatternMatch.h since we generate matchers for SILArgument, SILUndef.
Swift SVN r10567
2013-11-19 23:34:40 +00:00
Michael Gottesman
fdebc3db11 [sil-combine] Port of LLVM's pattern matching infrastructure to SIL.
The attached patch is a port of LLVM's PatternMatch infrastructure for SIL.
LLVM's pattern matching infrastructure is how much of InstCombine is implemented
and the brevity of its pattern matching should be a boon to SILCombine's
implementation as well.

Many basic matchers have been implemented, but of course many more *could* be
implemented (i.e. this is a work in progress).

Swift SVN r9650
2013-10-24 19:25:58 +00:00