]> granicus.if.org Git - llvm/log
llvm
5 years agoUpdate the FAQ: remove stuff related to the previous license +
Sylvestre Ledru [Thu, 3 Oct 2019 09:43:54 +0000 (09:43 +0000)]
Update the FAQ: remove stuff related to the previous license +
update info about the portability of LLVM.

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

5 years ago[llvm-exegesis][NFC] Rename ExegesisTarget::decrementLoopCounterAndLoop()
Clement Courbet [Thu, 3 Oct 2019 07:56:56 +0000 (07:56 +0000)]
[llvm-exegesis][NFC] Rename ExegesisTarget::decrementLoopCounterAndLoop()

Summary: To decrementLoopCounterAndJump, and explicitely take the jump target.

Reviewers: gchatelet

Subscribers: tschuett, llvm-commits

Tags: #llvm

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

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

5 years ago[X86] Add test case for v8i64->v8i8 truncate with avx512 and prefer-vector-width...
Craig Topper [Thu, 3 Oct 2019 06:18:45 +0000 (06:18 +0000)]
[X86] Add test case for v8i64->v8i8 truncate with avx512 and prefer-vector-width/min-legal-vector-width=256. NFC

With vpmovqb, we should be able to do better here until we get
AVX512VBMI on Cannonlake/Icelake.

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

5 years agoAMDGPU/GlobalISel: Don't re-get subtarget
Matt Arsenault [Thu, 3 Oct 2019 05:46:10 +0000 (05:46 +0000)]
AMDGPU/GlobalISel: Don't re-get subtarget

It's already available in the class.

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

5 years agoAMDGPU/GlobalISel: Expand G_BITCAST legality
Matt Arsenault [Thu, 3 Oct 2019 05:46:08 +0000 (05:46 +0000)]
AMDGPU/GlobalISel: Expand G_BITCAST legality

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

5 years ago[X86] Add DAG combine to turn (bitcast (vbroadcast_load)) into just a vbroadcast_load...
Craig Topper [Thu, 3 Oct 2019 05:30:02 +0000 (05:30 +0000)]
[X86] Add DAG combine to turn (bitcast (vbroadcast_load)) into just a vbroadcast_load if the scalar size is the same.

This improves broadcast load folding of i64 elements on 32-bit
targets where i64 isn't legal.

Previously we had to represent these as vXf64 vbroadcast_loads and
a bitcast to vXi64. But we didn't have any isel patterns
looking for that.

This also allows us to remove or simplify some isel patterns that
were looking for bitcasted vbroadcast_loads.

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

5 years ago[X86] Add broadcast load folding patterns to NoVLX VPMULLQ/VPMAXSQ/VPMAXUQ/VPMINSQ...
Craig Topper [Thu, 3 Oct 2019 03:16:27 +0000 (03:16 +0000)]
[X86] Add broadcast load folding patterns to NoVLX VPMULLQ/VPMAXSQ/VPMAXUQ/VPMINSQ/VPMINUQ patterns.

More fixes for PR36191.

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

5 years ago[X86] Remove a couple redundant isel patterns that look to have been copy/pasted...
Craig Topper [Thu, 3 Oct 2019 03:16:21 +0000 (03:16 +0000)]
[X86] Remove a couple redundant isel patterns that look to have been copy/pasted from right above them. NFC

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

5 years agogn build: Merge r373556
GN Sync Bot [Thu, 3 Oct 2019 02:43:27 +0000 (02:43 +0000)]
gn build: Merge r373556

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

5 years ago[gicombiner] Make rL373551 compatible with older cmakes
Daniel Sanders [Thu, 3 Oct 2019 01:49:04 +0000 (01:49 +0000)]
[gicombiner] Make rL373551 compatible with older cmakes

Newer cmakes appear to be more flexible w.r.t object libraries. Convert to
a static library so that it works with older cmakes too

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

5 years agogn build: (manually) merge r373551
Nico Weber [Thu, 3 Oct 2019 01:32:51 +0000 (01:32 +0000)]
gn build: (manually) merge r373551

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

5 years ago[gicombiner] Add a CodeExpander to handle C++ fragments with variable expansion
Daniel Sanders [Thu, 3 Oct 2019 01:04:42 +0000 (01:04 +0000)]
[gicombiner] Add a CodeExpander to handle C++ fragments with variable expansion

Summary:
This will handle expansion of C++ fragments in the declarative combiner
including custom predicates, and escapes into C++ to aid the migration
effort.

Reviewers: bogner, volkan

Subscribers: mgorny, llvm-commits

Tags: #llvm

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

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

5 years agogn build: Merge r373538
GN Sync Bot [Thu, 3 Oct 2019 00:47:13 +0000 (00:47 +0000)]
gn build: Merge r373538

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

5 years ago[gicombiner] Fix windows issue where single quotes in the command are passed through...
Daniel Sanders [Wed, 2 Oct 2019 23:38:06 +0000 (23:38 +0000)]
[gicombiner] Fix windows issue where single quotes in the command are passed through to tablegen

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

5 years ago[AMDGPU] Fix illegal agpr use by VALU
Stanislav Mekhanoshin [Wed, 2 Oct 2019 23:23:46 +0000 (23:23 +0000)]
[AMDGPU] Fix illegal agpr use by VALU

When SIFixSGPRCopies attempts to fix an illegal copy from vector to
scalar register it calls moveToVALU(). A copy from an agpr to sgpr
becomes a copy from agpr to agpr, which may result in the illegal
register class at a use of this copy.

Solution is to copy it always into a vgpr. This may result in a
subsequent copy into an agpr if that is what really needed, however
should not happen too often and likely will be folded later.

The opposite situation may not happen because an sgpr is always
illegal where agpr is legal, so such user instructions may not
exist.

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

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

5 years ago[gicombiner] Fix a nullptr dereference when -combiners is given a name that isn't...
Daniel Sanders [Wed, 2 Oct 2019 23:03:21 +0000 (23:03 +0000)]
[gicombiner] Fix a nullptr dereference when -combiners is given a name that isn't defined

This is unlikely to be the root cause for the windows bot failures but
it would explain the stack trace seen.

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

5 years ago[InstCombine] Bypass high bit extract before variable sign-extension (PR43523)
Roman Lebedev [Wed, 2 Oct 2019 23:02:12 +0000 (23:02 +0000)]
[InstCombine] Bypass high bit extract before variable sign-extension (PR43523)

https://rise4fun.com/Alive/8BY - valid for lshr+trunc+variable sext
https://rise4fun.com/Alive/7jk - the variable sext can be redundant

https://rise4fun.com/Alive/Qslu - 'exact'-ness of first shift can be preserver

https://rise4fun.com/Alive/IF63 - without trunc we could view this as
                                  more general "drop redundant mask before right-shift",
                                  but let's handle it here for now
https://rise4fun.com/Alive/iip - likewise, without trunc, variable sext can be redundant.

There's more patterns for sure - e.g. we can have 'lshr' as the final shift,
but that might be best handled by some more generic transform, e.g.
"drop redundant masking before right-shift" (PR42456)

I'm singling-out this sext patch because you can only extract
high bits with `*shr` (unlike abstract bit masking),
and i *know* this fold is wanted by existing code.

I don't believe there is much to review here,
so i'm gonna opt into post-review mode here.

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

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

5 years ago[NFC][InstCombine] Add tests for 'variable sext of variable high bit extract' pattern...
Roman Lebedev [Wed, 2 Oct 2019 23:01:58 +0000 (23:01 +0000)]
[NFC][InstCombine] Add tests for 'variable sext of variable high bit extract' pattern (PR43523)

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

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

5 years agoDebugInfo: Rename DebugLocStream::Entry::Begin/EndSym to just Begin/End
David Blaikie [Wed, 2 Oct 2019 22:58:02 +0000 (22:58 +0000)]
DebugInfo: Rename DebugLocStream::Entry::Begin/EndSym to just Begin/End

Brings this struct in line with the RangeSpan class so they might
eventually be used by common template code for generating range/loc
lists with less duplicate code.

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

5 years ago[InstCombine] Transform bcopy to memmove
David Bolvansky [Wed, 2 Oct 2019 22:49:20 +0000 (22:49 +0000)]
[InstCombine] Transform bcopy to memmove

bcopy is still widely used mainly for network apps. Sadly, LLVM has no optimizations for bcopy, but there are some for memmove.
Since bcopy == memmove, it is profitable to transform bcopy to memmove and use current optimizations for memmove for free here.

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

5 years ago[X86] Add test cases for suboptimal vselect+setcc splitting.
Craig Topper [Wed, 2 Oct 2019 22:35:03 +0000 (22:35 +0000)]
[X86] Add test cases for suboptimal vselect+setcc splitting.

If the vselect result type needs to be split, it will try to
also try to split the condition if it happens to be a setcc.

With avx512 where k-registers are legal, its probably better
to just use a kshift to split the mask register.

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

5 years ago[LegalizeTypes] Check for already split condition before calilng SplitVecRes_SETCC...
Craig Topper [Wed, 2 Oct 2019 22:34:49 +0000 (22:34 +0000)]
[LegalizeTypes] Check for already split condition before calilng SplitVecRes_SETCC in SplitRes_SELECT.

No point in manually splitting the SETCC if it was already done.

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

5 years agogn build: (manually) merge r373527
Nico Weber [Wed, 2 Oct 2019 22:33:07 +0000 (22:33 +0000)]
gn build: (manually) merge r373527

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

5 years agoDebugInfo: Simplify RangeSpan to be a plain struct
David Blaikie [Wed, 2 Oct 2019 22:27:24 +0000 (22:27 +0000)]
DebugInfo: Simplify RangeSpan to be a plain struct

This is an effort to make RangeSpan and DebugLocStream::Entry more
similar to share code for their emission (to reuse the more complicated
code for using (& choosing when to use) base address selection entries,
etc).

It didn't seem like this struct was worth the complexity of
encapsulation - when the members could be initialized by the ctor to any
value (no validation) and the type is assignable (so there's no
mutability or other constraint being implemented by its interface).

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

5 years ago[gicombiner] Add the boring boilerplate for the declarative combiner
Daniel Sanders [Wed, 2 Oct 2019 21:13:07 +0000 (21:13 +0000)]
[gicombiner] Add the boring boilerplate for the declarative combiner

Summary:
This is the first of a series of patches extracted from a much bigger WIP
patch. It merely establishes the tblgen pass and the way empty combiner
helpers are declared and integrated into a combiner info.

The tablegen pass takes a -combiners option to select the combiner helper
that will be generated. This can be given multiple values to generate
multiple combiner helpers at once. Doing so helps to minimize parsing
overhead.

The reason for creating a GlobalISel subdirectory in utils/TableGen is that
there will be quite a lot of non-pass files (~15) by the time the patch
series is done.

Reviewers: volkan

Subscribers: mgorny, hiraditya, simoncook, Petar.Avramovic, s.egerton, llvm-commits

Tags: #llvm

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

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

5 years agoRecommit "[GlobalOpt] Pass DTU to removeUnreachableBlocks instead of recomputing."
Florian Hahn [Wed, 2 Oct 2019 20:40:13 +0000 (20:40 +0000)]
Recommit "[GlobalOpt] Pass DTU to removeUnreachableBlocks instead of recomputing."

The cause for the revert should be fixed by r373513 /
a80b6c15425f82521c624ff24c5c0a34cd534d54

This reverts commit 47dbcbd8ec6bf6c0b9cbe5811e81a37cc55e73ef.

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

5 years ago[PowerPC] Fix SH field overflow issue
Yi-Hong Lyu [Wed, 2 Oct 2019 20:25:16 +0000 (20:25 +0000)]
[PowerPC] Fix SH field overflow issue

Store rlwinm Rx, Ry, 32, 0, 31 as rlwinm Rx, Ry, 0, 0, 31 and store
rldicl Rx, Ry, 64, 0 as rldicl Rx, Ry, 0, 0. Otherwise SH field is overflow and
fails assertion in assembly printing stage.

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

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

5 years agoFix inconsistent indentation in TableGen.cpp
Daniel Sanders [Wed, 2 Oct 2019 19:56:04 +0000 (19:56 +0000)]
Fix inconsistent indentation in TableGen.cpp

The anonymous namespace starts out (incorrectly) indented but isn't
indented from the TimeRegionsOpt declaration onwards.

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

5 years agoHandle llvm.launder.invariant.group in msan.
Evgeniy Stepanov [Wed, 2 Oct 2019 19:53:19 +0000 (19:53 +0000)]
Handle llvm.launder.invariant.group in msan.

Summary:
[MSan] handle llvm.launder.invariant.group

    Msan used to give false-positives in

    class Foo {
     public:
      virtual ~Foo() {};
    };

    // Return true iff *x is set.
    bool f1(void **x, bool flag);

    Foo* f() {
      void *p;
      bool found;
      found = f1(&p,flag);
      if (found) {
        // p is always set here.
        return static_cast<Foo*>(p); // False positive here.
      }
      return nullptr;
    }

Patch by Ilya Tokar.

Reviewers: #sanitizers, eugenis

Reviewed By: #sanitizers, eugenis

Subscribers: eugenis, Prazek, hiraditya, llvm-commits

Tags: #llvm

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

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

5 years ago[TableGen] Improve error reporting of overlapping definitions (NFC)
Evandro Menezes [Wed, 2 Oct 2019 19:44:53 +0000 (19:44 +0000)]
[TableGen] Improve error reporting of overlapping definitions (NFC)

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

5 years ago[Local] Handle terminators with users in removeUnreachableBlocks.
Florian Hahn [Wed, 2 Oct 2019 19:38:24 +0000 (19:38 +0000)]
[Local] Handle terminators with users in removeUnreachableBlocks.

Terminators like invoke can have users outside the current basic block.
We have to replace those users with undef, before replacing the
terminator.

This fixes a crash exposed by rL373430.

Reviewers: brzycki, asbirlea, davide, spatel

Reviewed By: asbirlea

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

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

5 years ago[MemorySSA] Update Phi creation when inserting a Def.
Alina Sbirlea [Wed, 2 Oct 2019 18:42:33 +0000 (18:42 +0000)]
[MemorySSA] Update Phi creation when inserting a Def.

MemoryPhis should be added in the IDF of the blocks newly gaining Defs.
This includes the blocks that gained a Phi and the block gaining a Def,
if the block did not have one before.
Resolves PR43427.

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

5 years ago[ARM] Make helpers static. NFC.
Benjamin Kramer [Wed, 2 Oct 2019 18:20:24 +0000 (18:20 +0000)]
[ARM] Make helpers static. NFC.

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

5 years ago[X86] Rewrite to the vXi1 subvector insertion code to not rely on the value of bits...
Craig Topper [Wed, 2 Oct 2019 17:47:09 +0000 (17:47 +0000)]
[X86] Rewrite to the vXi1 subvector insertion code to not rely on the value of bits that might be undef

The previous code tried to do a trick where we would extract the subvector from the location we were inserting. Then xor that with the new value. Take the xored value and clear out the bits above the subvector size. Then shift that xored subvector to the insert location. And finally xor that with the original vector. Since the old subvector was used in both xors, this would leave just the new subvector at the inserted location. Since the surrounding bits had been zeroed no other bits of the original vector would be modified.

Unfortunately, if the old subvector came from undef we might aggressively propagate the undef. Then we end up with the XORs not cancelling because they aren't using the same value for the two uses of the old subvector. @bkramer gave me a case that demonstrated this, but we haven't reduced it enough to make it easily readable to see what's happening.

This patch uses a safer, but more costly approach. It isolate the bits above the insertion and bits below the insert point and ORs those together leaving 0 for the insertion location. Then widens the subvector with 0s in the upper bits, shifts it into position with 0s in the lower bits. Then we do another OR.

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

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

5 years agoFix: Actually erase remove the elements from AssumeHandles
Aditya Kumar [Wed, 2 Oct 2019 17:35:06 +0000 (17:35 +0000)]
Fix: Actually erase remove the elements from AssumeHandles

Reviewers: sdmitriev, tejohnson

Reviewed by: tejohnson

Subscribers: llvm-commits

Tags: #llvm

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

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

5 years ago[WebAssembly] Error when using wasm64 for ISel
Thomas Lively [Wed, 2 Oct 2019 17:34:44 +0000 (17:34 +0000)]
[WebAssembly] Error when using wasm64 for ISel

Summary:
64-bit WebAssembly (wasm64) is not specified and not supported in the
WebAssembly backend. We do have support for it in clang, however, and
we would like to keep that support because we expect wasm64 to be
specified and supported in the future. For now add an error when
trying to use wasm64 from the backend to minimize user confusion from
unexplained crashes.

Reviewers: aheejin, dschuff, sunfish

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

Tags: #llvm

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

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

5 years agogn build: Merge r373489
GN Sync Bot [Wed, 2 Oct 2019 17:23:41 +0000 (17:23 +0000)]
gn build: Merge r373489

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

5 years ago[AMDGPU] Extend buffer intrinsics with swizzling
Piotr Sobczak [Wed, 2 Oct 2019 17:22:36 +0000 (17:22 +0000)]
[AMDGPU] Extend buffer intrinsics with swizzling

Summary:
Extend cachepolicy operand in the new VMEM buffer intrinsics
to supply information whether the buffer data is swizzled.
Also, propagate this information to MIR.

Intrinsics updated:
int_amdgcn_raw_buffer_load
int_amdgcn_raw_buffer_load_format
int_amdgcn_raw_buffer_store
int_amdgcn_raw_buffer_store_format
int_amdgcn_raw_tbuffer_load
int_amdgcn_raw_tbuffer_store
int_amdgcn_struct_buffer_load
int_amdgcn_struct_buffer_load_format
int_amdgcn_struct_buffer_store
int_amdgcn_struct_buffer_store_format
int_amdgcn_struct_tbuffer_load
int_amdgcn_struct_tbuffer_store

Furthermore, disable merging of VMEM buffer instructions
in SI Load/Store optimizer, if the "swizzled" bit on the instruction
is on.

The default value of the bit is 0, meaning that data in buffer
is linear and buffer instructions can be merged.

There is no difference in the generated code with this commit.
However, in the future it will be expected that front-ends
use buffer intrinsics with correct "swizzled" bit set.

Reviewers: arsenm, nhaehnle, tpr

Reviewed By: nhaehnle

Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, arphaman, jfb, Petar.Avramovic, llvm-commits

Tags: #llvm

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

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

5 years ago[Local] Remove unused LazyValueInfo pointer from removeUnreachableBlock.
Florian Hahn [Wed, 2 Oct 2019 16:58:13 +0000 (16:58 +0000)]
[Local] Remove unused LazyValueInfo pointer from removeUnreachableBlock.

There are no users that pass in LazyValueInfo, so we can simplify the
function a bit.

Reviewers: brzycki, asbirlea, davide

Reviewed By: davide

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

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

5 years ago[ThinLTO/WPD] Ensure devirtualized targets use promoted symbol when necessary
Teresa Johnson [Wed, 2 Oct 2019 16:36:59 +0000 (16:36 +0000)]
[ThinLTO/WPD] Ensure devirtualized targets use promoted symbol when necessary

Summary:
This fixes a hole in the handling of devirtualized targets that were
local but need promoting due to devirtualization in another module. We
were not correctly referencing the promoted symbol in some cases. Make
sure the code that updates the name also looks at the ExportedGUIDs set
by utilizing a callback that checks all conditions (the callback
utilized by the internalization/promotion code).

Reviewers: pcc, davidxl, hiraditya

Subscribers: mehdi_amini, Prazek, inglorion, steven_wu, dexonsmith, dang, llvm-commits

Tags: #llvm

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

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

5 years ago[CodeGen] Remove unused MachineMemOperand::print wrappers (PR41772)
Simon Pilgrim [Wed, 2 Oct 2019 16:20:28 +0000 (16:20 +0000)]
[CodeGen] Remove unused MachineMemOperand::print wrappers (PR41772)

As noted on PR41772, the static analyzer reports that the MachineMemOperand::print partial wrappers set a number of args to null pointers that were then dereferenced in the actual implementation.

It turns out that these wrappers are not being used at all (hence why we're not seeing any crashes), so I'd like to propose we just get rid of them.

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

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

5 years ago[SLP] add test for vectorization of different widths (PR28457); NFC
Sanjay Patel [Wed, 2 Oct 2019 16:12:42 +0000 (16:12 +0000)]
[SLP] add test for vectorization of different widths (PR28457); NFC

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

5 years ago[llvm] [cmake] Add install targets for missing distribution components
Michal Gorny [Wed, 2 Oct 2019 16:06:50 +0000 (16:06 +0000)]
[llvm] [cmake] Add install targets for missing distribution components

Add install targets as necessary to include all files normally installed
in LLVM_DISTRIBUTION_COMPONENTS.  This includes targets for Sphinx docs,
opt-viewer Python modules and TableGens.

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

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

5 years agoLowerExpectIntrinsic handlePhiDef - silence static analyzer dyn_cast<PHINode> null...
Simon Pilgrim [Wed, 2 Oct 2019 16:03:45 +0000 (16:03 +0000)]
LowerExpectIntrinsic handlePhiDef - silence static analyzer dyn_cast<PHINode> null dereference warning. NFCI.

The static analyzer is warning about a potential null dereference, but we should be able to use cast<PHINode> directly and if not assert will fire for us.

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

5 years ago[CodeExtractor] NFC: Refactor sanity checks into isEligible
Aditya Kumar [Wed, 2 Oct 2019 15:36:39 +0000 (15:36 +0000)]
[CodeExtractor] NFC: Refactor sanity checks into isEligible

Reviewers: fhahn

Subscribers: llvm-commits

Tags: #llvm

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

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

5 years agoReapply r373431 "Switch lowering: omit range check for bit tests when default is...
Hans Wennborg [Wed, 2 Oct 2019 14:35:06 +0000 (14:35 +0000)]
Reapply r373431 "Switch lowering: omit range check for bit tests when default is unreachable (PR43129)"

This was reverted in r373454 due to breaking the expensive-checks bot.
This version addresses that by omitting the addSuccessorWithProb() call
when omitting the range check.

> Switch lowering: omit range check for bit tests when default is unreachable (PR43129)
>
> This is modeled after the same functionality for jump tables, which was
> added in r357067.
>
> Differential revision: https://reviews.llvm.org/D68131

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

5 years ago[llvm-readelf] - Report a warning when .hash section contains a chain with a cycle.
George Rimar [Wed, 2 Oct 2019 14:11:35 +0000 (14:11 +0000)]
[llvm-readelf] - Report a warning when .hash section contains a chain with a cycle.

It is possible to craft a .hash section that triggers an infinite loop
in llvm-readelf code. This patch fixes the issue and introduces
a warning.

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

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

5 years ago[yaml2obj] - Alow Size tag for describing SHT_HASH sections.
George Rimar [Wed, 2 Oct 2019 13:52:37 +0000 (13:52 +0000)]
[yaml2obj] - Alow Size tag for describing SHT_HASH sections.

This is a follow-up for D68085 which allows using "Size"
tag together with "Content" tag or alone.

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

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

5 years ago[llvm-dwarfdump] Fix dumping of wrong locstats map
Djordje Todorovic [Wed, 2 Oct 2019 13:24:45 +0000 (13:24 +0000)]
[llvm-dwarfdump] Fix dumping of wrong locstats map

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

5 years ago[AArch64][SVE] Implement int_aarch64_sve_cnt intrinsic
Kerry McLaughlin [Wed, 2 Oct 2019 13:09:54 +0000 (13:09 +0000)]
[AArch64][SVE] Implement int_aarch64_sve_cnt intrinsic

Summary: This patch includes tests for the VecOfBitcastsToInt type added by D68021

Reviewers: c-rhodes, sdesmalen, rovka

Reviewed By: c-rhodes

Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, llvm-commits, cfe-commits

Tags: #llvm

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

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

5 years agoMemorySSAUpdater::applyInsertUpdates - silence static analyzer dyn_cast<MemoryAccess...
Simon Pilgrim [Wed, 2 Oct 2019 13:09:12 +0000 (13:09 +0000)]
MemorySSAUpdater::applyInsertUpdates - silence static analyzer dyn_cast<MemoryAccess> null dereference warning. NFCI.

The static analyzer is warning about a potential null dereference, but we should be able to use cast<MemoryAccess> directly and if not assert will fire for us.

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

5 years agoMemorySSA tryOptimizePhi - assert that we've found a DefChainEnd. NFCI.
Simon Pilgrim [Wed, 2 Oct 2019 13:09:04 +0000 (13:09 +0000)]
MemorySSA tryOptimizePhi - assert that we've found a DefChainEnd. NFCI.

Silences static analyzer null dereference warning.

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

5 years agoLoopAccessAnalysis isConsecutiveAccess() - silence static analyzer dyn_cast<SCEVConst...
Simon Pilgrim [Wed, 2 Oct 2019 13:08:56 +0000 (13:08 +0000)]
LoopAccessAnalysis isConsecutiveAccess() - silence static analyzer dyn_cast<SCEVConstant> null dereference warning. NFCI.

The static analyzer is warning about potential null dereferences, but in these cases we should be able to use cast<SCEVConstant> directly and if not assert will fire for us.

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

5 years agoAsmPrinter - emitGlobalConstantFP - silence static analyzer null dereference warning...
Simon Pilgrim [Wed, 2 Oct 2019 13:08:46 +0000 (13:08 +0000)]
AsmPrinter - emitGlobalConstantFP - silence static analyzer null dereference warning. NFCI.

All the calls to emitGlobalConstantFP should provide a nonnull Type for the float.

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

5 years agogn build: Merge r373462
GN Sync Bot [Wed, 2 Oct 2019 12:51:47 +0000 (12:51 +0000)]
gn build: Merge r373462

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

5 years ago[ModuloSchedule] Peel out prologs and epilogs, generate actual code
James Molloy [Wed, 2 Oct 2019 12:46:44 +0000 (12:46 +0000)]
[ModuloSchedule] Peel out prologs and epilogs, generate actual code

Summary:
This extends the PeelingModuloScheduleExpander to generate prolog and epilog code,
and correctly stitch uses through the prolog, kernel, epilog DAG.

The key concept in this patch is to ensure that all transforms are *local*; only a
function of a block and its immediate predecessor and successor. By defining the problem in this way
we can inductively rewrite the entire DAG using only local knowledge that is easy to
reason about.

For example, we assume that all prologs and epilogs are near-perfect clones of the
steady-state kernel. This means that if a block has an instruction that is predicated out,
we can redirect all users of that instruction to that equivalent instruction in our
immediate predecessor. As all blocks are clones, every instruction must have an equivalent in
every other block.

Similarly we can make the assumption by construction that if a value defined in a block is used
outside that block, the only possible user is its immediate successors. We maintain this
even for values that are used outside the loop by creating a limited form of LCSSA.

This code isn't small, but it isn't complex.

Enabled a bunch of testing from Hexagon. There are a couple of tests not enabled yet;
I'm about 80% sure there isn't buggy codegen but the tests are checking for patterns
that we don't produce. Those still need a bit more investigation. In the meantime we
(Google) are happy with the code produced by this on our downstream SMS implementation,
and believe it generates correct code.

Subscribers: mgorny, hiraditya, jsji, llvm-commits

Tags: #llvm

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

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

5 years ago[llvm-objcopy] Add --set-section-alignment
Fangrui Song [Wed, 2 Oct 2019 12:41:25 +0000 (12:41 +0000)]
[llvm-objcopy] Add --set-section-alignment

Fixes PR43181. This option was recently added to GNU objcopy (binutils
PR24942).

`llvm-objcopy -I binary -O elf64-x86-64 --set-section-alignment .data=8` can set the alignment of .data.

Reviewed By: grimar, jhenderson, rupprecht

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

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

5 years ago[InstCombine] Simplify fma multiplication to nan for undef or nan operands.
Florian Hahn [Wed, 2 Oct 2019 12:32:52 +0000 (12:32 +0000)]
[InstCombine] Simplify fma multiplication to nan for undef or nan operands.

In similar fashion to D67721, we can simplify FMA multiplications if any
of the operands is NaN or undef. In instcombine, we will simplify the
FMA to an fadd with a NaN operand, which in turn gets folded to NaN.

Note that this just changes SimplifyFMAFMul, so we still not catch the
case where only the Add part of the FMA is Nan/Undef.

Reviewers: cameron.mcinally, mcberg2017, spatel, arsenm

Reviewed By: cameron.mcinally

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

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

5 years ago[InstCombine] Precommit tests for D68265
Florian Hahn [Wed, 2 Oct 2019 12:32:37 +0000 (12:32 +0000)]
[InstCombine] Precommit tests for D68265

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

5 years agoNFC: directly return when CommonExitBlock != Succ
Aditya Kumar [Wed, 2 Oct 2019 12:15:17 +0000 (12:15 +0000)]
NFC: directly return when CommonExitBlock != Succ

Subscribers: llvm-commits

Tags: #llvm

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

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

5 years ago[InstSimplify] fold fma/fmuladd with a NaN or undef operand
Sanjay Patel [Wed, 2 Oct 2019 12:12:02 +0000 (12:12 +0000)]
[InstSimplify] fold fma/fmuladd with a NaN or undef operand

This is intended to be similar to the constant folding results from
D67446
and earlier, but not all operands are constant in these tests, so the
responsibility for folding is left to InstSimplify.

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

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

5 years agoRevert r373431 "Switch lowering: omit range check for bit tests when default is unrea...
Hans Wennborg [Wed, 2 Oct 2019 12:08:44 +0000 (12:08 +0000)]
Revert r373431 "Switch lowering: omit range check for bit tests when default is unreachable (PR43129)"

This broke http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/19967

> Switch lowering: omit range check for bit tests when default is unreachable (PR43129)
>
> This is modeled after the same functionality for jump tables, which was
> added in r357067.
>
> Differential revision: https://reviews.llvm.org/D68131

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

5 years agoLICM - remove unused variable and reduce scope of another variable. NFCI.
Simon Pilgrim [Wed, 2 Oct 2019 11:49:53 +0000 (11:49 +0000)]
LICM - remove unused variable and reduce scope of another variable. NFCI.

Appeases both clang static analyzer and cppcheck

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

5 years agoFix uninitialized variable warning. NFCI.
Simon Pilgrim [Wed, 2 Oct 2019 11:48:45 +0000 (11:48 +0000)]
Fix uninitialized variable warning. NFCI.

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

5 years agoWinException::emitExceptHandlerTable - silence static analyzer dyn_cast<Function...
Simon Pilgrim [Wed, 2 Oct 2019 11:48:32 +0000 (11:48 +0000)]
WinException::emitExceptHandlerTable - silence static analyzer dyn_cast<Function> null dereference warning. NFCI.

The static analyzer is warning about a potential null dereference, but we should be able to use cast<Function> directly and if not assert will fire for us.

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

5 years agoMetadataLoader upgradeCUVariables() - silence static analyzer dyn_cast_or_null<>...
Simon Pilgrim [Wed, 2 Oct 2019 11:48:17 +0000 (11:48 +0000)]
MetadataLoader upgradeCUVariables() - silence static analyzer dyn_cast_or_null<> null dereference warning. NFCI.

The static analyzer is warning about a potential null dereference, but we know that the source won't be null so just use dyn_cast, which will assert if the value somehow is actually null.

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

5 years ago[ARM] Identity shuffles are legal
David Green [Wed, 2 Oct 2019 11:40:51 +0000 (11:40 +0000)]
[ARM] Identity shuffles are legal

Identity shuffles, of the form (0, 1, 2, 3, ...) are perfectly OK under MVE
(they essentially just become bitcasts). We were not catching that in the
existing set of what we considered legal though. On NEON, they would be covered
by vext's, but that is not generally available in MVE.

This uses ShuffleVectorInst::isIdentityMask which is a little odd to use here
but does what we want and prevents us from just rewriting what is the same
function.

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

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

5 years ago[Support, ARM64] Define getHostCPUFeatures for Windows on ARM64 platform
Martin Storsjo [Wed, 2 Oct 2019 11:04:55 +0000 (11:04 +0000)]
[Support, ARM64] Define getHostCPUFeatures for Windows on ARM64 platform

Patch by Adam Kallai!

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

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

5 years agogn build: (manually) merge r373425
Nico Weber [Wed, 2 Oct 2019 09:48:16 +0000 (09:48 +0000)]
gn build: (manually) merge r373425

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

5 years ago[IntrinsicEmitter] Add overloaded type VecOfBitcastsToInt for SVE intrinsics
Kerry McLaughlin [Wed, 2 Oct 2019 09:25:02 +0000 (09:25 +0000)]
[IntrinsicEmitter] Add overloaded type VecOfBitcastsToInt for SVE intrinsics

Summary:
This allows intrinsics such as the following to be defined:
 - declare <n x 4 x i32> @llvm.something.nxv4f32(<n x 4 x i32>, <n x 4 x i1>, <n x 4 x float>)

...where <n x 4 x i32> is derived from <n x 4 x float>, but
the element needs bitcasting to int.

Reviewers: c-rhodes, sdesmalen, rovka

Reviewed By: c-rhodes

Subscribers: tschuett, hiraditya, jdoerfert, llvm-commits, cfe-commits

Tags: #llvm

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

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

5 years agoRemove an unnecessary cast. NFC.
Jay Foad [Wed, 2 Oct 2019 08:56:33 +0000 (08:56 +0000)]
Remove an unnecessary cast. NFC.

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

5 years ago[AMDGPU] Make printf lowering faster when there are no printfs
Jay Foad [Wed, 2 Oct 2019 08:44:15 +0000 (08:44 +0000)]
[AMDGPU] Make printf lowering faster when there are no printfs

Summary:
Printf lowering unconditionally visited every instruction in the module.
To make it faster in the common case where there are no printfs, look up
the printf function (if any) and iterate over its users instead.

Reviewers: rampitec, kzhuravl, alex-t, arsenm

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

Tags: #llvm

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

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

5 years agoRevert [GlobalOpt] Pass DTU to removeUnreachableBlocks instead of recomputing.
Florian Hahn [Wed, 2 Oct 2019 08:32:25 +0000 (08:32 +0000)]
Revert [GlobalOpt] Pass DTU to removeUnreachableBlocks instead of recomputing.

This breaks http://lab.llvm.org:8011/builders/sanitizer-windows/builds/52310

This reverts r373430 (git commit 70f70035484ba199a329f9f8d9bd67e37bc2b408)

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

5 years agoSwitch lowering: omit range check for bit tests when default is unreachable (PR43129)
Hans Wennborg [Wed, 2 Oct 2019 08:32:15 +0000 (08:32 +0000)]
Switch lowering: omit range check for bit tests when default is unreachable (PR43129)

This is modeled after the same functionality for jump tables, which was
added in r357067.

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

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

5 years ago[GlobalOpt] Pass DTU to removeUnreachableBlocks instead of recomputing.
Florian Hahn [Wed, 2 Oct 2019 08:15:31 +0000 (08:15 +0000)]
[GlobalOpt] Pass DTU to removeUnreachableBlocks instead of recomputing.

removeUnreachableBlocks knows how to preserve the DomTree, so make use
of it instead of re-computing the DT.

Reviewers: davide, kuhar, brzycki

Reviewed By: davide, kuhar

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

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

5 years ago[Local] Simplify function removeUnreachableBlocks() to avoid (re-)computation.
Florian Hahn [Wed, 2 Oct 2019 07:37:41 +0000 (07:37 +0000)]
[Local] Simplify function removeUnreachableBlocks() to avoid (re-)computation.

Two small changes in llvm::removeUnreachableBlocks() to avoid unnecessary (re-)computation.

First, replace the use of count() with find(), which has better time complexity.

Second, because we have already computed the set of dead blocks, replace the second loop over all basic blocks to a loop only over the already computed dead blocks. This simplifies the loop and avoids recomputation.

Patch by Rodrigo Caetano Rocha <rcor.cs@gmail.com>

Reviewers: efriedma, spatel, fhahn, xbolva00

Reviewed By: fhahn, xbolva00

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

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

5 years agoReland "[utils] Implement the llvm-locstats tool"
Djordje Todorovic [Wed, 2 Oct 2019 07:00:01 +0000 (07:00 +0000)]
Reland "[utils] Implement the llvm-locstats tool"

The tool reports verbose output for the DWARF debug location coverage.
The llvm-locstats for each variable or formal parameter DIE computes what
percentage from the code section bytes, where it is in scope, it has
location description. The line 0 shows the number (and the percentage) of
DIEs with no location information, but the line 100 shows the number (and
the percentage) of DIEs where there is location information in all code
section bytes (where the variable or parameter is in the scope). The line
50..59 shows the number (and the percentage) of DIEs where the location
information is in between 50 and 59 percentage of its scope covered.

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

The cause of the test failure was resolved.

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

5 years ago[llvm-lib] Detect duplicate input files
Rui Ueyama [Wed, 2 Oct 2019 06:41:52 +0000 (06:41 +0000)]
[llvm-lib] Detect duplicate input files

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

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

5 years ago[llvm-lib] Correctly handle .lib input files
Rui Ueyama [Wed, 2 Oct 2019 05:24:24 +0000 (05:24 +0000)]
[llvm-lib] Correctly handle .lib input files

If archive files are passed as input files, llvm-lib needs to append
the members of the input archive files to the output file. This patch
implements that behavior.

This patch splits an existing function into smaller functions.
Effectively, the new code is only `if (Magic == file_magic::archive)
{ ... }` part.

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

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

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

5 years ago[X86] Add broadcast load folding patterns to the NoVLX compare patterns.
Craig Topper [Wed, 2 Oct 2019 04:45:02 +0000 (04:45 +0000)]
[X86] Add broadcast load folding patterns to the NoVLX compare patterns.

These patterns use zmm registers for 128/256-bit compares when
the VLX instructions aren't available. Previously we only
supported registers, but as PR36191 notes we can fold broadcast
loads, but not regular loads.

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

5 years agoFix GCC -Wreturn-type warnings. NFC.
Michael Liao [Wed, 2 Oct 2019 04:13:17 +0000 (04:13 +0000)]
Fix GCC -Wreturn-type warnings. NFC.

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

5 years agoDebugInfo: Update support for detecting C++ language variants in debug info emission
David Blaikie [Wed, 2 Oct 2019 01:39:48 +0000 (01:39 +0000)]
DebugInfo: Update support for detecting C++ language variants in debug info emission

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

5 years agogn build: (manually) merge r373407
Nico Weber [Wed, 2 Oct 2019 01:26:46 +0000 (01:26 +0000)]
gn build: (manually) merge r373407

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

5 years agoAMDGPU/GlobalISel: Use getIntrinsicID helper
Matt Arsenault [Wed, 2 Oct 2019 01:02:27 +0000 (01:02 +0000)]
AMDGPU/GlobalISel: Use getIntrinsicID helper

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

5 years agoAMDGPU/GlobalISel: Assume VGPR for G_FRAME_INDEX
Matt Arsenault [Wed, 2 Oct 2019 01:02:24 +0000 (01:02 +0000)]
AMDGPU/GlobalISel: Assume VGPR for G_FRAME_INDEX

In principle this should behave as any other constant. However
eliminateFrameIndex currently assumes a VALU use and uses a vector
shift. Work around this by selecting to VGPR for now until
eliminateFrameIndex is fixed.

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

5 years agoAMDGPU/GlobalISel: Private loads always use VGPRs
Matt Arsenault [Wed, 2 Oct 2019 01:02:21 +0000 (01:02 +0000)]
AMDGPU/GlobalISel: Private loads always use VGPRs

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

5 years agoAMDGPU/GlobalISel: Legalize 1024-bit G_BUILD_VECTOR
Matt Arsenault [Wed, 2 Oct 2019 01:02:18 +0000 (01:02 +0000)]
AMDGPU/GlobalISel: Legalize 1024-bit G_BUILD_VECTOR

This will be needed to support AGPR operations.

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

5 years agoAMDGPU/GlobalISel: Fix RegBankSelect for 1024-bit values
Matt Arsenault [Wed, 2 Oct 2019 01:02:14 +0000 (01:02 +0000)]
AMDGPU/GlobalISel: Fix RegBankSelect for 1024-bit values

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

5 years ago[AMDGPU] separate accounting for agprs
Stanislav Mekhanoshin [Wed, 2 Oct 2019 00:26:58 +0000 (00:26 +0000)]
[AMDGPU] separate accounting for agprs

Account and report agprs separately on gfx908. Other targets
do not change the reporting.

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

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

5 years ago[X86] Add a DAG combine to shrink vXi64 gather/scatter indices that are constant...
Craig Topper [Tue, 1 Oct 2019 23:18:31 +0000 (23:18 +0000)]
[X86] Add a DAG combine to shrink vXi64 gather/scatter indices that are constant with sufficient sign bits to fit in vXi32

The gather/scatter instructions can implicitly sign extend the indices. If we're operating on 32-bit data, an v16i64 index can force a v16i32 gather to be split in two since the index needs 2 registers. If we can shrink the index to the i32 we can avoid the split. It should always be safe to shrink the index regardless of the number of elements. We have gather/scatter instructions that can use v2i32 index stored in a v4i32 register with v2i64 data size.

I've limited this to before legalize types to avoid creating a v2i32 after type legalization. We could check for it, but we'd also need testing. I'm also only handling build_vectors with no bitcasts to be sure the truncate will constant fold.

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

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

5 years agoAMDGPU: Fix an out of date assert in addressing FrameIndex
Changpeng Fang [Tue, 1 Oct 2019 23:07:14 +0000 (23:07 +0000)]
AMDGPU: Fix an out of date assert in addressing FrameIndex

Reviewers:
  arsenm

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

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

5 years agoRevert r373172 "[X86] Add custom isel logic to match VPTERNLOG from 2 logic ops."
Craig Topper [Tue, 1 Oct 2019 22:40:03 +0000 (22:40 +0000)]
Revert r373172 "[X86] Add custom isel logic to match VPTERNLOG from 2 logic ops."

This seems to be causing some performance regresions that I'm
trying to investigate.

One thing that stands out is that this transform can increase
the live range of the operands of the earlier logic op. This
can be bad for register allocation. If there are two logic
op inputs we should really combine the one that is closest, but
SelectionDAG doesn't have a good way to do that. Maybe we need
to do this as a basic block transform in Machine IR.

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

5 years ago[X86] convertToThreeAddress, make sure second operand of SUB32ri is really an immedia...
Craig Topper [Tue, 1 Oct 2019 21:55:55 +0000 (21:55 +0000)]
[X86] convertToThreeAddress, make sure second operand of SUB32ri is really an immediate before calling getImm().

It might be a symbol instead. We can't fold those since we can't
negate them.

Similar for other SUB with immediates.

Fixes PR43529.

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

5 years ago[FileCheck] Move private interface to its own header
Thomas Preud'homme [Tue, 1 Oct 2019 21:37:55 +0000 (21:37 +0000)]
[FileCheck] Move private interface to its own header

Summary:
Most of the class definition in llvm/include/llvm/Support/FileCheck.h
are actually implementation details that should not be relied upon. This
commit moves all of it in a new header file under
llvm/lib/Support/FileCheck. It also takes advantage of the code movement
to put the code into a new llvm::filecheck namespace.

Reviewers: jhenderson, chandlerc, jdenny, probinson, grimar, arichardson, rnk

Subscribers: hiraditya, llvm-commits, probinson, dblaikie, grimar, arichardson, tra, rnk, kristina, hfinkel, rogfer01, JonChesterfield

Tags: #llvm

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

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

5 years ago[BypassSlowDivision][CodeGenPrepare] avoid crashing on unused code (PR43514)
Sanjay Patel [Tue, 1 Oct 2019 21:25:36 +0000 (21:25 +0000)]
[BypassSlowDivision][CodeGenPrepare] avoid crashing on unused code (PR43514)

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

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

5 years agogn build: Merge r373392
GN Sync Bot [Tue, 1 Oct 2019 21:23:33 +0000 (21:23 +0000)]
gn build: Merge r373392

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

5 years ago[ASan][NFC] Address remaining comments for https://reviews.llvm.org/D68287
Leonard Chan [Tue, 1 Oct 2019 20:49:07 +0000 (20:49 +0000)]
[ASan][NFC] Address remaining comments for https://reviews.llvm.org/D68287

I submitted that patch after I got the LGTM, but the comments didn't
appear until after I submitted the change. This adds `const` to the
constructor argument and makes it a pointer.

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

5 years ago[ASan] Make GlobalsMD member a const reference.
Leonard Chan [Tue, 1 Oct 2019 20:30:46 +0000 (20:30 +0000)]
[ASan] Make GlobalsMD member a const reference.

PR42924 points out that copying the GlobalsMetadata type during
construction of AddressSanitizer can result in exteremely lengthened
build times for translation units that have many globals. This can be addressed
by just making the GlobalsMD member in AddressSanitizer a reference to
avoid the copy. The GlobalsMetadata type is already passed to the
constructor as a reference anyway.

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

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

5 years ago[DDG] Data Dependence Graph - Root Node
Bardia Mahjour [Tue, 1 Oct 2019 19:32:42 +0000 (19:32 +0000)]
[DDG] Data Dependence Graph - Root Node

Summary:
This patch adds Root Node to the DDG. The purpose of the root node is to create a single entry node that allows graph walk iterators to iterate through all nodes of the graph, making sure that no node is left unvisited during a graph walk (eg. SCC or DFS). Once the DDG is fully constructed it will have exactly one root node. Every node in the graph is reachable from the root. The algorithm for connecting the root node is based on depth-first-search that keeps track of visited nodes to try to avoid creating unnecessary edges.

Authored By: bmahjour

Reviewer: Meinersbur, fhahn, myhsu, xtian, dmgreen, kbarton, jdoerfert

Reviewed By: Meinersbur

Subscribers: ychen, arphaman, simoll, a.elovikov, mgorny, hiraditya, jfb, wuzish, llvm-commits, jsji, Whitney, etiotto, ppc-slack

Tag: #llvm

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

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

5 years ago[MemorySSA] Check for unreachable blocks when getting last definition.
Alina Sbirlea [Tue, 1 Oct 2019 19:09:50 +0000 (19:09 +0000)]
[MemorySSA] Check for unreachable blocks when getting last definition.

If a single predecessor is found, still check if the block is
unreachable. The test that found this had a self loop unreachable block.
Resolves PR43493.

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