135926 Commits

Author SHA1 Message Date
Ahmed Bougacha
8ad8fd6e93 [GlobalISel] Auto-brief LowLevelType. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277163 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 16:11:06 +00:00
Ahmed Bougacha
eda1b46b87 [GlobalISel] Add LLT::operator!=().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277162 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 16:11:04 +00:00
Ahmed Bougacha
ade60aa452 [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
2016-07-29 16:11:02 +00:00
Ahmed Bougacha
1147bf697d [GlobalISel] Add unittests for LowLevelType.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277160 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 16:10:57 +00:00
Paul Robinson
f6b677f6bf 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
2016-07-29 16:05:50 +00:00
Nirav Dave
a517bf8e06 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
2016-07-29 15:24:06 +00:00
Krzysztof Parzyszek
1f44345f2c [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
2016-07-29 15:15:35 +00:00
Nirav Dave
2710958a68 Fix inline-comment-2.ll triple
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277149 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 15:12:00 +00:00
David L Kreitzer
af3f28bc66 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
2016-07-29 15:09:54 +00:00
Nirav Dave
9167c0e6d7 [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
2016-07-29 14:42:00 +00:00
Krzysztof Parzyszek
ee2728bb0c Fix license information in the file header
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277145 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 14:04:17 +00:00
Krzysztof Parzyszek
6b032c682c Add missing files to r277143
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277144 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 13:59:55 +00:00
Krzysztof Parzyszek
4f328be3df [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
2016-07-29 13:59:09 +00:00
Daniel Sanders
e2a16fdce2 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
2016-07-29 12:27:28 +00:00
Nirav Dave
5b7959028f 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
2016-07-29 11:49:32 +00:00
Simon Pilgrim
e6abaac391 [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
2016-07-29 10:23:10 +00:00
Simon Pilgrim
bf172ec934 Fixed MSVC out of range shift warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277130 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 10:03:39 +00:00
Sjoerd Meijer
7d72920df2 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
2016-07-29 09:57:37 +00:00
Prakhar Bahuguna
322f342e82 [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
2016-07-29 09:16:46 +00:00
Jacques Pienaar
3b7839bf54 [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
2016-07-29 08:50:23 +00:00
Sjoerd Meijer
c46479857e 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
2016-07-29 08:16:16 +00:00
Craig Topper
f7938da3bf [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
2016-07-29 06:06:04 +00:00
Craig Topper
8e82677ab6 [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
2016-07-29 06:06:00 +00:00
Craig Topper
9e64e8e98b [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
2016-07-29 06:05:58 +00:00
David Majnemer
b9ddc3df47 [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
2016-07-29 05:39:21 +00:00
David Majnemer
b9bd76d554 [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
2016-07-29 04:06:09 +00:00
David Majnemer
6b87ada911 [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
2016-07-29 03:27:33 +00:00
David Majnemer
8065d776a0 [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
2016-07-29 03:27:31 +00:00
David Majnemer
e43ff14879 [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
2016-07-29 03:27:26 +00:00
Craig Topper
c6c1814d38 [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
2016-07-29 02:49:08 +00:00
George Burgess IV
450453a6c0 [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
2016-07-29 01:23:45 +00:00
Eugene Zelenko
ec9f7e3ac3 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
2016-07-29 00:46:13 +00:00
Teresa Johnson
88a5c80f55 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
2016-07-29 00:39:56 +00:00
Piotr Padlewski
81266f65aa Fixed comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277091 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 00:30:07 +00:00
Piotr Padlewski
d7e3771d59 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
2016-07-29 00:27:16 +00:00
Justin Lebar
24dbd38b83 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
2016-07-28 23:58:15 +00:00
Evgeniy Stepanov
b57cbbd54d [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
2016-07-28 23:45:15 +00:00
Sanjoy Das
1c20b71db8 [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
2016-07-28 23:43:38 +00:00
Adam Nemet
b17a45cae0 [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
2016-07-28 23:31:12 +00:00
Changpeng Fang
539fec5dc2 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
2016-07-28 23:01:45 +00:00
Vitaly Buka
2328afe0b5 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
2016-07-28 22:59:03 +00:00
Vitaly Buka
3ec908dfba 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
2016-07-28 22:59:01 +00:00
Vitaly Buka
34ad8f0f0b [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
2016-07-28 22:50:50 +00:00
Vitaly Buka
bbc7125e70 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
2016-07-28 22:50:48 +00:00
Vitaly Buka
1e88bcadc3 maned
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277067 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-28 22:50:45 +00:00
Vitaly Buka
e0d8738c93 range
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277066 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-28 22:50:43 +00:00
Daniel Berlin
ad0220cb9b 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
2016-07-28 22:29:25 +00:00
Michael Kuperstein
093715aad1 [PM] Port LowerGuardIntrinsic to the new PM.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277057 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-28 22:08:41 +00:00
David Blaikie
912dfc3998 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
2016-07-28 21:42:12 +00:00
Alina Sbirlea
1ba8ec6d05 Revert r277038 until clearing why tests fail.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277039 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-28 21:35:20 +00:00