]> granicus.if.org Git - llvm/log
llvm
5 years ago[Attributor] Deduce "dereferenceable" attribute
Hideto Ueno [Tue, 23 Jul 2019 08:16:17 +0000 (08:16 +0000)]
[Attributor] Deduce "dereferenceable" attribute

Summary:
Deduce dereferenceable attribute in Attributor.

These will be added in a later patch.
* dereferenceable(_or_null)_globally (D61652)
* Deduction based on load instruction (similar to D64258)

Reviewers: jdoerfert, sstefan1

Reviewed By: jdoerfert

Subscribers: hiraditya, jfb, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366788 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm-objcopy] Allow strip symtab in executables and DSOs
Eugene Leviant [Tue, 23 Jul 2019 08:03:30 +0000 (08:03 +0000)]
[llvm-objcopy] Allow strip symtab in executables and DSOs

Re-commit of the patch after addressing -Wl,--emit-relocs case.
Differential revision: https://reviews.llvm.org/D61672

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366787 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFix gold-plugin Windows build
Yi Kong [Tue, 23 Jul 2019 07:41:17 +0000 (07:41 +0000)]
Fix gold-plugin Windows build

r365588 missed one instance of integer file descriptor use in
gold-plugin.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366786 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[yaml2elf] - Treat the SHN_UNDEF section as kind of regular section.
George Rimar [Tue, 23 Jul 2019 07:38:44 +0000 (07:38 +0000)]
[yaml2elf] - Treat the SHN_UNDEF section as kind of regular section.

We have a logic that adds a few sections implicitly.
Though the SHT_NULL section with section number 0
is an exception.

In D64913 I want to teach yaml2obj to redefine the null section.
And in this patch I add it to the sections list,
to make it kind of a regular section.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366785 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AMDGPU][NFC] Simplify test file for amdgcn intrinsics
Hideto Ueno [Tue, 23 Jul 2019 06:48:47 +0000 (06:48 +0000)]
[AMDGPU][NFC] Simplify test file for amdgcn intrinsics

Summary: Remove unchecked attribute in the call site and use FileCheck String Substitution for `convergent` check.

Reviewers: nhaehnle

Reviewed By: nhaehnle

Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366781 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[DAGCombiner] Make ShrinkLoadReplaceStoreWithStore return an SDValue instead of an...
Craig Topper [Tue, 23 Jul 2019 05:13:39 +0000 (05:13 +0000)]
[DAGCombiner] Make ShrinkLoadReplaceStoreWithStore return an SDValue instead of an SDNode*. NFCI

The function was calling getNode() on an SDValue to return and the
caller turned the result back into a SDValue. So just return the
original SDValue to avoid this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366779 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[DAGCombiner] Use SDNode::isOperandOf to simplify some code. NFCI
Craig Topper [Tue, 23 Jul 2019 05:13:35 +0000 (05:13 +0000)]
[DAGCombiner] Use SDNode::isOperandOf to simplify some code. NFCI

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366778 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[LLVM-C] Improve Bindings to The Internalize Pass
Robert Widmann [Tue, 23 Jul 2019 04:56:44 +0000 (04:56 +0000)]
[LLVM-C] Improve Bindings to The Internalize Pass

Summary: Adds a binding to the internalize pass that allows the caller to pass a function pointer that acts as the visibility-preservation predicate.  Previously, one could only pass an unsigned value (not LLVMBool?) that directed the pass to consider "main" or not.

Reviewers: whitequark, deadalnix, harlanhaskins

Reviewed By: whitequark, harlanhaskins

Subscribers: kren1, hiraditya, llvm-commits, harlanhaskins

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366777 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[PowerPC] Replace float load/store pair with integer load/store pair when it's only...
Zi Xuan Wu [Tue, 23 Jul 2019 03:34:40 +0000 (03:34 +0000)]
[PowerPC] Replace float load/store pair with integer load/store pair when it's only used in load/store

Replace float load/store pair with integer load/store pair when it's only used in load/store,
because float load/store instructions cost more cycles then integer load/store.

A typical scenario is when there is a call with more than 13 float arguments passing, we need pass them by stack.
So we need a load/store pair to do such memory operation if the variable is global variable.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366775 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoInline function call into assert to fix unused variable warning.
Richard Trieu [Tue, 23 Jul 2019 03:10:06 +0000 (03:10 +0000)]
Inline function call into assert to fix unused variable warning.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366774 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoMove variable out from debug only section.
Richard Trieu [Tue, 23 Jul 2019 02:59:15 +0000 (02:59 +0000)]
Move variable out from debug only section.

MFI is no longer just needed for an assert.  Move it out of the debug only
section to allow non-assert builds to be able to find it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366773 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm-lipo] Implement -info
Shoaib Meenai [Tue, 23 Jul 2019 00:42:03 +0000 (00:42 +0000)]
[llvm-lipo] Implement -info

Prints architecture type of all input files.

Patch by Anusha Basana <anusha.basana@gmail.com>

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366772 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFixing build error from commit 95cbc3d
Stefan Stipanovic [Mon, 22 Jul 2019 23:58:23 +0000 (23:58 +0000)]
Fixing build error from commit 95cbc3d

[Attributor] Liveness analysis.

Liveness analysis abstract attribute used to indicate which BasicBlocks are dead and can therefore be ignored.
Right now we are only looking at noreturn calls.

Reviewers: jdoerfert, uenoku

Subscribers: hiraditya, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366769 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Statepoints] Fix a bug in statepoint lowering for functions w/no-realign-stack
Philip Reames [Mon, 22 Jul 2019 23:33:18 +0000 (23:33 +0000)]
[Statepoints] Fix a bug in statepoint lowering for functions w/no-realign-stack

We were silently using the ABI alignment for all of the stores generated for deopt and gc values.  We'd gotten the alignment of the stack slot itself properly reduced (via MachineFrameInfo's clamping), but having the MMO on the store incorrect was enough for us to generate an aligned store to a unaligned location.

The simplest fix would have been to just pass the alignment to the helper function, but once we do that, the helper function doesn't really help.  So, inline it and directly call the MMO version of DAG.getStore with a properly constructed MMO.

Note that there's a separate performance possibility here.  Even if we *can* realign stacks, we probably don't *want to* if all of the stores are in slowpaths.  But that's a later patch, if at all.  :)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366765 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFix pointer width in test from r366754.
Peter Collingbourne [Mon, 22 Jul 2019 23:32:41 +0000 (23:32 +0000)]
Fix pointer width in test from r366754.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366764 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agogn build: Wrap two comments to 80 columns
Nico Weber [Mon, 22 Jul 2019 23:23:38 +0000 (23:23 +0000)]
gn build: Wrap two comments to 80 columns

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366763 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[DWARF] Add more error handling to debug line parser.
Jonas Devlieghere [Mon, 22 Jul 2019 23:23:34 +0000 (23:23 +0000)]
[DWARF] Add more error handling to debug line parser.

This patch exnteds the error handling in the debug line parser to get
rid of the existing MD5 assertion. I want to reuse the debug line parser
from LLVM in LLDB where we cannot crash on invalid input.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366762 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Statepoints] Add a test which shows a miscompile with no-realign-stacks
Philip Reames [Mon, 22 Jul 2019 23:08:56 +0000 (23:08 +0000)]
[Statepoints] Add a test which shows a miscompile with no-realign-stacks

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366760 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert "Fixing build error from commit 9285295."
Stefan Stipanovic [Mon, 22 Jul 2019 22:55:05 +0000 (22:55 +0000)]
Revert "Fixing build error from commit 9285295."

This reverts commit 95cbc3da8871f43c1ce2b2926afaedcd826202b1.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366759 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agollvm-objcopy/test: add REQUIRES: shell for use of umask
David Blaikie [Mon, 22 Jul 2019 22:23:52 +0000 (22:23 +0000)]
llvm-objcopy/test: add REQUIRES: shell for use of umask

(follow-up to r365162)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366755 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAnalysis: Don't look through aliases when simplifying GEPs.
Peter Collingbourne [Mon, 22 Jul 2019 22:13:46 +0000 (22:13 +0000)]
Analysis: Don't look through aliases when simplifying GEPs.

It is not safe in general to replace an alias in a GEP with its aliasee
if the alias can be replaced with another definition (i.e. via strong/weak
resolution (linkonce_odr) or via symbol interposition (default visibility
in ELF)) while the aliasee cannot. An example of how this can go wrong is
in the included test case.

I was concerned that this might be a load-bearing misoptimization (it's
possible for us to use aliases to share vtables between base and derived
classes, and on Windows, vtable symbols will always be aliases in RTTI
mode, so this change could theoretically inhibit trivial devirtualization
in some cases), so I built Chromium for Linux and Windows with and without
this change. The file sizes of the resulting binaries were identical, so it
doesn't look like this is going to be a problem.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366754 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFixing build error from commit 9285295.
Stefan Stipanovic [Mon, 22 Jul 2019 22:10:59 +0000 (22:10 +0000)]
Fixing build error from commit 9285295.

[Attributor] Liveness analysis.

Liveness analysis abstract attribute used to indicate which BasicBlocks are dead and can therefore be ignored.
Right now we are only looking at noreturn calls.

Reviewers: jdoerfert, uenoku

Subscribers: hiraditya, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366753 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[NFC][PatternMatch] Refactor code into a proper "matcher for any integral constant"
Roman Lebedev [Mon, 22 Jul 2019 22:09:24 +0000 (22:09 +0000)]
[NFC][PatternMatch] Refactor code into a proper "matcher for any integral constant"

Having it as a proper matcher is better for reusability elsewhere
(in a follow-up patch.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366752 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InstSimplify][NFC] Tests for skipping 'div-by-0' checks before @llvm.umul.with.overflow
Roman Lebedev [Mon, 22 Jul 2019 22:09:11 +0000 (22:09 +0000)]
[InstSimplify][NFC] Tests for skipping 'div-by-0' checks before @llvm.umul.with.overflow

These may remain after @llvm.umul.with.overflow was canonicalized
from the code that was originally doing the check via division.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366751 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[SimplifyCFG][NFC] Test that we fail to flatten CFG in JPEG "sign" value extend pattern
Roman Lebedev [Mon, 22 Jul 2019 22:09:02 +0000 (22:09 +0000)]
[SimplifyCFG][NFC] Test that we fail to flatten CFG in JPEG "sign" value extend pattern

This comes up in JPEG decoding, see e.g.
Figure F.12 – Extending the sign bit of a decoded value in V
of ITU T.81 (JPEG specification).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366750 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[SimplifyCFG][NFC] Test that we fail to flatten CFG after forming @llvm.umul.with...
Roman Lebedev [Mon, 22 Jul 2019 22:08:55 +0000 (22:08 +0000)]
[SimplifyCFG][NFC] Test that we fail to flatten CFG after forming @llvm.umul.with.overflow

Even if we formed @llvm.umul.with.overflow, we are still stuck
with that guard against div-by-zero, which is no longer needed,
because we didn't flatten the CFG.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366749 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InstCombine][NFC] Tests for canonicalization of unsigned multiply overflow check
Roman Lebedev [Mon, 22 Jul 2019 22:08:45 +0000 (22:08 +0000)]
[InstCombine][NFC] Tests for canonicalization of unsigned multiply overflow check

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366748 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[NFC][PhaseOrdering] Add tests showcasing the problems of unsigned multiply overflow...
Roman Lebedev [Mon, 22 Jul 2019 22:08:35 +0000 (22:08 +0000)]
[NFC][PhaseOrdering] Add tests showcasing the problems of unsigned multiply overflow check

While we can form the @llvm.mul.with.overflow easily,
we are still left with that check that was guarding against div-by-0.
And in the second case we won't even flatten the CFG.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366747 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[IndVarSimplify][NFC] Autogenerate check lines in loop_evaluate_1.ll
Roman Lebedev [Mon, 22 Jul 2019 22:08:27 +0000 (22:08 +0000)]
[IndVarSimplify][NFC] Autogenerate check lines in loop_evaluate_1.ll

Being affected by upcoming patch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366746 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU: Don't use SDNodeXForm for DS offset output
Matt Arsenault [Mon, 22 Jul 2019 21:38:11 +0000 (21:38 +0000)]
AMDGPU: Don't use SDNodeXForm for DS offset output

The xform has no real valuewhen it's using out of a complex pattern
output. The complex pattern was already creating TargetConstants with
i16, so this was just unnecessary machinery.

This allows global isel to import the simple cases once the complex
pattern is implemented.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366743 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoTemporarily Revert "[Attributor] Liveness analysis." as it's breaking the build.
Eric Christopher [Mon, 22 Jul 2019 21:04:23 +0000 (21:04 +0000)]
Temporarily Revert "[Attributor] Liveness analysis." as it's breaking the build.

This reverts commit 9285295f75a231dc446fa7cbc10a0a391b3434a5.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366737 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Attributor] Liveness analysis.
Stefan Stipanovic [Mon, 22 Jul 2019 20:54:30 +0000 (20:54 +0000)]
[Attributor] Liveness analysis.

Liveness analysis abstract attribute used to indicate which BasicBlocks are dead and can therefore be ignored.
Right now we are only looking at noreturn calls.

Reviewers: jdoerfert, uenoku

Subscribers: hiraditya, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366736 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] When using AND+PACKUS in lowerV16I8Shuffle, generate the build vector directly...
Craig Topper [Mon, 22 Jul 2019 19:58:49 +0000 (19:58 +0000)]
[X86] When using AND+PACKUS in lowerV16I8Shuffle, generate the build vector directly in v16i8 with the correct 0x00 or 0xFF elements rather than using another VT and bitcasting it.

The build_vector will become a constant pool load. By using the
desired type initially, it ensures we don't generate a bitcast
of the constant pool load which will need to be folded with
the load.

While experimenting with another patch, I noticed that when the
load type and the constant pool type don't match, then
SimplifyDemandedBits can't handle it. While we should probably
fix that, this was a simple way to fix the issue I saw.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366732 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[NFC][PowerPC]Change ADDIStocHA to ADDIStocHA8 to follow 64-bit naming convention
Jason Liu [Mon, 22 Jul 2019 19:55:33 +0000 (19:55 +0000)]
[NFC][PowerPC]Change ADDIStocHA to ADDIStocHA8 to follow 64-bit naming convention

Summary:

Since we are planning to add ADDIStocHA for 32bit in later patch, we decided
 to change 64bit one first to follow naming convention with 8 behind opcode.

Patch by: Xiangling_L

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366731 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Attributor] NoAlias on return values.
Stefan Stipanovic [Mon, 22 Jul 2019 19:36:27 +0000 (19:36 +0000)]
[Attributor] NoAlias on return values.

Porting function return value attribute noalias to attributor.
This will be followed with a patch for callsite and function argumets.

Reviewers: jdoerfert

Subscribers: lebedev.ri, hiraditya, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366728 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoStubs out TLOF for AIX and add support for common vars in assembly output.
Sean Fertile [Mon, 22 Jul 2019 19:15:29 +0000 (19:15 +0000)]
Stubs out TLOF for AIX and add support for common vars in assembly output.

Stubs out a TargetLoweringObjectFileXCOFF class, implementing only
SelectSectionForGlobal for common symbols. Also adds an override of
EmitGlobalVariable in PPCAIXAsmPrinter which adds a number of defensive errors
and adds support for emitting common globals.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366727 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[SafeStack] Insert the deref after the offset
Petr Hosek [Mon, 22 Jul 2019 18:52:42 +0000 (18:52 +0000)]
[SafeStack] Insert the deref after the offset

While debugging code that uses SafeStack, we've noticed that LLVM
produces an invalid DWARF. Concretely, in the following example:

  int main(int argc, char* argv[]) {
    std::string value = "";
    printf("%s\n", value.c_str());
    return 0;
  }

DWARF would describe the value variable as being located at:

  DW_OP_breg14 R14+0, DW_OP_deref, DW_OP_constu 0x20, DW_OP_minus

The assembly to get this variable is:

  leaq    -32(%r14), %rbx

The order of operations in the DWARF symbols is incorrect in this case.
Specifically, the deref is incorrect; this appears to be incorrectly
re-inserted in repalceOneDbgValueForAlloca.

With this change which inserts the deref after the offset instead of
before it, LLVM produces correct DWARF:

  DW_OP_breg14 R14-32

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366726 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoWholeProgramDevirt: Teach the pass to respect the global's alignment.
Peter Collingbourne [Mon, 22 Jul 2019 18:50:45 +0000 (18:50 +0000)]
WholeProgramDevirt: Teach the pass to respect the global's alignment.

The bytes inserted before an overaligned global need to be padded according
to the alignment set on the original global in order for the initializer
to meet the global's alignment requirements. The previous implementation
that padded to the pointer width happened to be correct for vtables on most
platforms but may do the wrong thing if the vtable has a larger alignment.

This issue is visible with a prototype implementation of HWASAN for globals,
which will overalign all globals including vtables to 16 bytes.

There is also no padding requirement for the bytes inserted after the global
because they are never read from nor are they significant for alignment
purposes, so stop inserting padding there.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366725 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[PowerPC] Fix comment on MO_PLT Target Operand Flag. [NFC]
Sean Fertile [Mon, 22 Jul 2019 18:47:59 +0000 (18:47 +0000)]
[PowerPC] Fix comment on MO_PLT Target Operand Flag. [NFC]

Patch by Xiangling Liao.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366724 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Object][XCOFF] Remove extra includes from XCOFF related files. [NFC]
Sean Fertile [Mon, 22 Jul 2019 18:47:55 +0000 (18:47 +0000)]
[Object][XCOFF] Remove extra includes from XCOFF related files. [NFC]

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366723 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoLowerTypeTests: Teach the pass to respect global alignments.
Peter Collingbourne [Mon, 22 Jul 2019 18:47:03 +0000 (18:47 +0000)]
LowerTypeTests: Teach the pass to respect global alignments.

We were previously ignoring alignment entirely when combining globals
together in this pass. There are two main things that we need to do here:
add additional padding before each global to meet the alignment requirements,
and set the combined global's alignment to the maximum of all of the original
globals' alignments.

Since we now need to calculate layout as we go anyway, use the calculated
layout to produce GlobalLayout instead of using StructLayout.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366722 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoChanges to emit CodeView debug info nested type records properly using MCStreamer...
Nilanjana Basu [Mon, 22 Jul 2019 18:22:55 +0000 (18:22 +0000)]
Changes to emit CodeView debug info nested type records properly using MCStreamer directives

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366720 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AMDGPU] Test update. NFC.
Stanislav Mekhanoshin [Mon, 22 Jul 2019 18:08:53 +0000 (18:08 +0000)]
[AMDGPU] Test update. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366715 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[SLPVectorizer] Fix some MSVC/cppcheck uninitialized variable warnings. NFCI.
Simon Pilgrim [Mon, 22 Jul 2019 17:57:36 +0000 (17:57 +0000)]
[SLPVectorizer] Fix some MSVC/cppcheck uninitialized variable warnings. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366712 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert "Reland [ELF] Loose a condition for relocation with a symbol"
Vlad Tsyrklevich [Mon, 22 Jul 2019 17:48:53 +0000 (17:48 +0000)]
Revert "Reland [ELF] Loose a condition for relocation with a symbol"

This reverts commit r366686 as it appears to be causing buildbot
failures on sanitizer-x86_64-linux-android and sanitizer-x86_64-linux.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366708 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoTableGen: Support physical register inputs > 255
Matt Arsenault [Mon, 22 Jul 2019 15:02:34 +0000 (15:02 +0000)]
TableGen: Support physical register inputs > 255

This was truncating register value that didn't fit in unsigned char.
Switch AMDGPU sendmsg intrinsics to using a tablegen pattern.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366695 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ARM][LowOverheadLoops] Revert remaining pseudos
Sam Parker [Mon, 22 Jul 2019 14:16:40 +0000 (14:16 +0000)]
[ARM][LowOverheadLoops] Revert remaining pseudos

ARMLowOverheadLoops would assert a failure if it did not find all the
pseudo instructions that comprise the hardware loop. Instead of doing
this, iterate through all the instructions of the function and revert
any remaining pseudo instructions that haven't been converted.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366691 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU/GlobalISel: Fix broken tests
Matt Arsenault [Mon, 22 Jul 2019 13:33:11 +0000 (13:33 +0000)]
AMDGPU/GlobalISel: Fix broken tests

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366688 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoReland [ELF] Loose a condition for relocation with a symbol
Nikola Prica [Mon, 22 Jul 2019 13:07:01 +0000 (13:07 +0000)]
Reland [ELF] Loose a condition for relocation with a symbol

This patch was not the reason of the buildbot failure.

Deleted code was introduced as a work around for a bug in the gold linker
(http://sourceware.org/PR16794). Test case that was given as a reason for
this part of code, the one on previous link, now works for the gold.
This condition is too strict and when a code is compiled with debug info
it forces generation of numerous relocations with symbol for architectures
that do not have relocation addend.

Reviewers: arsenm, espindola

Reviewed By: MaskRay

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366686 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU/GlobalISel: Remove unnecessary code
Matt Arsenault [Mon, 22 Jul 2019 13:05:25 +0000 (13:05 +0000)]
AMDGPU/GlobalISel: Remove unnecessary code

The minnum/maxnum case are dead, and the cvt is handled by the
default.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366685 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ARM] Fix for MVE VPT block pass
David Green [Mon, 22 Jul 2019 12:51:38 +0000 (12:51 +0000)]
[ARM] Fix for MVE VPT block pass

We need to ensure that the number of T's is correct when adding multiple
instructions into the same VPT block.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366684 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] EltsFromConsecutiveLoads - support common source loads (REAPPLIED)
Simon Pilgrim [Mon, 22 Jul 2019 12:44:10 +0000 (12:44 +0000)]
[X86] EltsFromConsecutiveLoads - support common source loads (REAPPLIED)

This patch enables us to find the source loads for each element, splitting them into a Load and ByteOffset, and attempts to recognise consecutive loads that are in fact from the same source load.

A helper function, findEltLoadSrc, recurses to find a LoadSDNode and determines the element's byte offset within it. When attempting to match consecutive loads, byte offsetted loads then attempt to matched against a previous load that has already been confirmed to be a consecutive match.

Next step towards PR16739 - after this we just need to account for shuffling/repeated elements to create a vector load + shuffle.

Fixed out of bounds load assert identified in rL366501

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366681 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU/GlobalISel: Fix tests without asserts
Matt Arsenault [Mon, 22 Jul 2019 12:43:41 +0000 (12:43 +0000)]
AMDGPU/GlobalISel: Fix tests without asserts

The legality check is only done under NDEBUG, so the failure cases are
different in a release build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366680 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAdded address-space mangling for stack related intrinsics
Christudasan Devadasan [Mon, 22 Jul 2019 12:42:48 +0000 (12:42 +0000)]
Added address-space mangling for stack related intrinsics

Modified the following 3 intrinsics:
int_addressofreturnaddress,
int_frameaddress & int_sponentry.

Reviewed By: arsenm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366679 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86][SSE] Add EltsFromConsecutiveLoads test case identified in rL366501
Simon Pilgrim [Mon, 22 Jul 2019 12:17:56 +0000 (12:17 +0000)]
[X86][SSE] Add EltsFromConsecutiveLoads test case identified in rL366501

Test case that led to rL366441 being reverted at rL366501

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366678 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[yaml2obj] - Change how we handle implicit sections.
George Rimar [Mon, 22 Jul 2019 12:01:52 +0000 (12:01 +0000)]
[yaml2obj] - Change how we handle implicit sections.

Instead of having the special list of implicit sections,
that are mixed with the sections read from YAML on late
stages, I just create the placeholders and add them to
the main sections list early.

That allows to significantly simplify the code.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366677 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAdd location of SVN staging dir to git-llvm error output
Stefan Granitz [Mon, 22 Jul 2019 09:47:40 +0000 (09:47 +0000)]
Add location of SVN staging dir to git-llvm error output

Summary:
In pre-monorepo times the svn staging directory was `.git/svn`. The below error message wasn't mentioning the new name yet.

Example before:
```
Can't push git rev 104cfa289d9 because svn status is not empty:
!     llvm/trunk/include/llvm
```

Example after:
```
Can't push git rev 104cfa289d9 because status in svn staging dir (.git/llvm-upstream-svn) is not empty:
!     llvm/trunk/include/llvm
```

Reviewers: mehdi_amini, jlebar, teemperor

Reviewed By: mehdi_amini

Subscribers: llvm-commits, #llvm

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366671 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[IPRA][ARM] Make use of the "returned" parameter attribute
Oliver Stannard [Mon, 22 Jul 2019 08:44:36 +0000 (08:44 +0000)]
[IPRA][ARM] Make use of the "returned" parameter attribute

ARM has code to recognise uses of the "returned" function parameter
attribute which guarantee that the value passed to the function in r0
will be returned in r0 unmodified. IPRA replaces the regmask on call
instructions, so needs to be told about this to avoid reverting the
optimisation.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366669 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm-readobj] - Stop using precompiled objects in file-headers.test
George Rimar [Mon, 22 Jul 2019 08:10:02 +0000 (08:10 +0000)]
[llvm-readobj] - Stop using precompiled objects in file-headers.test

This converts all sub-tests except one to YAML instead of precompiled inputs.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366668 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AMDGPU] Save some work when an atomic op has no uses
Jay Foad [Mon, 22 Jul 2019 07:19:44 +0000 (07:19 +0000)]
[AMDGPU] Save some work when an atomic op has no uses

Summary:
In the atomic optimizer, save doing a bunch of work and generating a
bunch of dead IR in the fairly common case where the result of an
atomic op (i.e. the value that was in memory before the atomic op was
performed) is not used. NFC.

Reviewers: arsenm, dstuttard, tpr

Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, t-tye, hiraditya, jfb, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366667 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[PowerPC][NFC] Precommit a test case where ppc-mi-peepholes miscompiles extswsli
Kai Luo [Mon, 22 Jul 2019 05:32:20 +0000 (05:32 +0000)]
[PowerPC][NFC] Precommit a test case where ppc-mi-peepholes miscompiles extswsli

Added a test case to show codegen differences.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366666 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Loop Peeling] Fix the handling of branch weights of peeled off branches.
Serguei Katkov [Mon, 22 Jul 2019 05:15:34 +0000 (05:15 +0000)]
[Loop Peeling] Fix the handling of branch weights of peeled off branches.

Current algorithm to update branch weights of latch block and its copies is
based on the assumption that number of peeling iterations is approximately equal
to trip count.

However it is not correct. According to profitability check in one case we can decide to peel
in case it helps to reduce the number of phi nodes. In this case the number of peeled iteration
can be less then estimated trip count.

This patch introduces another way to set the branch weights to peeled of branches.
Let F is a weight of the edge from latch to header.
Let E is a weight of the edge from latch to exit.
F/(F+E) is a probability to go to loop and E/(F+E) is a probability to go to exit.
Then, Estimated TripCount = F / E.
For I-th (counting from 0) peeled off iteration we set the the weights for
the peeled latch as (TC - I, 1). It gives us reasonable distribution,
The probability to go to exit 1/(TC-I) increases. At the same time
the estimated trip count of remaining loop reduces by I.

As a result after peeling off N iteration the weights will be
(F - N * E, E) and trip count of loop becomes
F / E - N or TC - N.

The idea is taken from the review of the patch D63918 proposed by Philip.

Reviewers: reames, mkuper, iajbar, fhahn
Reviewed By: reames
Subscribers: hiraditya, zzheng, llvm-commits
Differential Revision: https://reviews.llvm.org/D64235

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366665 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[utils] Clean up UpdateTestChecks/common.py
Fangrui Song [Mon, 22 Jul 2019 04:59:01 +0000 (04:59 +0000)]
[utils] Clean up UpdateTestChecks/common.py

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366664 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InstCombine] Add foldAndOfICmps test cases inspired by PR42691.
Craig Topper [Mon, 22 Jul 2019 02:43:43 +0000 (02:43 +0000)]
[InstCombine] Add foldAndOfICmps test cases inspired by PR42691.

icmp ne %x, INT_MIN can be treated similarly to icmp sgt %x, INT_MIN.
icmp ne %x, INT_MAX can be treated similarly to icmp slt %x, INT_MAX.
icmp ne %x, UINT_MAX can be treated similarly to icmp ult %x, UINT_MAX.

We already treat icmp ne %x, 0 similarly to icmp ugt %x, 0

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366662 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[PowerPC][NFC] Precomit test case for upcoming patch
Nemanja Ivanovic [Sun, 21 Jul 2019 21:03:45 +0000 (21:03 +0000)]
[PowerPC][NFC] Precomit test case for upcoming patch

Just committing a test case for an upcoming patch so that the review can show
only the codegen differences.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366661 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] SimplifyDemandedVectorEltsForTargetNode - Move SUBV_BROADCAST narrowing handlin...
Simon Pilgrim [Sun, 21 Jul 2019 19:04:44 +0000 (19:04 +0000)]
[X86] SimplifyDemandedVectorEltsForTargetNode - Move SUBV_BROADCAST narrowing handling. NFCI.

Move the narrowing of SUBV_BROADCAST to where we handle all the other opcodes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366660 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[PowerPC][NFC] Regenerate test using script
Nemanja Ivanovic [Sun, 21 Jul 2019 18:42:29 +0000 (18:42 +0000)]
[PowerPC][NFC] Regenerate test using script

This test case ended up as a hybrid of generated checks and manually inserted
checks. Regenerate using script to make it consistent.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366659 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InstCombine] Update comment I missed in r366649. NFC
Craig Topper [Sun, 21 Jul 2019 16:15:03 +0000 (16:15 +0000)]
[InstCombine] Update comment I missed in r366649. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366658 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[SmallBitVector] Fix bug in find_next_unset for small types with indices >=32
Simon Pilgrim [Sun, 21 Jul 2019 16:06:26 +0000 (16:06 +0000)]
[SmallBitVector] Fix bug in find_next_unset for small types with indices >=32

We were creating a bitmask from a shift of unsigned instead of uintptr_t, meaning we couldn't create masks for indices above 31.

Noticed due to a MSVC analyzer warning.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366657 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[GISel]: Attach missing range metadata while translating G_LOADs
Aditya Nandakumar [Sun, 21 Jul 2019 14:07:54 +0000 (14:07 +0000)]
[GISel]: Attach missing range metadata while translating G_LOADs

https://reviews.llvm.org/D65048

Attach range information to G_LOAD when only defining one register.

reviewed by: arsenm

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366656 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ARM] Move MVE VPT block tests into the Thumb2 directory. NFC
David Green [Sun, 21 Jul 2019 13:09:19 +0000 (13:09 +0000)]
[ARM] Move MVE VPT block tests into the Thumb2 directory. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366655 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[NFC][InstCombine] Add a few extra srem-by-power-of-two tests - extra uses
Roman Lebedev [Sun, 21 Jul 2019 09:05:49 +0000 (09:05 +0000)]
[NFC][InstCombine] Add a few extra srem-by-power-of-two tests - extra uses

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366652 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InstCombine] Remove insertRangeTest code that handles the equality case.
Craig Topper [Sun, 21 Jul 2019 06:43:38 +0000 (06:43 +0000)]
[InstCombine] Remove insertRangeTest code that handles the equality case.

For equality, the function called getTrue/getFalse with the VT
of the comparison input. But getTrue/getFalse need the boolean VT.
So if this code ever executed, it would assert.

I believe these cases are removed by InstSimplify so we don't get here.

So this patch just fixes up an assert to exclude the equality
possibility and removes the broken code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366649 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InstCombine] Don't use AddOne/SubOne to see if two APInts are 1 apart. Use APInt...
Craig Topper [Sun, 21 Jul 2019 05:26:05 +0000 (05:26 +0000)]
[InstCombine] Don't use AddOne/SubOne to see if two APInts are 1 apart. Use APInt operations instead. NFCI

AddOne/SubOne create new Constant objects. That seems heavy for
comparing ConstantInts which wrap APInts. Just do the math on
on the APInts and compare them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366648 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agogn build: Merge r366622
Nico Weber [Sun, 21 Jul 2019 00:03:55 +0000 (00:03 +0000)]
gn build: Merge r366622

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366646 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[NFC][InstCombine] Autogenerate a few tests
Roman Lebedev [Sat, 20 Jul 2019 21:34:00 +0000 (21:34 +0000)]
[NFC][InstCombine] Autogenerate a few tests

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366643 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[NFC][InstCombine] Add srem-by-signbit tests - still can fold to bittest
Roman Lebedev [Sat, 20 Jul 2019 21:33:50 +0000 (21:33 +0000)]
[NFC][InstCombine] Add srem-by-signbit tests - still can fold to bittest

https://rise4fun.com/Alive/IIeS

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366642 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[NFC][Codegen][X86][AArch64] Add "(x s% C) == 0" tests
Roman Lebedev [Sat, 20 Jul 2019 19:25:44 +0000 (19:25 +0000)]
[NFC][Codegen][X86][AArch64] Add "(x s% C) == 0" tests

Much like with `urem`, the same optimization (albeit with slightly
different algorithm) applies for the signed case, too.

I'm simply copying the test coverage from `urem` case for now,
i believe it should be (close to?) sufficient.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366640 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Codegen][SelectionDAG] X u% C == 0 fold: non-splat vector improvements
Roman Lebedev [Sat, 20 Jul 2019 16:33:15 +0000 (16:33 +0000)]
[Codegen][SelectionDAG] X u% C == 0 fold: non-splat vector improvements

Summary:
Four things here:
1. Generalize the fold to handle non-splat divisors. Reasonably trivial.
2. Unban power-of-two divisors. I don't see any reason why they should
   be illegal.
   * There is no ban in Hacker's Delight
   * I think the ban came from the same bug that caused the miscompile
      in the base patch - in `floor((2^W - 1) / D)` we were dividing by
      `D0` instead of `D`, and we **were** ensuring that `D0` is not `1`,
      which made sense.
3. Unban `1` divisors. I no longer believe Hacker's Delight actually says
   that the fold is invalid for `D = 0`. Further considerations:
   * We know that
     * `(X u% 1) == 0`  can be constant-folded to `1`,
     * `(X u% 1) != 0`  can be constant-folded to `0`,
   *  Also, we know that
     * `X u<= -1` can be constant-folded to `1`,
     * `X u>  -1` can be constant-folded to `0`,
   * https://godbolt.org/z/7jnZJX https://rise4fun.com/Alive/oF6p
   * We know will end up with the following:
       `(setule/setugt (rotr (mul N, P), K), Q)`
   * Therefore, for given new DAG nodes and comparison predicates
     (`ule`/`ugt`), we will still produce the correct answer if:
     `Q` is a all-ones constant; and both `P` and `K` are *anything*
     other than `undef`.
   * The fold will indeed produce `Q = all-ones`.
4. Try to re-splat the `P` and `K` vectors - we don't care about
   their values for the lanes where divisor was `1`.

Reviewers: RKSimon, hermord, craig.topper, spatel, xbolva00

Reviewed By: RKSimon

Subscribers: hiraditya, javed.absar, dexonsmith, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366637 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86][SSE] Use PSADBW to improve vXi8 sum reduction (PR42674)
Simon Pilgrim [Sat, 20 Jul 2019 15:20:11 +0000 (15:20 +0000)]
[X86][SSE] Use PSADBW to improve vXi8 sum reduction (PR42674)

As detailed on PR42674, we can reduce a vXi8 down until we have the final <8 x i8>, and then use PSADBW with zero, to sum those values. We then extract the bottom i8, discarding any overflow from the upper bits of the i16 result.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366636 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Local] Zap blockaddress without users in ConstantFoldTerminator.
Florian Hahn [Sat, 20 Jul 2019 12:25:47 +0000 (12:25 +0000)]
[Local] Zap blockaddress without users in ConstantFoldTerminator.

If the blockaddress is not destoryed, the destination block will still
be marked as having its address taken, limiting further transformations.

I think there are other places where the dead blockaddress constants are kept
around, I'll look into that as follow up.

Reviewers: craig.topper, brzycki, davide

Reviewed By: brzycki, davide

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366633 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[GlobalISel][AArch64] Contract trivial same-size cross-bank copies into G_STOREs
Jessica Paquette [Sat, 20 Jul 2019 01:55:35 +0000 (01:55 +0000)]
[GlobalISel][AArch64] Contract trivial same-size cross-bank copies into G_STOREs

Sometimes, you can end up with cross-bank copies between same-sized GPRs and
FPRs, which feed into G_STOREs. When these copies feed only into stores, they
aren't necessary; we can just store using the original register bank.

This provides some minor code size savings for some floating point SPEC
benchmarks. (Around 0.2% for 453.povray and 450.soplex)

This issue doesn't seem to show up due to regbankselect or anything similar. So,
this patch introduces an early select function, `contractCrossBankCopyIntoStore`
which performs the contraction when possible. The selector then continues
normally and selects the correct store opcode, eliminating needless copies
along the way.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366625 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[WebAssembly] Compute and export TLS block alignment
Guanzhong Chen [Fri, 19 Jul 2019 23:34:16 +0000 (23:34 +0000)]
[WebAssembly] Compute and export TLS block alignment

Summary:
Add immutable WASM global `__tls_align` which stores the alignment
requirements of the TLS segment.

Add `__builtin_wasm_tls_align()` intrinsic to get this alignment in Clang.

The expected usage has now changed to:

    __wasm_init_tls(memalign(__builtin_wasm_tls_align(),
                             __builtin_wasm_tls_size()));

Reviewers: tlively, aheejin, sbc100, sunfish, alexcrichton

Reviewed By: tlively

Subscribers: dschuff, jgravelle-google, hiraditya, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366624 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRe-commit: r366610 and r366612: Expand pseudo-components before embedding in llvm...
Daniel Sanders [Fri, 19 Jul 2019 22:46:47 +0000 (22:46 +0000)]
Re-commit: r366610 and r366612: Expand pseudo-components before embedding in llvm-config

There were two main problems:
* The 'nativecodegen' pseudo-component was unconditionally adding
  ${native_tgt}CodeGen even though it conditionally added ${native_tgt}Info and
  ${native_tgt}Desc. This has been fixed by making ${native_tgt}CodeGen
  conditional too
* The 'all' pseudo-component was causing library names like LLVMLLVMDemangle as
  the expansion was to a library name and not a component. There doesn't seem to
  be a list of available components anywhere so this has been fixed by moving the
  expansion of 'all' back where it was before. This manifested in different ways
  on different builders but it was the same root cause

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366622 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU/GlobalISel: Legalize GEP for other 32-bit address spaces
Matt Arsenault [Fri, 19 Jul 2019 22:28:44 +0000 (22:28 +0000)]
AMDGPU/GlobalISel: Legalize GEP for other 32-bit address spaces

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366621 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AMDGPU] Autogenerate register sequences in tuples
Stanislav Mekhanoshin [Fri, 19 Jul 2019 21:43:42 +0000 (21:43 +0000)]
[AMDGPU] Autogenerate register sequences in tuples

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366619 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AMDGPU] Fixed occupancy calculation for gfx10
Stanislav Mekhanoshin [Fri, 19 Jul 2019 21:29:51 +0000 (21:29 +0000)]
[AMDGPU] Fixed occupancy calculation for gfx10

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366616 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert r366610 and r366612: Expand pseudo-components before embedding in llvm-config
Daniel Sanders [Fri, 19 Jul 2019 21:11:05 +0000 (21:11 +0000)]
Revert r366610 and r366612: Expand pseudo-components before embedding in llvm-config

Some targets are missing LLVMDemangle, one is adding the LLVM prefix twice, and two
are hitting the very error this patch fixes for my target. Reverting while I work
through the reports.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366615 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InstCombine] Fix copy/paste mistake in the test cases I added for PR42691. NFC
Craig Topper [Fri, 19 Jul 2019 21:09:21 +0000 (21:09 +0000)]
[InstCombine] Fix copy/paste mistake in the test cases I added for PR42691. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366614 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU: Avoid custom predicates for stores with glue
Matt Arsenault [Fri, 19 Jul 2019 21:01:30 +0000 (21:01 +0000)]
AMDGPU: Avoid custom predicates for stores with glue

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366613 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFix a latent bug discovered by r366610: nativecodegen includes X86CodeGen when X86...
Daniel Sanders [Fri, 19 Jul 2019 20:58:11 +0000 (20:58 +0000)]
Fix a latent bug discovered by r366610: nativecodegen includes X86CodeGen when X86 is not compiled

I believe this to have been a latent bug as the same expansion checks for the
existence of ${native_tgt}Info and ${native_tgt}Desc and only adds them if
they were compiled but unconditionally adds ${native_tgt}CodeGen.

This should fix llvm-clang-x86_64-win-fast which builds ARM only on an X86 host and similar builders.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366612 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InstCombine] Add test cases for PR42691. NFC
Craig Topper [Fri, 19 Jul 2019 20:48:52 +0000 (20:48 +0000)]
[InstCombine] Add test cases for PR42691. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366611 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoExpand pseudo-components before embedding in llvm-config
Daniel Sanders [Fri, 19 Jul 2019 20:38:05 +0000 (20:38 +0000)]
Expand pseudo-components before embedding in llvm-config

Summary:
If you use pseudo-targets like AllTargetsCodeGens in LLVM_DYLIB_COMPONENTS
then a test will fail because `./bin/llvm-config --shared-mode` can't
handle these targets. We can fix this by expanding them before embedding
the string into llvm-config

Reviewers: bogner

Reviewed By: bogner

Subscribers: mgorny, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366610 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU: Redefine setcc condition PatLeafs
Matt Arsenault [Fri, 19 Jul 2019 20:24:40 +0000 (20:24 +0000)]
AMDGPU: Redefine setcc condition PatLeafs

Avoid using custom code predicates.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366609 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU: Don't rely on m0 being -1 for GWS offsets
Matt Arsenault [Fri, 19 Jul 2019 20:01:24 +0000 (20:01 +0000)]
AMDGPU: Don't rely on m0 being -1 for GWS offsets

This only works if the high bits of m0 are also 0, so m0 would have to
be set to 0xffff.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366608 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU: Force s_waitcnt after GWS instructions
Matt Arsenault [Fri, 19 Jul 2019 19:47:30 +0000 (19:47 +0000)]
AMDGPU: Force s_waitcnt after GWS instructions

This is apparently required to be the immediately following
instruction, so force it into a bundle with a waitcnt.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366607 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoLiveIntervals: Fix handleMove asserting on BUNDLE
Matt Arsenault [Fri, 19 Jul 2019 19:32:00 +0000 (19:32 +0000)]
LiveIntervals: Fix handleMove asserting on BUNDLE

The top-level BUNDLE instruction should behave as an ordinary
instruction. It is supposed to have all relevant registers as implicit
operands. Moving it should work as any other instruction. I believe
the assert intended to avoid moving instructions inside bundles.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366605 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert "[libc++] Integrate the PSTL into libc++"
Louis Dionne [Fri, 19 Jul 2019 18:52:46 +0000 (18:52 +0000)]
Revert "[libc++] Integrate the PSTL into libc++"

This reverts r366593, which caused unforeseen breakage on the build bots.
I'm reverting until the problems have been figured out and fixed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366603 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AMDGPU] Add test case on crashing of `si-lower-sgpr-spills` pass
Michael Liao [Fri, 19 Jul 2019 18:50:53 +0000 (18:50 +0000)]
[AMDGPU] Add test case on crashing of `si-lower-sgpr-spills` pass

Reviewers: arsenm

Subscribers: qcolombet, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366602 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert "Use the MachineBasicBlock symbol for a callbr target"
Nick Desaulniers [Fri, 19 Jul 2019 18:18:02 +0000 (18:18 +0000)]
Revert "Use the MachineBasicBlock symbol for a callbr target"

This reverts commit r366523/ccbffefccaff42b0d094c9ef0f49fc3e8c8456ea.

Two regressions were immediately reported:
- https://github.com/ClangBuiltLinux/linux/issues/614
- https://github.com/ClangBuiltLinux/linux/issues/615

Reported-by: nathanchance
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366600 91177308-0d34-0410-b5e6-96231b3b80d8