185620 Commits

Author SHA1 Message Date
Jessica Paquette
126b679a29 [AArch64][GlobalISel] Choose CCAssignFns per-argument for tail call lowering
When checking for tail call eligibility, we should use the correct CCAssignFn
for each argument, rather than just checking if the caller/callee is varargs or
not.

This is important for tail call lowering with varargs. If we don't check it,
then basically any varargs callee with parameters cannot be tail called on
Darwin, for one thing. If the parameters are all guaranteed to be in registers,
this should be entirely safe.

On top of that, not checking for this could potentially make it so that we have
the wrong stack offsets when checking for tail call eligibility.

Also refactor some of the stuff for CCAssignFnForCall and pull it out into a
helper function.

Update call-translator-tail-call.ll to show that we can now correctly tail call
on Darwin. Also add two extra tail call checks. The first verifies that we still
respect the caller's stack size, and the second verifies that we still don't
tail call when a varargs function has a memory argument.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372897 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-25 16:45:35 +00:00
Evandro Menezes
bd5ddbcfeb [CodeGen] Replace -max-jump-table-size with -max-jump-table-targets
Modern processors predict the targets of an indirect branch regardless of
the size of any jump table used to glean its target address.  Moreover,
branch predictors typically use resources limited by the number of actual
targets that occur at run time.

This patch changes the semantics of the option `-max-jump-table-size` to limit
the number of different targets instead of the number of entries in a jump
table.  Thus, it is now renamed to `-max-jump-table-targets`.

Before, when `-max-jump-table-size` was specified, it could happen that
cluster jump tables could have targets used repeatedly, but each one was
counted and typically resulted in tables with the same number of entries.
With this patch, when specifying `-max-jump-table-targets`, tables may have
different lengths, since the number of unique targets is counted towards the
limit, but the number of unique targets in tables is the same, but for the
last one containing the balance of targets.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372893 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-25 16:10:20 +00:00
Florian Hahn
314fba3fbf [LangRef] Clarify absence of rounding guarantees for fmuladd.
During the review of D67434, it was recommended to make fmuladd's
behavior more explicit. D67434 depends on this interpretation.

Reviewers: efriedma, jfb, reames, scanon, lebedev.ri, spatel

Reviewed By: spatel

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372892 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-25 16:09:24 +00:00
Sanjay Patel
d7ca0d78e9 [DAGCombiner] add one-use restriction to vector transform with cheap extract
We might be able to do better on the example in the test,
but in general, we should not scalarize a splatted vector
binop if there are other uses of the binop. Otherwise, we
can end up with code as we had - a scalar op that is
redundant with a vector op.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372886 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-25 15:08:33 +00:00
Florian Hahn
bf42ae9f64 [PatternMatch] Make m_Br more flexible, add matchers for BB values.
Currently m_Br only takes references to BasicBlock*, which limits its
flexibility. For example, you have to declare a variable, even if you
ignore the result or you have to have additional checks to make sure the
matched BB matches an expected one.

This patch adds m_BasicBlock and m_SpecificBB matchers, which can be
used like the existing matchers for constants or values.

I also had a look at the existing uses and updated a few. IMO it makes
the code a bit more explicit.

Reviewers: spatel, craig.topper, RKSimon, majnemer, lebedev.ri

Reviewed By: lebedev.ri

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372885 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-25 15:05:08 +00:00
Sanjay Patel
17118e5be7 [x86] add test for multi-use scalarization of vector binop; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372883 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-25 14:57:45 +00:00
Simon Pilgrim
e8d798abaa [TargetInstrInfo] Let findCommutedOpIndices take const MachineInstr&
Neither the base implementation of findCommutedOpIndices nor any in-tree target modifies the instruction passed in and there is no reason why they would in the future.

Committed on behalf of @hvdijk (Harald van Dijk)

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372882 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-25 14:55:57 +00:00
Florian Hahn
52b34f9864 [PatternMatch] Generalize brc_match (NFC).
Preparation for D68013.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372881 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-25 14:53:06 +00:00
Sanjay Patel
b7acbfc2f3 [IR] allow fast-math-flags on phi of FP values (2nd try)
The changes here are based on the corresponding diffs for allowing FMF on 'select':
D61917 <https://reviews.llvm.org/D61917>

As discussed there, we want to have fast-math-flags be a property of an FP value
because the alternative (having them on things like fcmp) leads to logical
inconsistency such as:
https://bugs.llvm.org/show_bug.cgi?id=38086

The earlier patch for select made almost no practical difference because most
unoptimized conditional code begins life as a phi (based on what I see in clang).
Similarly, I don't expect this patch to do much on its own either because
SimplifyCFG promptly drops the flags when converting to select on a minimal
example like:
https://bugs.llvm.org/show_bug.cgi?id=39535

But once we have this plumbing in place, we should be able to wire up the FMF
propagation and start solving cases like that.

The change to RecurrenceDescriptor::AddReductionVar() is required to prevent a
regression in a LoopVectorize test. We are intersecting the FMF of any
FPMathOperator there, so if a phi is not properly annotated, new math
instructions may not be either. Once we fix the propagation in SimplifyCFG, it
may be safe to remove that hack.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372878 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-25 14:35:02 +00:00
Simon Pilgrim
3f73a2b50d Fix analyzer TypeAttributeImpl::anchor() override.
TypeAttributeImpl inherits from EnumAttributeImpl which already defines anchor() as a virtual, so we should override this instead of redeclaring it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372877 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-25 14:23:25 +00:00
Marco Antognini
da625a1581 [gn build] Fix Python DeprecationWarning
Summary:
This fixes two issues:
 - DeprecationWarning: invalid escape sequence \`
 - ResourceWarning: unclosed file

Subscribers: mgorny, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372876 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-25 14:15:34 +00:00
Jakub Kuderski
a06891a3ca [Dominators][AMDGPU] Don't use virtual exit node in findNearestCommonDominator. Cleanup MachinePostDominators.
Summary:
This patch fixes a bug that originated from passing a virtual exit block (nullptr) to `MachinePostDominatorTee::findNearestCommonDominator` and resulted in assertion failures inside its callee. It also applies a small cleanup to the class.

The patch introduces a new function in PDT that given a list of `MachineBasicBlock`s finds their NCD. The new overload of `findNearestCommonDominator` handles virtual root correctly.

Note that similar handling of virtual root nodes is not necessary in (forward) `DominatorTree`s, as right now they don't use virtual roots.

Reviewers: tstellar, tpr, nhaehnle, arsenm, NutshellySima, grosser, hliao

Reviewed By: hliao

Subscribers: hliao, kzhuravl, jvesely, wdng, yaxunl, dstuttard, t-tye, hiraditya, llvm-commits

Tags: #amdgpu, #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372874 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-25 14:04:36 +00:00
Jonas Paulsson
e22ce6ac6a [SystemZ] Improve emitSelect()
Merge more Select pseudo instructions in emitSelect() by allowing other
instructions between them as long as they do not clobber CC.

Debug value instructions are now moved down to below the new PHIs instead of
erasing them.

Review: Ulrich Weigand
https://reviews.llvm.org/D67619

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372873 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-25 14:00:33 +00:00
Simon Pilgrim
b196b4bbdf Fix cppcheck variable shadow warning. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372872 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-25 13:45:36 +00:00
Simon Pilgrim
301951dff8 Add missing ExplicitTy default initialization to ConstantExprKeyType constructors.
Fixes cppcheck uninitialized variable warnings

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372871 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-25 13:38:54 +00:00
Sanjay Patel
9dcc14cb65 Revert [IR] allow fast-math-flags on phi of FP values
This reverts r372866 (git commit dec03223a97af0e4dfcb23da55c0f7f8c9b62d00)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372868 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-25 13:29:09 +00:00
George Rimar
0a0ac9dcfb [llvm-readobj/llvm-readelf] - .stack_sizes: demangle symbol names in warnings reported.
I started this patch as a refactoring, tried to make a helper for
getting symbol names, similar to how we get section names
used in warning messages.

So this patch cleanups the code and fixes an issue: symbol names
in warning messages were not demangled.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372867 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-25 13:16:43 +00:00
Sanjay Patel
5d102992ac [IR] allow fast-math-flags on phi of FP values
The changes here are based on the corresponding diffs for allowing FMF on 'select':
D61917

As discussed there, we want to have fast-math-flags be a property of an FP value
because the alternative (having them on things like fcmp) leads to logical
inconsistency such as:
https://bugs.llvm.org/show_bug.cgi?id=38086

The earlier patch for select made almost no practical difference because most
unoptimized conditional code begins life as a phi (based on what I see in clang).
Similarly, I don't expect this patch to do much on its own either because
SimplifyCFG promptly drops the flags when converting to select on a minimal
example like:
https://bugs.llvm.org/show_bug.cgi?id=39535

But once we have this plumbing in place, we should be able to wire up the FMF
propagation and start solving cases like that.

The change to RecurrenceDescriptor::AddReductionVar() is required to prevent a
regression in a LoopVectorize test. We are intersecting the FMF of any
FPMathOperator there, so if a phi is not properly annotated, new math
instructions may not be either. Once we fix the propagation in SimplifyCFG, it
may be safe to remove that hack.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372866 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-25 13:14:12 +00:00
James Henderson
0def545331 [docs][llvm-strings] Clarify "printable character" wording
The --bytes option uses the phrase "printable ASCII characters", but the
description section used simply "printable characters". To avoid any
confusion about locale impacts etc, this change adopts the former's
phrasing in both places. It also fixes a minor grammar issue in the
description.

Reviewed by: MaskRay

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372865 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-25 13:09:17 +00:00
James Henderson
cf5165889c [docs][llvm-strip] Update llvm-strip doc to better match llvm-objcopy's
Main changes are mostly wording of some options, but this change also
fixes a switch reference so that a link is created and moves
--strip-sections into the ELF-specific area since it is only supported
for ELF currently.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372864 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-25 13:09:12 +00:00
Dmitry Preobrazhensky
9c0dcead36 [AMDGPU][MC][DOC] Updated AMD GPU assembler description.
Summary of changes:
- Updated to reflect recent changes in assembler;
- Minor bugfixing and improvements.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372857 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-25 12:38:35 +00:00
Simon Pilgrim
7324e2c791 [DAG] Pull out minimum shift value calc into a helper function. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372856 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-25 12:28:56 +00:00
George Rimar
a5540bb6d8 [llvm-readobj] - Simplify stack-sizes.test test case.
This is a follow-up for D67757,
which allows to describe .stack_sizes sections with a new
YAML syntax.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372855 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-25 12:18:45 +00:00
George Rimar
07b4e49342 [yaml2elf] - Support describing .stack_sizes sections using unique suffixes.
Currently we can't use unique suffixes in section names to describe
stack sizes sections. E.g. '.stack_sizes [1]' will be treated as a regular section.
This happens because we recognize stack sizes section by name and
do not yet drop the suffix before the check.

The patch fixes it.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372853 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-25 12:09:30 +00:00
Nico Weber
2fd605ca71 gn build: (manually) merge r372843
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372850 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-25 12:02:00 +00:00
George Rimar
b0a934b644 [yaml2obj] - Add a Size field for StackSizesSection.
It is a follow-up requested in the review comment
for D67757. Allows to use Content + Size or just Size
when describing .stack_sizes sections in YAML document

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372845 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-25 11:40:11 +00:00
GN Sync Bot
ebc14a15c4 gn build: Merge r372841
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372842 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-25 10:35:03 +00:00
David Green
a35e525184 [ARM] Ensure we do not attempt to create lsll #0
During legalisation we can end up with some pretty strange nodes, like shifts
of 0. We need to make sure we don't try to make long shifts of these, ending up
with invalid assembly instructions. A long shift with a zero immediate actually
encodes a shift by 32.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372839 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-25 10:16:48 +00:00
George Rimar
bf355ffd89 [llvm-readobj] - Don't crash when dumping .stack_sizes and unable to find a relocation resolver.
The crash might happen when we have either a broken or unsupported object
and trying to resolve relocations when dumping the .stack_sizes section.

For the test case I used a 32-bits ELF header and a 64-bit relocation.
In this case a null pointer is returned by the code instead of the relocation
resolver function and then we crash.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372838 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-25 10:14:50 +00:00
Jay Foad
9edd4decf5 Add tracing in pickNodeFromQueue.
This matches GenericScheduler::pickNodeFromQueue, from which this
function was mostly cut and pasted.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372829 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-25 08:45:41 +00:00
Jay Foad
73dfa5bbf7 Fix signature of overloaded operator delete.
This overload was left over from an operator new that was removed in
r123027. Fix it to match another operator new that was added in r248453.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372828 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-25 08:45:36 +00:00
Florian Hahn
5e262f0ee5 [AArch64] Convert neon_ushl and neon_sshl with positive constants to VSHL.
I think we should be able to use shl instead of sshl and ushl for
positive constant shift values, unless I am missing something.

We already have the machinery in place to ensure we only replace
nodes, if the shift value is positive and <= the element width.

This is a generalization of an earlier patch rL372565.

Reviewers: t.p.northover, samparker, dmgreen, anemet

Reviewed By: anemet

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372824 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-25 08:22:05 +00:00
Fangrui Song
47bdb06dc7 [ADT] Add StringMap::insert_or_assign
Summary: Similar to std::unordered_map::insert_or_assign

Reviewers: alexshap, bkramer, dblaikie, lhames

Subscribers: jkorous, dexonsmith, kristina, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372813 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-25 04:58:02 +00:00
Amara Emerson
be604320b6 [AArch64][GlobalISel] Tweak legalization rule for G_BSWAP to handle widening s16.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372812 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-25 04:52:42 +00:00
Huihui Zhang
db70fdfb85 [NFC] Add { } to silence compiler warning [-Wmissing-braces].
/local/mnt/workspace/huihuiz/llvm-comm-git-2/llvm-project/llvm/lib/Object/MachOObjectFile.cpp:2731:7: warning: suggest braces around initialization of subobject [-Wmissing-braces]
      "i386",   "x86_64", "x86_64h",  "armv4t",  "arm",    "armv5e",
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      {
1 warning generated.

/local/mnt/workspace/huihuiz/llvm-comm-git-2/llvm-project/llvm/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp:355:46: warning: suggest braces around initialization of subobject [-Wmissing-braces]
    return addMappingFromTable<1>(MI, MRI, { 0 }, Table);
                                             ^
                                             {}
1 warning generated.

/local/mnt/workspace/huihuiz/llvm-comm-git-2/llvm-project/llvm/tools/llvm-objcopy/ELF/Object.cpp:400:57: warning: suggest braces around initialization of subobject [-Wmissing-braces]
static constexpr std::array<uint8_t, 4> ZlibGnuMagic = {'Z', 'L', 'I', 'B'};
                                                        ^~~~~~~~~~~~~~~~~~
                                                        {                 }
1 warning generated.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372811 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-25 04:40:07 +00:00
Fangrui Song
9658d5bf0c [llvm-objcopy][test] Clean up -B tests
-B is ignored for GNU objcopy compatibility after D67215/r371914.

* Delete mentions of -B from input-output-target.test - we have enough -B tests.
* Merge binary-input-with-arch.test into binary-output-target.test.

Reviewed By: rupprecht

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372809 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-25 03:41:01 +00:00
Chen Zheng
d26829fc59 [Powerpc][LoopPreIncPrep] NFC - refactor this pass for ds/dq form.
Differential Revision: https://reviews.llvm.org/D67431


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372803 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-25 03:02:19 +00:00
DeForest Richards
3ab1cbcab3 [Docs] Moves Reference docs to new page
Moves Reference docs to new page. Also adds a table of contents to Getting Involved page.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372796 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-25 00:49:02 +00:00
Thomas Lively
3824944743 [WebAssembly][NFC] Remove duplicate SIMD instructions and predicates
Summary:
Instead of having different v128.load and v128.store instructions for
each MVT, just have one of each that is reused in all the
patterns. Also removes the HasSIMD128 predicate where accompanied by
HasUnimplementedSIMD128, since the latter implies the former.

Reviewers: aheejin, dschuff

Subscribers: sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372792 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-25 00:15:59 +00:00
Justin Bogner
f1fe725679 Use double quotes for LDFLAGS in -DLLVM_BUILD_INSTRUMENTED_COVERAGE
Mimics the changes in r372209 to handle the change of quotes in
r372226. Probably isn't sufficient for windows, but unbreaks the cmake
flag at least.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372791 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-24 23:56:22 +00:00
Artur Pilipenko
a057b8e901 [SCEV] Disable canonical expansion for non-affine addrecs.
Reviewed By: apilipenko

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

Patch by Evgeniy Brevnov (ybrevnov@azul.com)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372789 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-24 23:21:07 +00:00
Yonghong Song
2bc1224a89 [BPF] Generate array dimension size properly for zero-size elements
Currently, if an array element type size is 0, the number of
array elements will be set to 0, regardless of what user
specified. This implementation is done in the beginning where
BTF is mostly used to calculate the member offset.

For example,
  struct s {};
  struct s1 {
        int b;
        struct s a[2];
  };
  struct s1 s1;
The BTF will have struct "s1" member "a" with element count 0.

Now BTF types are used for compile-once and run-everywhere
relocations and we need more precise type representation
for type comparison. Andrii reported the issue as there
are differences between original structure and BTF-generated
structure.

This patch made the change to correctly assign "2"
as the number elements of member "a".
Some dead codes related to ElemSize compuation are also removed.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372785 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-24 22:38:43 +00:00
Puyan Lotfi
4ead439585 Adding support for overriding LLVM_ENABLE_RUNTIMES for runtimes builds.
Second attempt: Now with ';' -> '|' replacement.

On some platforms, certain runtimes are not supported. For runtimes builds of
those platforms it would be nice if we could disable certain runtimes (ie
libunwind on Windows).

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372784 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-24 22:38:18 +00:00
Hiroshi Yamauchi
15271f49d5 [PGO][PGSO] ProfileSummary changes.
(Split of off D67120)

ProfileSummary changes for profile guided size optimization.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372783 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-24 22:17:51 +00:00
Sean Fertile
5fb96a5721 Extends the expansion of the LWZtoc pseduo op for AIX.
Differential Revision: https://reviews.llvm.org/D67853

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372772 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-24 18:04:51 +00:00
Philip Reames
6a17fac205 [GCRelocate] Add a peephole to canonicalize base pointer relocation
If we generate the gc.relocate, and then later prove two arguments to the statepoint are equivalent, we should canonicalize the gc.relocate to the form we would have produced if this had been known before rewriting.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372771 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-24 17:24:16 +00:00
Simon Pilgrim
4d75a8c141 [X86] Add MMX MOVD/MOVQ stores to folding tables to support stack folding
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372770 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-24 16:15:32 +00:00
Roman Lebedev
5e050e91e1 [InstCombine] (a+b) < a && (a+b) != 0 -> (0-b) < a iff a/b != 0 (PR43259)
Summary:
This is again motivated by D67122 sanitizer check enhancement.
That patch seemingly worsens `-fsanitize=pointer-overflow`
overhead from 25% to 50%, which strongly implies missing folds.

For
```
#include <cassert>
char* test(char& base, signed long offset) {
  __builtin_assume(offset < 0);
  return &base + offset;
}
```
We produce

https://godbolt.org/z/r40U47

and again those two icmp's can be merged:
```
Name: 0
Pre: C != 0
  %adjusted = add i8 %base, C
  %not_null = icmp ne i8 %adjusted, 0
  %no_underflow = icmp ult i8 %adjusted, %base
  %r = and i1 %not_null, %no_underflow
=>
  %neg_offset = sub i8 0, C
  %r = icmp ugt i8 %base, %neg_offset
```
https://rise4fun.com/Alive/ALap
https://rise4fun.com/Alive/slnN

There are 3 other variants of this pattern,
i believe they all will go into InstSimplify.

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

Reviewers: spatel, xbolva00, nikic

Reviewed By: spatel

Subscribers: efriedma, hiraditya, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372768 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-24 16:10:50 +00:00
Roman Lebedev
d745132b7b [InstCombine] (a+b) <= a && (a+b) != 0 -> (0-b) < a (PR43259)
Summary:
This is again motivated by D67122 sanitizer check enhancement.
That patch seemingly worsens `-fsanitize=pointer-overflow`
overhead from 25% to 50%, which strongly implies missing folds.

This pattern isn't exactly what we get there
(strict vs. non-strict predicate), but this pattern does not
require known-bits analysis, so it is best to handle it first.

```
Name: 0
  %adjusted = add i8 %base, %offset
  %not_null = icmp ne i8 %adjusted, 0
  %no_underflow = icmp ule i8 %adjusted, %base
  %r = and i1 %not_null, %no_underflow
=>
  %neg_offset = sub i8 0, %offset
  %r = icmp ugt i8 %base, %neg_offset
```
https://rise4fun.com/Alive/knp

There are 3 other variants of this pattern,
they all will go into InstSimplify:
https://rise4fun.com/Alive/bIDZ

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

Reviewers: spatel, xbolva00, nikic

Reviewed By: spatel

Subscribers: hiraditya, majnemer, vsk, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372767 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-24 16:10:38 +00:00
Simon Pilgrim
e065894694 [X86] Add tests showing failure to stack fold MMX MOVD/MOVQ stores
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372766 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-24 15:40:09 +00:00