249 Commits

Author SHA1 Message Date
Joerg Sonnenberger
732f95ff9a Reapply r374743 with a fix for the ocaml binding
Add a pass to lower is.constant and objectsize intrinsics

This pass lowers is.constant and objectsize intrinsics not simplified by
earlier constant folding, i.e. if the object given is not constant or if
not using the optimized pass chain. The result is recursively simplified
and constant conditionals are pruned, so that dead blocks are removed
even for -O0. This allows inline asm blocks with operand constraints to
work all the time.

The new pass replaces the existing lowering in the codegen-prepare pass
and fallbacks in SDAG/GlobalISEL and FastISel. The latter now assert
on the intrinsics.

Differential Revision: https://reviews.llvm.org/D65280


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374784 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-14 16:15:14 +00:00
Dmitri Gribenko
e0cea29324 Revert "Add a pass to lower is.constant and objectsize intrinsics"
This reverts commit r374743. It broke the build with Ocaml enabled:
http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/19218

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374768 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-14 12:22:48 +00:00
Joerg Sonnenberger
314e3cde15 Add a pass to lower is.constant and objectsize intrinsics
This pass lowers is.constant and objectsize intrinsics not simplified by
earlier constant folding, i.e. if the object given is not constant or if
not using the optimized pass chain. The result is recursively simplified
and constant conditionals are pruned, so that dead blocks are removed
even for -O0. This allows inline asm blocks with operand constraints to
work all the time.

The new pass replaces the existing lowering in the codegen-prepare pass
and fallbacks in SDAG/GlobalISEL and FastISel. The latter now assert
on the intrinsics.

Differential Revision: https://reviews.llvm.org/D65280


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374743 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-13 23:00:15 +00:00
David Bolvansky
b52cac3f40 [NFC} Updated test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372093 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-17 09:45:52 +00:00
David Green
3110f6b18e [CGP] Ensure sinking multiple instructions does not invalidate dominance checks
In MVE, as of rL371218, we are attempting to sink chains of instructions such as:
  %l1 = insertelement <8 x i8> undef, i8 %l0, i32 0
  %broadcast.splat26 = shufflevector <8 x i8> %l1, <8 x i8> undef, <8 x i32> zeroinitializer
In certain situations though, we can end up breaking the dominance relations of
instructions. This happens when we sink the instruction into a loop, but cannot
remove the originals. The Use is updated, which might in fact be a Use from the
second instruction to the first.

This attempts to fix that by reversing the order of instruction that are sunk,
and ensuring that we update the uses on new instructions if they have already
been sunk, not the old ones.

Differential Revision: https://reviews.llvm.org/D67366


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371743 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-12 16:00:07 +00:00
Sam Tebbs
087f60a05c [ARM] Sink add/mul(shufflevector(insertelement())) for MVE instruction selection
This patch sinks add/mul(shufflevector(insertelement())) into the basic block in which they are used so that they can then be selected together.

This is useful for various MVE instructions, such as vmla and others that take R registers.

Loop tests have been added to the vmla test file to make sure vmlas are generated in loops.

Differential revision: https://reviews.llvm.org/D66295

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371218 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-06 16:01:32 +00:00
Sanjay Patel
f67401bb31 [CodeGenPrepare] Fix use-after-free
If OptimizeExtractBits() encountered a shift instruction with no operands at all,
it would erase the instruction, but still return false.

This previously didn’t matter because its caller would always return after
processing the instruction, but https://reviews.llvm.org/D63233 changed the
function’s caller to fall through if it returned false, which would then cause
a use-after-free detectable by ASAN.

This change makes OptimizeExtractBits return true if it removes a shift
instruction with no users, terminating processing of the instruction.

Patch by: @brentdax (Brent Royal-Gordon)

Differential Revision: https://reviews.llvm.org/D66330

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369168 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-16 23:10:34 +00:00
Sanjay Patel
222b3548b7 [CodeGenPrepare] fix RUN line settings
I'm not sure if this was running as expected with a broken triple.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369156 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-16 21:37:49 +00:00
Fangrui Song
1002960b9d [lit] Delete empty lines at the end of lit.local.cfg NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363538 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-17 09:51:07 +00:00
Sanjay Patel
d049b8952b [CodeGenPrepare][x86] shift both sides of a vector select when profitable
This is based on the example/discussion in PR37428:
https://bugs.llvm.org/show_bug.cgi?id=37428

Proper vector shift instructions don't appear until AVX2, so we may generate several
extra instructions within a loop trying to compensate for that. It's difficult to
recover from that shift expansion later than this, so use the existing TLI hook and
splat analysis to enable better codegen.

This extends CGP functionality introduced with:
rL201655

Differential Revision: https://reviews.llvm.org/D63233

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363511 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-16 15:29:03 +00:00
Sanjay Patel
31b94430d7 [CodeGenPrepare] propagate debuginfo when copying a shuffle
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363409 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-14 15:05:35 +00:00
Sanjay Patel
d761cdb403 [x86] add tests for vector shifts; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363203 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-12 21:30:06 +00:00
Sanjay Patel
addf0bb7c5 [CodeGenPrepare] limit overflow intrinsic matching to a single basic block (2nd try)
This is a subset of the original commit from rL359879
which was reverted because it could crash when using the 'RemovedInstructions'
structure that enables delayed deletion of dead instructions. The motivating
compile-time win does not require that change though. We should get most of
that win from this change alone.

Using/updating a dominator tree to match math overflow patterns may be very
expensive in compile-time (because of the way CGP uses a DT), so just handle
the single-block case.

See post-commit thread for rL354298 for more details:
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20190422/646276.html

Differential Revision: https://reviews.llvm.org/D61075

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359969 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-04 12:46:32 +00:00
Evgeniy Stepanov
ff2899148a Revert "[CodeGenPrepare] limit overflow intrinsic matching to a single basic block"
This reverts commit r359879, which introduced a compiler crash.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359908 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-03 17:31:49 +00:00
Sanjay Patel
866bc92c5d [CodeGenPrepare] limit overflow intrinsic matching to a single basic block
Using/updating a dominator tree to match math overflow patterns may be very
expensive in compile-time (because of the way CGP uses a DT), so just handle
the single-block case.

Also, we were restarting the iterator loops when doing the overflow intrinsic
transforms by marking the dominator tree for update. That was done to prevent
iterating over a removed instruction. But we can postpone the deletion using
the existing "RemovedInsts" structure, and that means we don't need to update
the DT.

See post-commit thread for rL354298 for more details:
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20190422/646276.html

Differential Revision: https://reviews.llvm.org/D61075

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359879 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-03 13:09:18 +00:00
Eric Christopher
598198edbc Revert "Temporarily Revert "Add basic loop fusion pass.""
The reversion apparently deleted the test/Transforms directory.

Will be re-reverting again.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358552 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-17 04:52:47 +00:00
Eric Christopher
02cc44c1b9 Temporarily Revert "Add basic loop fusion pass."
As it's causing some bot failures (and per request from kbarton).

This reverts commit r358543/ab70da07286e618016e78247e4a24fcb84077fda.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358546 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-17 02:12:23 +00:00
Sanjay Patel
c4a68ddfbf [CodeGenPrepare] limit formation of overflow intrinsics (PR41129)
This is probably a bigger limitation than necessary, but since we don't have any evidence yet
that this transform led to real-world perf improvements rather than regressions, I'm making a
quick, blunt fix.

In the motivating x86 example from:
https://bugs.llvm.org/show_bug.cgi?id=41129
...and shown in the regression test, we want to avoid an extra instruction in the dominating
block because that could be costly.

The x86 LSR test diff is reversing the changes from D57789. There's no evidence that 1 version
is any better than the other yet.

Differential Revision: https://reviews.llvm.org/D59602

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356665 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-21 13:57:07 +00:00
Sanjay Patel
c8a95e16f6 [CGP][x86] add tests for usubo regression (PR41129); NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356559 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-20 15:02:35 +00:00
Sanjay Patel
f1180b0c1f [CGP] add another bailout for degenerate code (PR41064)
This is almost the same as:
rL355345
...and should prevent any potential crashing from examples like:
https://bugs.llvm.org/show_bug.cgi?id=41064
...although the bug was masked by:
rL355823
...and I'm not sure how to repro the problem after that change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356218 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-14 23:14:31 +00:00
Tim Northover
99eb9152f9 CodeGenPrep: preserve inbounds attribute when sinking GEPs.
Targets can potentially emit more efficient code if they know address
computations never overflow. For example ILP32 code on AArch64 (which only has
64-bit address computation) can ignore the possibility of overflow with this
extra information.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355926 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-12 15:22:23 +00:00
Sam Parker
64ecbb6deb [CGP] Limit distance between overflow math and cmp
Inserting an overflowing arithmetic intrinsic can increase register
pressure by producing two values at a point where only one is needed,
while the second use maybe several blocks away. This increase in
pressure is likely to be more detrimental on performance than
rematerialising one of the original instructions.
    
So, check that the arithmetic and compare instructions are no further
apart than their immediate successor/predecessor.

Differential Revision: https://reviews.llvm.org/D59024


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355823 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-11 13:19:46 +00:00
Rong Xu
3441a8988a [CodeGenPrepare] Fix ModifiedDT flag in optimizeSelectInst
r44412 fixed a huge compile time regression but it needed ModifiedDT flag to be
maintained correctly in optimizations in optimizeBlock() and optimizeInst().
Function optimizeSelectInst() does not update the flag.
This patch propagates the flag in optimizeSelectInst() back to
optimizeBlock().

This patch also removes ModifiedDT in CodeGenPrepare class (which is not used).
The property of ModifiedDT is now recorded in a ref parameter.

Differential Revision: https://reviews.llvm.org/D59139


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355751 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-08 22:46:18 +00:00
Florian Hahn
3cd4111205 [ARM] Sink zext/sext operands for add and sub to enable vsubl generation.
This uses the infrastructure added in rL353152 to sink zext and sexts to
sub/add users, to enable vsubl/vaddl generation when NEON is available.

See https://bugs.llvm.org/show_bug.cgi?id=40025.

Reviewers: SjoerdMeijer, t.p.northover, samparker, efriedma

Reviewed By: samparker

Differential Revision: https://reviews.llvm.org/D58063

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355460 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-06 00:10:03 +00:00
Sanjay Patel
b4cc6b6cce [CodeGenPrepare] avoid crashing on non-canonical/degenerate code
The test is reduced from an example in the post-commit thread for:
rL354746
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20190304/632396.html

While we must avoid dying here, the real question should be:
Why is non-canonical and/or degenerate code making it to CGP when
using the new pass manager?

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355345 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-04 22:47:13 +00:00
Sanjay Patel
5478a36577 [CGP] add special-cases to form unsigned add with overflow (PR40486)
There's likely a missed IR canonicalization for at least 1 of these
patterns. Otherwise, we wouldn't have needed the pattern-matching
enhancement in D57516.

Note that -- unlike usubo added with D57789 -- the TLI hook for
this transform defaults to 'on'. So if there's any perf fallout
from this, targets should look at how they're lowering the uaddo
node in SDAG and/or override that hook.

The x86 diffs suggest that there's some missing pattern-matching
for forming inc/dec.

This should fix the remaining known problems in:
https://bugs.llvm.org/show_bug.cgi?id=40486
https://bugs.llvm.org/show_bug.cgi?id=31754

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354746 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-24 15:31:27 +00:00
Sanjay Patel
54963e6ab5 [CGP] add tests for uaddo increment/decrement; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354699 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-22 23:19:34 +00:00
Sanjay Patel
1f63d705ea [CGP] match a special-case of unsigned subtract overflow
This is the 'sub0' (negate) pattern from PR31754:
https://bugs.llvm.org/show_bug.cgi?id=31754

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354519 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-20 21:23:04 +00:00
Sanjay Patel
9d24991253 [CGP][x86] add tests for usubo special-case; NFC
This is another example from PR31754:
https://bugs.llvm.org/show_bug.cgi?id=31754

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354475 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-20 15:40:58 +00:00
Sanjay Patel
09f3b5ecb1 [CGP] form usub with overflow from sub+icmp
The motivating x86 cases for forming the intrinsic are shown in PR31754 and PR40487:
https://bugs.llvm.org/show_bug.cgi?id=31754
https://bugs.llvm.org/show_bug.cgi?id=40487
..and those are shown in the IR test file and x86 codegen file.

Matching the usubo pattern is harder than uaddo because we have 2 independent values rather than a def-use.

This adds a TLI hook that should preserve the existing behavior for uaddo formation, but disables usubo
formation by default. Only x86 overrides that setting for now although other targets will likely benefit
by forming usbuo too.

Differential Revision: https://reviews.llvm.org/D57789

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354298 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-18 23:33:05 +00:00
Sanjay Patel
66802c5920 [CGP] add test for unsigned subtract of 1 with overflow; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353179 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-05 15:27:40 +00:00
Florian Hahn
24094aacfd [CGP] Add support for sinking operands to their users, if they are free.
This patch improves code generation for some AArch64 ACLE intrinsics. It adds
support to CGP to duplicate and sink operands to their user, if they can be
folded into a target instruction, like zexts and sub into usubl. It adds a
TargetLowering hook shouldSinkOperands, which looks at the operands of
instructions to see if sinking is profitable.

I decided to add a new target hook, as for the sinking to be profitable,
at least on AArch64, we have to look at multiple operands of an
instruction, instead of looking at the users of a zext for example.

The sinking is done in CGP, because it works around an instruction
selection limitation. If instruction selection is not limited to a
single basic block, this patch should not be needed any longer.

Alternatively this could be done in the LoopSink pass, which tries to
undo LICM for instructions in blocks that are not executed frequently.

Note that we do not force the operands to sink to have a single user,
because we duplicate them before sinking. Therefore this is only
desirable if they really can be done for free. Additionally we could
consider the impact on live ranges later on.

This should fix https://bugs.llvm.org/show_bug.cgi?id=40025.

As for performance, we have internal code that uses intrinsics and can
be speed up by 10% by this change.

Reviewers: SjoerdMeijer, t.p.northover, samparker, efriedma, RKSimon, spatel

Reviewed By: samparker

Differential Revision: https://reviews.llvm.org/D57377

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353152 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-05 10:27:40 +00:00
Sanjay Patel
02e3a27780 [CGP] fix bogus test names/comments; NFC
Inverted operand 0 and operand 1.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353106 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-04 22:37:05 +00:00
Sanjay Patel
370040444e [CGP] add tests for usubo; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353103 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-04 22:27:08 +00:00
Sanjay Patel
16d0c7bf1b [CGP] use IRBuilder to simplify code
This is no-functional-change-intended although there could
be intermediate variations caused by a difference in the
debug info produced by setting that from the builder's 
insertion point. 

I'm updating the IR test file associated with this code just
to show that the naming differences from using the builder
are visible.

The motivation for adding a helper function is that we are
likely to extend this code to deal with other overflow ops.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353056 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-04 16:30:46 +00:00
Sanjay Patel
25df0ed1c5 [CGP] adjust target constraints for forming uaddo
There are 2 changes visible here:
1. There's no reason to limit this transform based on number
   of condition registers. That diff allows PPC to produce 
   slightly better (dot-instructions should be generally good) 
   code.
   Note: someone that cares about PPC codegen might want to 
   look closer at that output because it seems like we could
   still improve this.

2. We (probably?) should not bother trying to form uaddo (or
   other overflow ops) when there's no target support for such
   an op. This goes beyond checking whether the op is expanded
   because both PPC and AArch64 show better codegen for standard
   types regardless of whether the op is legal/custom.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353001 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-03 17:53:09 +00:00
Sanjay Patel
cf5cc9f6fa [PatternMatch] add special-case uaddo matching for increment-by-one (2nd try)
This is the most important uaddo problem mentioned in PR31754:
https://bugs.llvm.org/show_bug.cgi?id=31754
...but that was overcome in x86 codegen with D57637.

That patch also corrects the inc vs. add regressions seen with the  previous attempt at this.

Still, we want to make this matcher complete, so we can potentially canonicalize the pattern 
even if it's an 'add 1' operation.
Pattern matching, however, shouldn't assume that we have canonicalized IR, so we match 4 
commuted variants of uaddo.

There's also a test with a crazy type to show that the existing CGP transform based on this 
matcher is not limited by target legality checks.

I'm not sure if the Hexagon diff means the test is no longer testing what it intended to
test, but that should be solvable in a follow-up.

Differential Revision: https://reviews.llvm.org/D57516


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352998 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-03 16:16:48 +00:00
Sanjay Patel
dc695c68e3 [CGP] move test file to prevent bot failures
The test specifiies the triple, so it needs to be in the
x86 directory in case a bot has been configured without
the x86 target.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352992 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-03 14:19:45 +00:00
Philip Reames
3396a8da4a Lower widenable_conditions in CGP
This ensures that if we make it to the backend w/o lowering widenable_conditions first, that we generate correct code. Doing it in CGP - instead of isel - let's us fold control flow before hitting block local instruction selection.

Differential Revision: https://reviews.llvm.org/D57473



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352779 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-31 18:45:46 +00:00
Sanjay Patel
c5a629476d revert r352766: [PatternMatch] add special-case uaddo matching for increment-by-one
Missed some regression test updates when testing this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352769 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-31 16:48:42 +00:00
Sanjay Patel
2540582e98 [PatternMatch] add special-case uaddo matching for increment-by-one
This is the most important uaddo problem mentioned in PR31754:
https://bugs.llvm.org/show_bug.cgi?id=31754

We were failing to match the canonicalized pattern when it's an 'add 1' operation.
Pattern matching, however, shouldn't assume that we have canonicalized IR, so we 
match 4 commuted variants of uaddo.

There's also a test with a crazy type to show that the existing CGP transform 
based on this matcher is not limited by target legality checks, but that's a
different problem.

Differential Revision: https://reviews.llvm.org/D57516


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352766 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-31 16:40:07 +00:00
Sanjay Patel
922a3b1b32 [CGP] add more tests for uaddo; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352762 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-31 15:48:46 +00:00
David L. Jones
3ced154888 Revert "Reapply "[CGP] Check for existing inttotpr before creating new one""
This change reverts r351626.

The changes in r351626 cause quadratic work in several cases. (See r351626 thread on llvm-commits for details.)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352722 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-31 03:28:46 +00:00
Erik Pilkington
99ef84fa6f Add a 'dynamic' parameter to the objectsize intrinsic
This is meant to be used with clang's __builtin_dynamic_object_size.
When 'true' is passed to this parameter, the intrinsic has the
potential to be folded into instructions that will be evaluated
at run time. When 'false', the objectsize intrinsic behaviour is
unchanged.

rdar://32212419

Differential revision: https://reviews.llvm.org/D56761

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352664 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-30 20:34:35 +00:00
Sanjay Patel
16315ca654 [CGP] auto-generate complete checks for add overflow tests; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352437 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-28 22:07:37 +00:00
Roman Tereshin
23188a224d Reapply "[CGP] Check for existing inttotpr before creating new one"
Original commit: r351582

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351626 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-19 03:37:25 +00:00
Roman Tereshin
b63d21f450 Revert "Reapply "[CGP] Check for existing inttotpr before creating new one""
This reverts commit r351618.

Compiler RT + ASAN tests are failing for PowerPC. Not sure
how would I reproduce these on macOS, so reverting (again)
until I do.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351619 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-19 01:53:26 +00:00
Roman Tereshin
f10dba2c63 Reapply "[CGP] Check for existing inttotpr before creating new one"
Original commit: r351582

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351618 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-19 01:41:03 +00:00
Roman Tereshin
2149e3fb04 Revert "[CGP] Check for existing inttotpr before creating new one"
This reverts commit r351582.

Bots are failing. Reverting this to fix and re-commit later.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351598 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-18 21:38:44 +00:00
Roman Tereshin
61b2398bad [CGP] Check for existing inttotpr before creating new one
Make sure CodeGenPrepare doesn't emit multiple inttoptr instructions of
the same integer value while sinking address computations, but rather
CSEs them on the fly: excessive inttoptr's confuse SCEV into thinking
that related pointers have nothing to do with each other.

This problem blocks LoadStoreVectorizer from vectorizing some of the
loads / stores in a downstream target.

Reviewed By: hfinkel

Differential Revision: https://reviews.llvm.org/D56838

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351582 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-18 20:13:42 +00:00