| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
| |
original value if types don't match.
Fixes clang selfhost.
llvm-svn: 139120
|
|
|
|
|
|
| |
up do-nothing exception handling code produced by dragonegg.
llvm-svn: 139113
|
|
|
|
|
|
| |
is clearly impossible given the current structure of the code.
llvm-svn: 137853
|
|
|
|
|
|
| |
how to actually trigger the codepath in question at the moment, but it might get exposed in the future.
llvm-svn: 137781
|
|
|
|
|
|
| |
reported at http://habrahabr.ru/blogs/compilers/125626/.
llvm-svn: 136865
|
|
|
|
|
|
|
| |
way for i1 and vector of i1 types. Use these to make some code
more self-documenting.
llvm-svn: 136079
|
|
|
|
| |
llvm-svn: 135904
|
|
|
|
|
|
| |
ConstantExpr::getInBoundsGetElementPtr to use ArrayRef.
llvm-svn: 135673
|
|
|
|
| |
llvm-svn: 135482
|
|
|
|
| |
llvm-svn: 135477
|
|
|
|
| |
llvm-svn: 135375
|
|
|
|
| |
llvm-svn: 134223
|
|
|
|
|
|
|
| |
often expressed as "x >= y ? x : y", there is a good chance we can extract
the existing "x >= y" from it and use that as a replacement for "max(x,y)==x".
llvm-svn: 131049
|
|
|
|
|
|
| |
side of the icmp is an exact shift.
llvm-svn: 130954
|
|
|
|
|
|
|
|
| |
but according to my super-optimizer there are only two missed simplifications
of -instsimplify kind when compiling bzip2, and this is one of them. It amuses
me to have bzip2 be perfectly optimized as far as instsimplify goes!
llvm-svn: 130840
|
|
|
|
|
|
|
|
| |
max(a,b) >= a -> true. According to my super-optimizer, these are
by far the most common simplifications (of the -instsimplify kind)
that occur in the testsuite and aren't caught by -std-compile-opts.
llvm-svn: 130780
|
|
|
|
|
|
| |
a vector compare, generate a vector result rather than i1 (and crashing).
llvm-svn: 130706
|
|
|
|
|
|
|
| |
This automagically provides a transform noticed by my super-optimizer
as occurring quite often: "rem x, (select cond, x, 1)" -> 0.
llvm-svn: 130694
|
|
|
|
| |
llvm-svn: 129271
|
|
|
|
|
|
| |
Thanks Duncan Sands!
llvm-svn: 127323
|
|
|
|
|
|
|
|
|
| |
gave up when I realized I couldn't come up with a good name for what the
refactored function would be, to describe what it does.
This is PR9343 test12, which is test3 with arguments reordered. Whoops!
llvm-svn: 127318
|
|
|
|
|
|
|
|
|
| |
possible. This goes into instcombine and instsimplify because instsimplify
doesn't need to check hasOneUse since it returns (almost exclusively) constants.
This fixes PR9343 #4 #5 and #8!
llvm-svn: 127064
|
|
|
|
| |
llvm-svn: 127021
|
|
|
|
|
|
|
| |
in the urem case, though not the other way around. This is enough to get #3 from
PR9343!
llvm-svn: 126991
|
|
|
|
|
|
|
|
|
| |
"icmp pred %X, CI" and a number of examples where "%X = binop %Y, CI2".
Some of these cases (div and rem) used to make it through opt -O2, but the
others are probably now making code elsewhere redundant (probably instcombine).
llvm-svn: 126988
|
|
|
|
|
|
|
| |
more work to do here, "icmp ult (urem X, 10), 11" doesn't optimize away yet.
Fixes example 3 from PR9343!
llvm-svn: 126741
|
|
|
|
| |
llvm-svn: 126082
|
|
|
|
| |
llvm-svn: 125463
|
|
|
|
|
|
|
|
| |
plus some variations of this. According to my auto-simplifier this occurs a lot
but usually in combination with max/min idioms. Because max/min aren't handled
yet this unfortunately doesn't have much effect in the testsuite.
llvm-svn: 125462
|
|
|
|
| |
llvm-svn: 125200
|
|
|
|
|
|
| |
improve interfaces to instsimplify to take this info.
llvm-svn: 125196
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
versions of creation functions. Eventually, the "insertion point" versions
of these should just be removed, we do have IRBuilder afterall.
Do a massive rewrite of much of pattern match. It is now shorter and less
redundant and has several other widgets I will be using in other patches.
Among other changes, m_Div is renamed to m_IDiv (since it only matches
integer divides) and m_Shift is gone (it used to match all binops!!) and
we now have m_LogicalShift for the one client to use.
Enhance IRBuilder to have "isExact" arguments to things like CreateUDiv
and reduce redundancy within IRbuilder by having these methods chain to
each other more instead of duplicating code.
llvm-svn: 125194
|
|
|
|
|
|
| |
to simplify the "(X/Y)*Y->X when the division is exact" transform.
llvm-svn: 125004
|
|
|
|
|
|
| |
when the div is an exact udiv.
llvm-svn: 124994
|
|
|
|
| |
llvm-svn: 124961
|
|
|
|
|
|
|
|
|
|
| |
auto-simplifier). This has a big impact on Ada code, but not much else.
Unfortunately the impact is mostly negative! This is due to PR9004 (aka
SCCP failing to resolve conditional branch conditions in the destination
blocks of the branch), in which simple correlated expressions are not
resolved but complicated ones are, so simplifying has a bad effect!
llvm-svn: 124788
|
|
|
|
|
|
|
|
| |
overflow (nsw flag), which was disabled because it breaks 254.gap. I have
informed the GAP authors of the mistake in their code, and arranged for the
testsuite to use -fwrapv when compiling this benchmark.
llvm-svn: 124746
|
|
|
|
|
|
|
| |
pattern matching can also pattern match undef, creating a more uniform
style.
llvm-svn: 124657
|
|
|
|
| |
llvm-svn: 124655
|
|
|
|
|
|
| |
by PR9088 fixes things.
llvm-svn: 124561
|
|
|
|
|
|
|
|
|
|
|
|
| |
knows how
to do this and more, but would only do it if X/Y had only one use. Spotted as the
most common missed simplification in SPEC by my auto-simplifier, now that it knows
about nuw/nsw/exact flags. This removes a bunch of multiplications from 447.dealII
and 483.xalancbmk. It also removes a lot from tramp3d-v4, which results in much
more inlining.
llvm-svn: 124560
|
|
|
|
| |
llvm-svn: 124544
|
|
|
|
| |
llvm-svn: 124534
|
|
|
|
| |
llvm-svn: 124497
|
|
|
|
|
|
|
|
| |
basically
zero effect on the testsuite (it improves two Ada testcases).
llvm-svn: 124496
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
benchmarks, and that it can be simplified to X/Y. (In general you can only
simplify (Z*Y)/Y to Z if the multiplication did not overflow; if Z has the
form "X/Y" then this is the case). This patch implements that transform and
moves some Div logic out of instcombine and into InstructionSimplify.
Unfortunately instcombine gets in the way somewhat, since it likes to change
(X/Y)*Y into X-(X rem Y), so I had to teach instcombine about this too.
Finally, thanks to the NSW/NUW flags, sometimes we know directly that "Z*Y"
does not overflow, because the flag says so, so I added that logic too. This
eliminates a bunch of divisions and subtractions in 447.dealII, and has good
effects on some other benchmarks too. It seems to have quite an effect on
tramp3d-v4 but it's hard to say if it's good or bad because inlining decisions
changed, resulting in massive changes all over.
llvm-svn: 124487
|
|
|
|
|
|
|
|
|
|
|
| |
optimized code are:
(non-negative number)+(power-of-two) != 0 -> true
and
(x | 1) != 0 -> true
Instcombine knows about the second one of course, but only does it if X|1
has only one use. These fire thousands of times in the testsuite.
llvm-svn: 124183
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
auto-simplier the transform most missed by early-cse is (zext X) != 0 -> X != 0.
This patch adds this transform and some related logic to InstructionSimplify
and removes some of the logic from instcombine (unfortunately not all because
there are several situations in which instcombine can improve things by making
new instructions, whereas instsimplify is not allowed to do this). At -O2 this
often results in more than 15% more simplifications by early-cse, and results in
hundreds of lines of bitcode being eliminated from the testsuite. I did see some
small negative effects in the testsuite, for example a few additional instructions
in three programs. One program, 483.xalancbmk, got an additional 35 instructions,
which seems to be due to a function getting an additional instruction and then
being inlined all over the place.
llvm-svn: 123911
|
|
|
|
|
|
|
|
|
|
| |
1) -> -1.
These were not recommended by my auto-simplifier since they don't fire often enough.
However they do fire from time to time, for example they remove one subtraction from
the final bitcode for 483.xalancbmk.
llvm-svn: 123755
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
common missed
simplification in fully optimized code. It occurs sporadically in the testsuite, and
many times in 403.gcc: the final bitcode has 131 fewer subtractions after this change.
The reason that the multiplies are not eliminated is the same reason that instcombine
did not catch this: they are used by other instructions (instcombine catches this with
a more general transform which in general is only profitable if the operands have only
one use).
llvm-svn: 123754
|