OSDN Git Service

android-x86/external-llvm.git
7 years ago[Hexagon] Perform bit arithmetic on unsigned to avoid accidentally shifting negative...
Benjamin Kramer [Sat, 30 Jul 2016 13:25:37 +0000 (13:25 +0000)]
[Hexagon] Perform bit arithmetic on unsigned to avoid accidentally shifting negative values.

Found by ubsan.

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

7 years agoUpdate modulemap for Msf -> MSF rename.
Benjamin Kramer [Sat, 30 Jul 2016 12:05:17 +0000 (12:05 +0000)]
Update modulemap for Msf -> MSF rename.

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

7 years ago[X86] Fix lifetime of SMRange temporaries.
Benjamin Kramer [Sat, 30 Jul 2016 11:31:24 +0000 (11:31 +0000)]
[X86] Fix lifetime of SMRange temporaries.

Found by asan -fsanitize-address-use-after-scope.

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

7 years ago[AMDGPU] Fix lifetime of SmallVector temporaries.
Benjamin Kramer [Sat, 30 Jul 2016 11:31:16 +0000 (11:31 +0000)]
[AMDGPU] Fix lifetime of SmallVector temporaries.

Found by asan -fsanitize-address-use-after-scope.

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

7 years agoAMDGPU: Fix shouldConvertConstantLoadToIntImm behavior
Matt Arsenault [Sat, 30 Jul 2016 01:40:36 +0000 (01:40 +0000)]
AMDGPU: Fix shouldConvertConstantLoadToIntImm behavior

This should really be true for any immediate, not just
inline ones.

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

7 years agoAMDGPU: Set s_setpc_b64 as a terminator
Matt Arsenault [Sat, 30 Jul 2016 01:40:34 +0000 (01:40 +0000)]
AMDGPU: Set s_setpc_b64 as a terminator

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

7 years agoAMDGPU: Remove unused pattern
Matt Arsenault [Sat, 30 Jul 2016 01:40:30 +0000 (01:40 +0000)]
AMDGPU: Remove unused pattern

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

8 years ago[Orc] Add support for updating stub targets to CompileOnDemandLayer.
Lang Hames [Sat, 30 Jul 2016 00:57:54 +0000 (00:57 +0000)]
[Orc] Add support for updating stub targets to CompileOnDemandLayer.

This makes it possible to implement re-optimization on top of the
CompileOnDemandLayer.

Test case to come in a future patch: This will need an execution test, and
execution tests require a full working stack. The best option is to plumb this
API up to the C Bindings stack and add a C bindings test for this.

Patch by Sean Ogden. Thanks Sean!

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

8 years agoRemove empty DebugInfo/Msf dirs. It seems these were left over from
Hans Wennborg [Sat, 30 Jul 2016 00:08:45 +0000 (00:08 +0000)]
Remove empty DebugInfo/Msf dirs. It seems these were left over from
the renaming from 'Msf' to 'MSF' in r277213.

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

8 years agoDAG: avoid duplicated truncating for sign extended operand
Weiming Zhao [Fri, 29 Jul 2016 23:33:48 +0000 (23:33 +0000)]
DAG: avoid duplicated truncating for sign extended operand

Summary:
When performing cmp for EQ/NE and the operand is sign extended, we can
avoid the truncaton if the bits to be tested are no less than origianl
bits.

Reviewers: eli.friedman

Subscribers: eli.friedman, aemerson, nemanjai, t.p.northover, llvm-commits

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

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

8 years ago[Support] Add storage specifier for MachO::NListType.
Lang Hames [Fri, 29 Jul 2016 23:17:53 +0000 (23:17 +0000)]
[Support] Add storage specifier for MachO::NListType.

This should fix UB warnings from the sanitizer bots: LLD performs bit
manipulations on enums of this type, and these are UB if the underlying
storage type isn't specified.

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

8 years agoGlobalISel: translate "unreachable" (into nothing)
Tim Northover [Fri, 29 Jul 2016 22:41:55 +0000 (22:41 +0000)]
GlobalISel: translate "unreachable" (into nothing)

Easiest instruction ever!

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

8 years agoGlobalISel: support translation of intrinsic calls.
Tim Northover [Fri, 29 Jul 2016 22:32:36 +0000 (22:32 +0000)]
GlobalISel: support translation of intrinsic calls.

These come in two variants for now: G_INTRINSIC and G_INTRINSIC_W_SIDE_EFFECTS.
We may decide to split the latter up with finer-grained restrictions later, if
necessary.

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

8 years agoThink this will fix issues with the error messages generated for malformed-archives...
Kevin Enderby [Fri, 29 Jul 2016 22:32:02 +0000 (22:32 +0000)]
Think this will fix issues with the error messages generated for malformed-archives.test
in r277177 and added back this test which was deleted in r277196 while
I tracked down these problems.

Changed from constructing Twine's to std::string's as Twine's don't work
across statements.  Also removed a few unneeded Twine() constructions.

Fix the write_escaped() calls to not pass the unintended second argument
fixing the warning on the ld-x86_64-win7 bot.

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

8 years ago[Hexagon] Referencify MachineInstr in HexagonInstrInfo, NFC
Krzysztof Parzyszek [Fri, 29 Jul 2016 21:49:42 +0000 (21:49 +0000)]
[Hexagon] Referencify MachineInstr in HexagonInstrInfo, NFC

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

8 years ago[X86] Match PSADBW in straight-line code
Michael Kuperstein [Fri, 29 Jul 2016 21:45:51 +0000 (21:45 +0000)]
[X86] Match PSADBW in straight-line code

Up until now, we only had code to match PSADBW patterns that look like what
comes out of the loop vectorizer - a partial reduction inside the loop body
that gets fed into a horizontal operation in a different basic block.

This adds support for straight-line patterns, like those generated by the
SLP vectorizer.

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

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

8 years ago[Hexagon] Fix test that uses -debug-only to require asserts.
Michael Kuperstein [Fri, 29 Jul 2016 21:44:33 +0000 (21:44 +0000)]
[Hexagon] Fix test that uses -debug-only to require asserts.

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

8 years agopdbdump: Dump Free Page Map contents.
Rui Ueyama [Fri, 29 Jul 2016 21:38:00 +0000 (21:38 +0000)]
pdbdump: Dump Free Page Map contents.

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

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

8 years ago[X86][AVX] Fix VBROADCASTF128 selection bug (PR28770)
Simon Pilgrim [Fri, 29 Jul 2016 21:05:10 +0000 (21:05 +0000)]
[X86][AVX] Fix VBROADCASTF128 selection bug (PR28770)

Support for lowering to VBROADCASTF128 etc. in D22460 was not correctly ensuring that the only users of the 128-bit vector load were the insertions of the vector into the lower/upper subvectors.

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

8 years ago[msf] Resubmit "Rename Msf -> MSF".
Zachary Turner [Fri, 29 Jul 2016 20:56:36 +0000 (20:56 +0000)]
[msf] Resubmit "Rename Msf -> MSF".

Previously this change was submitted from a Windows machine, so
changes made to the case of filenames and directory names did
not survive the commit, and as a result the CMake source file
names and the on-disk file names did not match on case-sensitive
file systems.

I'm resubmitting this patch from a Linux system, which hopefully
allows the case changes to make it through unfettered.

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

8 years agoCodeGen: add new "intrinsic" MachineOperand kind.
Tim Northover [Fri, 29 Jul 2016 20:32:59 +0000 (20:32 +0000)]
CodeGen: add new "intrinsic" MachineOperand kind.

This will be used during GlobalISel, where we need a more robust and readable
way to write tests than a simple immediate ID.

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

8 years agoAdd a REQUIRES: assert on a Lanai test that uses a -debug-only flag
Eli Bendersky [Fri, 29 Jul 2016 19:35:22 +0000 (19:35 +0000)]
Add a REQUIRES: assert on a Lanai test that uses a -debug-only flag

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

8 years ago[LoopUnroll] Include hotness of region in opt remark
Adam Nemet [Fri, 29 Jul 2016 19:29:47 +0000 (19:29 +0000)]
[LoopUnroll] Include hotness of region in opt remark

LoopUnroll is a loop pass, so the analysis of OptimizationRemarkEmitter
is added to the common function analysis passes that loop passes
depend on.

The BFI and indirectly BPI used in this pass is computed lazily so no
overhead should be observed unless -pass-remarks-with-hotness is used.

This is how the patch affects the O3 pipeline:

         Dominator Tree Construction
         Natural Loop Information
         Canonicalize natural loops
         Loop-Closed SSA Form Pass
         Basic Alias Analysis (stateless AA impl)
         Function Alias Analysis Results
         Scalar Evolution Analysis
+        Lazy Branch Probability Analysis
+        Lazy Block Frequency Analysis
+        Optimization Remark Emitter
         Loop Pass Manager
           Rotate Loops
           Loop Invariant Code Motion
           Unswitch loops
         Simplify the CFG
         Dominator Tree Construction
         Basic Alias Analysis (stateless AA impl)
         Function Alias Analysis Results
         Combine redundant instructions
         Natural Loop Information
         Canonicalize natural loops
         Loop-Closed SSA Form Pass
         Scalar Evolution Analysis
+        Lazy Branch Probability Analysis
+        Lazy Block Frequency Analysis
+        Optimization Remark Emitter
         Loop Pass Manager
           Induction Variable Simplification
           Recognize loop idioms
           Delete dead loops
           Unroll loops
...

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

8 years ago[GlobalISel] Add missing link components to r277160 unittest. NFC.
Ahmed Bougacha [Fri, 29 Jul 2016 19:19:32 +0000 (19:19 +0000)]
[GlobalISel] Add missing link components to r277160 unittest. NFC.

It broke a shared builder:
  http://lab.llvm.org:8011/builders/llvm-mips-linux/builds/17320

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

8 years agoFixed line endings
Simon Pilgrim [Fri, 29 Jul 2016 18:58:57 +0000 (18:58 +0000)]
Fixed line endings

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

8 years agoFixed (incorrectly firing) MSVC unused variable warning
Simon Pilgrim [Fri, 29 Jul 2016 18:57:32 +0000 (18:57 +0000)]
Fixed (incorrectly firing) MSVC unused variable warning

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

8 years ago[ConstantFolding] Handle bitcasts of undef fp vector elements
David Majnemer [Fri, 29 Jul 2016 18:48:27 +0000 (18:48 +0000)]
[ConstantFolding] Handle bitcasts of undef fp vector elements

We used the wrong type for constructing a zero vector element which led
to type mismatches.

This fixes PR28771.

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

8 years agoRemove the test/tools/llvm-objdump/malformed-archives.test for
Kevin Enderby [Fri, 29 Jul 2016 18:46:24 +0000 (18:46 +0000)]
Remove the test/tools/llvm-objdump/malformed-archives.test for
now while I investagate the bot failures with this test.

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

8 years agoFixed MSVC out of range shift warning
Simon Pilgrim [Fri, 29 Jul 2016 18:43:59 +0000 (18:43 +0000)]
Fixed MSVC out of range shift warning

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

8 years agoRevert "[msf] Rename Msf to MSF."
Zachary Turner [Fri, 29 Jul 2016 18:38:47 +0000 (18:38 +0000)]
Revert "[msf] Rename Msf to MSF."

This reverts commit 4d1557ffac41e079bcb1abbcf04f512474dcd6fe.

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

8 years agoFixing broken MSVS builds
Piotr Padlewski [Fri, 29 Jul 2016 18:28:07 +0000 (18:28 +0000)]
Fixing broken MSVS builds

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

8 years ago[msf] Rename Msf to MSF.
Zachary Turner [Fri, 29 Jul 2016 18:24:26 +0000 (18:24 +0000)]
[msf] Rename Msf to MSF.

In a previous patch, it was suggested to use all caps instead of
rolling caps for initialisms, so this patch changes everything
to do this.

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

8 years agoRecommitting r275284: add support to inline __builtin_mempcpy
Andrew Kaylor [Fri, 29 Jul 2016 18:23:18 +0000 (18:23 +0000)]
Recommitting r275284: add support to inline __builtin_mempcpy

Patch by Sunita Marathe

Third try, now following fixes to MSan to handle mempcy in such a way that this commit won't break the MSan buildbots. (Thanks, Evegenii!)

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

8 years agoGlobalISel: make translate* functions take the most specialized class possible.
Tim Northover [Fri, 29 Jul 2016 18:11:21 +0000 (18:11 +0000)]
GlobalISel: make translate* functions take the most specialized class possible.

NFC.

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

8 years agoCodegen: MachineBlockPlacement Improve probability layout.
Kyle Butt [Fri, 29 Jul 2016 18:09:28 +0000 (18:09 +0000)]
Codegen: MachineBlockPlacement Improve probability layout.

The following pattern was being layed out poorly:

              A
             / \
            B   C
           / \ / \
          D   E   ? (Doesn't matter)

Where A->B is far more likely than A->C, and prob(B->D) = prob(B->E)

The current algorithm gives:
A,B,C,E (D goes on worklist)

It does this even if C has a frequency count of 0. This patch
adjusts the layout calculation so that if freq(B->E) >> freq(C->E)
then we go ahead and layout E rather than C. Fallthrough half the time
is better than fallthrough never, or fallthrough very rarely. The
resulting layout is:

A,B,E, (C and D are in a worklist)

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

8 years agoTests: Add branch weights to non-layout tests.
Kyle Butt [Fri, 29 Jul 2016 18:09:25 +0000 (18:09 +0000)]
Tests: Add branch weights to non-layout tests.

Add branch weights to a few tests that aren't testing layout to make them less
sensitive to changes in the layout algorithm.

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

8 years agoGlobalISel: add generic conditional branch.
Tim Northover [Fri, 29 Jul 2016 17:58:00 +0000 (17:58 +0000)]
GlobalISel: add generic conditional branch.

Just the basic equivalent to DAG's condbr for now, we'll get to things like
br_cc when we start doing more legalization.

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

8 years ago[Hexagon] Testcase for not merging stores into a misaligned store
Krzysztof Parzyszek [Fri, 29 Jul 2016 17:55:37 +0000 (17:55 +0000)]
[Hexagon] Testcase for not merging stores into a misaligned store

The DAG combiner will try to merge consecutive stores into a bigger
store, unless the resulting store is not fast. Misaligned vector stores
are allowed on Hexagon, but are not fast. Add a testcase to make sure
this type of merging does not occur.

Patch by Pranav Bhandarkar.

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

8 years agoRevert r277178, the actual change had already been applied
Krzysztof Parzyszek [Fri, 29 Jul 2016 17:50:47 +0000 (17:50 +0000)]
Revert r277178, the actual change had already been applied

Will submit another patch with the testcase only.

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

8 years ago[Hexagon] Misaligned loads and stores are not fast
Krzysztof Parzyszek [Fri, 29 Jul 2016 17:45:16 +0000 (17:45 +0000)]
[Hexagon] Misaligned loads and stores are not fast

The DAG combiner tries to merge stores to adjacent vector wide memory
locations by creating stores which are integral multiples of the vector
width. Discourage this by informing it that this is slow. This should
not affect legalization passes, because all of them ignore the "Fast"
argument.

Patch by Pranav Bhandarkar.

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

8 years agoThe next step along the way to getting good error messages for bad archives.
Kevin Enderby [Fri, 29 Jul 2016 17:44:13 +0000 (17:44 +0000)]
The next step along the way to getting good error messages for bad archives.

As mentioned in commit log for r276686 this next step is adding a new
method in the ArchiveMemberHeader class to get the full name that
does proper error checking, and can be use for error messages.

To do this the name of ArchiveMemberHeader::getName() is changed to
ArchiveMemberHeader::getRawName() to be consistent with
Archive::Child::getRawName().  Then the “new” method is the addition
of a new implementation of ArchiveMemberHeader::getName() which gets
the full name and provides proper error checking.  Which is mostly a rewrite
of what was Archive::Child::getName() and cleaning up incorrect uses of
llvm_unreachable() in the code which were actually just cases of errors
in the input Archives.

Then Archive::Child::getName() is changed to return Expected<> and use
the new implementation of ArchiveMemberHeader::getName() .

Also needed to change Archive::getMemoryBufferRef() with these
changes to return Expected<> as well to propagate Errors up.
As well as changing Archive::isThinMember() to return Expected<> .

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

8 years agoCodeGen: improve MachineInstrBuilder & MachineIRBuilder interface
Tim Northover [Fri, 29 Jul 2016 17:43:52 +0000 (17:43 +0000)]
CodeGen: improve MachineInstrBuilder & MachineIRBuilder interface

For MachineInstrBuilder, having to manually use RegState::Define is ugly and
makes register definitions clunkier than they need to be, so this adds two
convenience functions: addDef and addUse.

For MachineIRBuilder, we want to avoid BuildMI's first-reg-is-def rule because
it's hidden away and causes bugs. So this patch switches buildInstr to
returning a MachineInstrBuilder and adding *all* operands via addDef/addUse.

NFC.

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

8 years ago[AArch64][GlobalISel] Select G_XOR.
Ahmed Bougacha [Fri, 29 Jul 2016 16:56:25 +0000 (16:56 +0000)]
[AArch64][GlobalISel] Select G_XOR.

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

8 years ago[GlobalISel] Add G_XOR.
Ahmed Bougacha [Fri, 29 Jul 2016 16:56:20 +0000 (16:56 +0000)]
[GlobalISel] Add G_XOR.

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

8 years ago[AArch64][GlobalISel] Select G_LOAD/G_STORE.
Ahmed Bougacha [Fri, 29 Jul 2016 16:56:16 +0000 (16:56 +0000)]
[AArch64][GlobalISel] Select G_LOAD/G_STORE.

Mostly straightforward as we ignore addressing modes and just
use the base + unsigned immediate offset (always 0) variants.

This currently fails to select extloads because we have yet to
agree on a representation.

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

8 years ago[GlobalISel] Add LLT raw_ostream operator<< overload.
Ahmed Bougacha [Fri, 29 Jul 2016 16:56:12 +0000 (16:56 +0000)]
[GlobalISel] Add LLT raw_ostream operator<< overload.

Helpful when debugging; will be used in the following commit.

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

8 years agoMachinePipeliner pass that implements Swing Modulo Scheduling
Brendon Cahoon [Fri, 29 Jul 2016 16:44:44 +0000 (16:44 +0000)]
MachinePipeliner pass that implements Swing Modulo Scheduling

Software pipelining is an optimization for improving ILP by
overlapping loop iterations. Swing Modulo Scheduling (SMS) is
an implementation of software pipelining that attempts to
reduce register pressure and generate efficient pipelines with
a low compile-time cost.

This implementaion of SMS is a target-independent back-end pass.
When enabled, the pass should run just prior to the register
allocation pass, while the machine IR is in SSA form. If the pass
is successful, then the original loop is replaced by the optimized
loop. The optimized loop contains one or more prolog blocks, the
pipelined kernel, and one or more epilog blocks.

This pass is enabled for Hexagon only. To enable for other targets,
a couple of target specific hooks must be implemented, and the
pass needs to be called from the target's TargetMachine
implementation.

Differential Review: http://reviews.llvm.org/D16829

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

8 years ago[Hexagon] Custom lower VECTOR_SHUFFLE and EXTRACT_SUBVECTOR for HVX
Krzysztof Parzyszek [Fri, 29 Jul 2016 16:44:27 +0000 (16:44 +0000)]
[Hexagon] Custom lower VECTOR_SHUFFLE and EXTRACT_SUBVECTOR for HVX

If the mask of a vector shuffle has alternating odd or even numbers
starting with 1 or 0 respectively up to the largest possible index
for the given type in the given HVX mode (single of double) we can
generate vpacko or vpacke instruction respectively.

E.g.
  %42 = shufflevector <32 x i16> %37, <32 x i16> %41,
                      <32 x i32> <i32 1, i32 3, ..., i32 63>
  is %42.h = vpacko(%41.w, %37.w)

Patch by Pranav Bhandarkar.

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

8 years agoInitial support for vectorization using svml (short vector math library).
Matt Masten [Fri, 29 Jul 2016 16:42:44 +0000 (16:42 +0000)]
Initial support for vectorization using svml (short vector math library).

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

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

8 years ago[GlobalISel] Auto-brief LowLevelType. NFC.
Ahmed Bougacha [Fri, 29 Jul 2016 16:11:06 +0000 (16:11 +0000)]
[GlobalISel] Auto-brief LowLevelType. NFC.

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

8 years ago[GlobalISel] Add LLT::operator!=().
Ahmed Bougacha [Fri, 29 Jul 2016 16:11:04 +0000 (16:11 +0000)]
[GlobalISel] Add LLT::operator!=().

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

8 years ago[GlobalISel] Fix LLT::unsized to match LLT(LabelTy).
Ahmed Bougacha [Fri, 29 Jul 2016 16:11:02 +0000 (16:11 +0000)]
[GlobalISel] Fix LLT::unsized to match LLT(LabelTy).

When coming from an IR label type, we set a 0 NumElements, but not
when constructing an LLT using unsized(), causing comparisons to fail.

Pick one variant and fix the other.

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

8 years ago[GlobalISel] Add unittests for LowLevelType.
Ahmed Bougacha [Fri, 29 Jul 2016 16:10:57 +0000 (16:10 +0000)]
[GlobalISel] Add unittests for LowLevelType.

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

8 years agoReinstate optnone test for GVN Hoisting, removed in r276479.
Paul Robinson [Fri, 29 Jul 2016 16:05:50 +0000 (16:05 +0000)]
Reinstate optnone test for GVN Hoisting, removed in r276479.

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

8 years agoRemove inline-comment-2.ll until I can debug why it fails on some builds
Nirav Dave [Fri, 29 Jul 2016 15:24:06 +0000 (15:24 +0000)]
Remove inline-comment-2.ll until I can debug why it fails on some builds

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

8 years ago[Hexagon] Improve balancing of address calculation
Krzysztof Parzyszek [Fri, 29 Jul 2016 15:15:35 +0000 (15:15 +0000)]
[Hexagon] Improve balancing of address calculation

Rebalances address calculation trees and applies Hexagon-specific
optimizations to the trees to improve instruction selection.

Patch by Tobias Edler von Koch.

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

8 years agoFix inline-comment-2.ll triple
Nirav Dave [Fri, 29 Jul 2016 15:12:00 +0000 (15:12 +0000)]
Fix inline-comment-2.ll triple

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

8 years agoAvoid unnecessary 32-bit to 64-bit zero extensions following
David L Kreitzer [Fri, 29 Jul 2016 15:09:54 +0000 (15:09 +0000)]
Avoid unnecessary 32-bit to 64-bit zero extensions following
32-bit CMOV instructions on x86_64. The 32-bit CMOV implicitly
zero extends.

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

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

8 years ago[MC] When emitting output hash comments always use standard line comment seperator
Nirav Dave [Fri, 29 Jul 2016 14:42:00 +0000 (14:42 +0000)]
[MC] When emitting output hash comments always use standard line comment seperator

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

8 years agoFix license information in the file header
Krzysztof Parzyszek [Fri, 29 Jul 2016 14:04:17 +0000 (14:04 +0000)]
Fix license information in the file header

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

8 years agoAdd missing files to r277143
Krzysztof Parzyszek [Fri, 29 Jul 2016 13:59:55 +0000 (13:59 +0000)]
Add missing files to r277143

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

8 years ago[Hexagon] Implement DFA based hazard recognizer
Krzysztof Parzyszek [Fri, 29 Jul 2016 13:59:09 +0000 (13:59 +0000)]
[Hexagon] Implement DFA based hazard recognizer

The post register allocator scheduler can generate poor schedules
because the scoreboard hazard recognizer is unable to identify
hazards for Hexagon precisely. Instead, Hexagon should use a DFA
based hazard recognizer.

Patch by Brendon Cahoon.

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

8 years agoRe-commit: [mips][fastisel] Handle 0-4 arguments without SelectionDAG.
Daniel Sanders [Fri, 29 Jul 2016 12:27:28 +0000 (12:27 +0000)]
Re-commit: [mips][fastisel] Handle 0-4 arguments without SelectionDAG.

Summary:
Implements fastLowerArguments() to avoid the need to fall back on
SelectionDAG for 0-4 argument functions that don't do tricky things like
passing double in a pair of i32's.

This allows us to move all except one test to -fast-isel-abort=3. The
remaining one has function prototypes of the form 'i32 (i32, double, double)'
which requires floats to be passed in GPR's.

The previous commit had an uninitialized variable that caused the incoming
argument region to have undefined size. This has been fixed.

Reviewers: sdardis

Subscribers: dsanders, llvm-commits, sdardis

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

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

8 years agoCleanup TransferDbgValues
Nirav Dave [Fri, 29 Jul 2016 11:49:32 +0000 (11:49 +0000)]
Cleanup TransferDbgValues

[DAG] Check debug values for invalidation before transferring and mark
old debug values invalid when transferring to another SDValue.

This fixes PR28613.

Reviewers: jyknight, hans, dblaikie, echristo

Subscribers: yaron.keren, ismail, llvm-commits

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

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

8 years ago[X86][SSE] Optimize the truncation of vector comparison results with PACKSS
Simon Pilgrim [Fri, 29 Jul 2016 10:23:10 +0000 (10:23 +0000)]
[X86][SSE] Optimize the truncation of vector comparison results with PACKSS

We currently default to using either generic shuffles or MASK+PACKUS/PACKSS to truncate all integer vectors. For vector comparisons, we know that the result will be either all or zero bits in every element, which can be efficiently truncated by directly using PACKSS to repeatedly halve the size of each element.

Due to the limited input values (-1 or 0) we don't need to account for vector element size, so for simplicity we just use the PACKSS(vXi16,vXi16) implementation in all cases. Additionally for AVX2 PACKSS of 256bit data we must perform a PERMQ shuffle to reorder the data into the correct order. I did investigate performing a single shuffle after all the PACKSS calls but the need to cross 128bit lanes makes this difficult to achieve efficiently.

We avoid performing this on AVX512 as it should have better alternative truncation instructions.

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

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

8 years agoFixed MSVC out of range shift warning
Simon Pilgrim [Fri, 29 Jul 2016 10:03:39 +0000 (10:03 +0000)]
Fixed MSVC out of range shift warning

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

8 years agoFix for commit rL277126 that broke a build.
Sjoerd Meijer [Fri, 29 Jul 2016 09:57:37 +0000 (09:57 +0000)]
Fix for commit rL277126 that broke a build.

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

8 years ago[Thumb] Emit Thumb move in both Thumb modes for struct_byval predicates
Prakhar Bahuguna [Fri, 29 Jul 2016 09:16:46 +0000 (09:16 +0000)]
[Thumb] Emit Thumb move in both Thumb modes for struct_byval predicates

Summary:
The MOV/MOVT instructions being chosen for struct_byval predicates was
conditional only on Thumb2, resulting in an ARM MOV/MOVT instruction
being incorrectly emitted in Thumb1 mode. This is especially apparent
with v8-m.base targets. This patch ensures that Thumb instructions are
emitted in both Thumb modes.

Reviewers: rengolin, t.p.northover

Subscribers: llvm-commits, aemerson, rengolin

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

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

8 years ago[lanai] Update for Target API (TargetRegistry::RegisterMCAsmBackend) change
Jacques Pienaar [Fri, 29 Jul 2016 08:50:23 +0000 (08:50 +0000)]
[lanai] Update for Target API (TargetRegistry::RegisterMCAsmBackend) change

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

8 years agoTargetInstrInfo: add virtual function getInstSizeInBytes
Sjoerd Meijer [Fri, 29 Jul 2016 08:16:16 +0000 (08:16 +0000)]
TargetInstrInfo: add virtual function getInstSizeInBytes

This adds a target hook getInstSizeInBytes to TargetInstrInfo that a lot of
subclasses already implement.

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

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

8 years ago[AVX512] Mark EVEX VMOVSSrm and VMOVSDrm as canFoldAsLoad and isReMaterializable.
Craig Topper [Fri, 29 Jul 2016 06:06:04 +0000 (06:06 +0000)]
[AVX512] Mark EVEX VMOVSSrm and VMOVSDrm as canFoldAsLoad and isReMaterializable.

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

8 years ago[AVX512] Copy the patterns that recognize scalar arimetic operations inserting into...
Craig Topper [Fri, 29 Jul 2016 06:06:00 +0000 (06:06 +0000)]
[AVX512] Copy the patterns that recognize scalar arimetic operations inserting into the lower element of a packed vector from AVX/SSE so that we can use EVEX encoded instructions.

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

8 years ago[AVX512] Add AVX512 run lines to some tests for scalar fma/add/sub/mul/div and regene...
Craig Topper [Fri, 29 Jul 2016 06:05:58 +0000 (06:05 +0000)]
[AVX512] Add AVX512 run lines to some tests for scalar fma/add/sub/mul/div and regenerate. Follow up commits will bring AVX512 code up to the same quality as AVX/SSE.

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

8 years ago[EarlyCSE] Correctly handle simplified, but live, instructions
David Majnemer [Fri, 29 Jul 2016 05:39:21 +0000 (05:39 +0000)]
[EarlyCSE] Correctly handle simplified, but live, instructions

Some instructions may have their uses replaced with a symbolic constant.
However, the instruction may still have side effects which percludes it
from being removed from the function.  EarlyCSE treated such an
instruction as if it were removed, resulting in PR28763.

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

8 years ago[ConstantFolding] Fold bitcasts of vectors w/ undef elements
David Majnemer [Fri, 29 Jul 2016 04:06:09 +0000 (04:06 +0000)]
[ConstantFolding] Fold bitcasts of vectors w/ undef elements

An undef vector element can be treated as if it had any value.  Folding
such a vector element to 0 in a bitcast can open up further folding
opportunities.

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

8 years ago[ConstantFolding] Remove an unused ConstantFoldInstOperands overload
David Majnemer [Fri, 29 Jul 2016 03:27:33 +0000 (03:27 +0000)]
[ConstantFolding] Remove an unused ConstantFoldInstOperands overload

No functional change is intended.

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

8 years ago[ConstantFolding] Use ConstantExpr::getWithOperands
David Majnemer [Fri, 29 Jul 2016 03:27:31 +0000 (03:27 +0000)]
[ConstantFolding] Use ConstantExpr::getWithOperands

ConstantExpr::getWithOperands does much of the hard work that
ConstantFoldInstOperandsImpl tries to do but more completely.

This lets us fold ExtractValue/InsertValue expressions.

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

8 years ago[ConstnatFolding] Teach the folder how to fold ConstantVector
David Majnemer [Fri, 29 Jul 2016 03:27:26 +0000 (03:27 +0000)]
[ConstnatFolding] Teach the folder how to fold ConstantVector

A ConstantVector can have ConstantExpr operands and vice versa.
However, the folder had no ability to fold ConstantVectors which, in
some cases, was an optimization barrier.

Instead, rephrase the folder in terms of Constants instead of
ConstantExprs and teach callers how to deal with failure.

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

8 years ago[AVX512] Remove the intrinsic forms of VMOVSS/VMOVSD. We don't need two different...
Craig Topper [Fri, 29 Jul 2016 02:49:08 +0000 (02:49 +0000)]
[AVX512] Remove the intrinsic forms of VMOVSS/VMOVSD. We don't need two different forms of 'rr' and 'rm'. This matches SSE/AVX.

I'm not convinced the patterns for the rm_Int was correct anyway. It had a tied source that should't exist for the unmasked version. The load form of MOVSS always zeros the most significant bits. I've left the patterns off the masked load instructions as I'm not sure what the correct pattern should be and we don't have any tests currently. Nor do we implement masked scalar load intrinsics in clang currently.

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

8 years ago[CFLAA] Check for pointer types in more places.
George Burgess IV [Fri, 29 Jul 2016 01:23:45 +0000 (01:23 +0000)]
[CFLAA] Check for pointer types in more places.

This patch fixes an assertion that fires when we try to add non-pointer
Values to the CFLGraph. Centralizing the check for whether something
is/isn't a pointer type isn't completely trivial (and, in some cases,
would end up being entirely redundant), but it may be beneficial to do
so if this trips us up more in the future.

Patch by Jia Chen.

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

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

8 years agoAdd LLVM_ENABLE_LLD option to use LLD as C/C++ linker.
Eugene Zelenko [Fri, 29 Jul 2016 00:46:13 +0000 (00:46 +0000)]
Add LLVM_ENABLE_LLD option to use LLD as C/C++ linker.

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

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

8 years agoCapture stderr when checking for gold version
Teresa Johnson [Fri, 29 Jul 2016 00:39:56 +0000 (00:39 +0000)]
Capture stderr when checking for gold version

On MacOS the ld version is emitted to stderr, resulting in lots of
messages in the ninja check output.

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

8 years agoFixed comment
Piotr Padlewski [Fri, 29 Jul 2016 00:30:07 +0000 (00:30 +0000)]
Fixed comment

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

8 years agoAdded ThinLTO inlining statistics
Piotr Padlewski [Fri, 29 Jul 2016 00:27:16 +0000 (00:27 +0000)]
Added ThinLTO inlining statistics

Summary:
copypasta doc of ImportedFunctionsInliningStatistics class
 \brief Calculate and dump ThinLTO specific inliner stats.
 The main statistics are:
 (1) Number of inlined imported functions,
 (2) Number of imported functions inlined into importing module (indirect),
 (3) Number of non imported functions inlined into importing module
 (indirect).
 The difference between first and the second is that first stat counts
 all performed inlines on imported functions, but the second one only the
 functions that have been eventually inlined to a function in the importing
 module (by a chain of inlines). Because llvm uses bottom-up inliner, it is
 possible to e.g. import function `A`, `B` and then inline `B` to `A`,
 and after this `A` might be too big to be inlined into some other function
 that calls it. It calculates this statistic by building graph, where
 the nodes are functions, and edges are performed inlines and then by marking
 the edges starting from not imported function.

 If `Verbose` is set to true, then it also dumps statistics
 per each inlined function, sorted by the greatest inlines count like
 - number of performed inlines
 - number of performed inlines to importing module

Reviewers: eraman, tejohnson, mehdi_amini

Subscribers: mehdi_amini, llvm-commits

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

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

8 years agoRevert "Don't invoke getName() from Function::isIntrinsic().", rL276942.
Justin Lebar [Thu, 28 Jul 2016 23:58:15 +0000 (23:58 +0000)]
Revert "Don't invoke getName() from Function::isIntrinsic().", rL276942.

This broke some out-of-tree AMDGPU tests that relied on the old behavior
wherein isIntrinsic() would return true for any function that starts
with "llvm.".  And in general that change will not play nicely with
out-of-tree backends.

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

8 years ago[sanitizer] Simplify and future-proof maybeMarkSanitizerLibraryCallNoBuiltin().
Evgeniy Stepanov [Thu, 28 Jul 2016 23:45:15 +0000 (23:45 +0000)]
[sanitizer] Simplify and future-proof maybeMarkSanitizerLibraryCallNoBuiltin().

Sanitizers set nobuiltin attribute on certain library functions to
avoid a situation where such function is neither instrumented nor
intercepted.

At the moment the list of interesting functions is hardcoded. This
change replaces it with logic based on
TargetLibraryInfo::hasOptimizedCodegen and the presense of readnone
function attribute (sanitizers are generally interested in memory
behavior of library functions).

This is expected to be a no-op change: the new logic matches exactly
the same set of functions.

r276771 (currently reverted) added mempcpy() to the list, breaking
MSan tests. With this change, r276771 can be safely re-landed.

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

8 years ago[IR] Introduce a non-integral pointer type
Sanjoy Das [Thu, 28 Jul 2016 23:43:38 +0000 (23:43 +0000)]
[IR] Introduce a non-integral pointer type

Summary:
This change adds a `ni` specifier in the `datalayout` string to denote
pointers in some given address spaces as "non-integral", and adds some
typing rules around these special pointers.

Reviewers: majnemer, chandlerc, atrick, dberlin, eli.friedman, tstellarAMD, arsenm

Subscribers: arsenm, mcrosier, llvm-commits

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

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

8 years ago[BPI] Add new LazyBPI analysis
Adam Nemet [Thu, 28 Jul 2016 23:31:12 +0000 (23:31 +0000)]
[BPI] Add new LazyBPI analysis

Summary:
The motivation is the same as in D22141: In order to add the hotness
attribute to optimization remarks we need BFI to be available in all
passes that emit optimization remarks.  BFI depends on BPI so unless we
make this lazy as well we would still compute BPI unconditionally.

The solution is to use the new LazyBPI pass in LazyBFI and only compute
BPI when computation of BFI is requested by the client.

I extended the laziness test using a LoopDistribute test to also cover
BPI.

Reviewers: hfinkel, davidxl

Subscribers: llvm-commits

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

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

8 years agoAMDGPU/SI: Don't handle a loop if there is no loop at all for a terminator BB.
Changpeng Fang [Thu, 28 Jul 2016 23:01:45 +0000 (23:01 +0000)]
AMDGPU/SI: Don't handle a loop if there is no loop at all for a terminator BB.

Differential Revision: http://reviews.llvm.org/D22021

Reviewed by: arsenm

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

8 years agoDo not remove empty lifetime.start/lifetime.end ranges
Vitaly Buka [Thu, 28 Jul 2016 22:59:03 +0000 (22:59 +0000)]
Do not remove empty lifetime.start/lifetime.end ranges

Summary:
Asan stack-use-after-scope check should poison alloca even if there is
no access between start and end.

This is possible for code like this:
for (int i = 0; i < 3; i++) {
  int x;
  p = &x;
}

"Loop Invariant Code Motion" will move "p = &x;" out of the loop, making
start/end range empty.

PR27453

Reviewers: eugenis

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

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

8 years agoShould be committed as one CL.
Vitaly Buka [Thu, 28 Jul 2016 22:59:01 +0000 (22:59 +0000)]
Should be committed as one CL.

This reverts commits r277068 r277067 r277066.

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

8 years ago[asan] Add const into few methods
Vitaly Buka [Thu, 28 Jul 2016 22:50:50 +0000 (22:50 +0000)]
[asan] Add const into few methods

Summary: No functional changes

Reviewers: eugenis

Subscribers: llvm-commits

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

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

8 years agoDo not remove empty lifetime.start/lifetime.end ranges
Vitaly Buka [Thu, 28 Jul 2016 22:50:48 +0000 (22:50 +0000)]
Do not remove empty lifetime.start/lifetime.end ranges

Summary:
Asan stack-use-after-scope check should poison alloca even if there is
no access between start and end.

This is possible for code like this:
for (int i = 0; i < 3; i++) {
  int x;
  p = &x;
}

"Loop Invariant Code Motion" will move "p = &x;" out of the loop, making
start/end range empty.

PR27453

Reviewers: eugenis

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

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

8 years agomaned
Vitaly Buka [Thu, 28 Jul 2016 22:50:45 +0000 (22:50 +0000)]
maned

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

8 years agorange
Vitaly Buka [Thu, 28 Jul 2016 22:50:43 +0000 (22:50 +0000)]
range

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

8 years agoRework CFG simplification in bugpoint
Daniel Berlin [Thu, 28 Jul 2016 22:29:25 +0000 (22:29 +0000)]
Rework CFG simplification in bugpoint

Summary:
Depends on D22841

We now use a much simpler CFG simplification routine for bugpoint,
because SimplifyCFG is no longer a good match for what bugpoint wants
to do.

At the same time, to make sure we don't lose anything valuable it was doing,
SimplifyCFG is now run as a per-BB reduction pass.

With this and D22841 combined, bugpoint operates both much faster on
the large testcases i have, and reduces them to pretty much minimal
testcases (in one case, bugpoint used to leave about 6000 useless blocks, and
now it leaves 3 ...)

Reviewers: chandlerc, majnemer

Subscribers: llvm-commits

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

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

8 years ago[PM] Port LowerGuardIntrinsic to the new PM.
Michael Kuperstein [Thu, 28 Jul 2016 22:08:41 +0000 (22:08 +0000)]
[PM] Port LowerGuardIntrinsic to the new PM.

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

8 years agoFix some sign compare warnings breaking the -Werror build
David Blaikie [Thu, 28 Jul 2016 21:42:12 +0000 (21:42 +0000)]
Fix some sign compare warnings breaking the -Werror build

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

8 years agoRevert r277038 until clearing why tests fail.
Alina Sbirlea [Thu, 28 Jul 2016 21:35:20 +0000 (21:35 +0000)]
Revert r277038 until clearing why tests fail.

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

8 years agoRemove TargetBaseAlign. Keep alignment for stack adjustments.
Alina Sbirlea [Thu, 28 Jul 2016 21:26:40 +0000 (21:26 +0000)]
Remove TargetBaseAlign. Keep alignment for stack adjustments.

Summary:
TargetBaseAlign is no longer required since LSV checks if target allows misaligned accesses.
A constant defining a base alignment is still needed for stack accesses where alignment can be adjusted.

Reviewers: llvm-commits, jlebar

Subscribers: mzolotukhin, arsenm

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

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