Commit Graph

123172 Commits

Author SHA1 Message Date
Peter Collingbourne
7da5357aca ARM/ELF: Better codegen for global variable addresses.
In PIC mode we were previously computing global variable addresses (or GOT
entry addresses) by adding the PC, the PC-relative GOT displacement and
the GOT-relative symbol/GOT entry displacement. Because the latter two
displacements are fixed, we ended up performing one more addition than
necessary.

This change causes us to compute addresses using a single PC-relative
displacement, resulting in a shorter code sequence. This reduces code size
by about 4% in a recent build of Chromium for Android.

As a result of this change we no longer need to compute the GOT base address
in the ARM backend, which allows us to remove the Global Base Reg pass and
SDAG lowering for the GOT.

We also now no longer use the GOT when addressing a symbol which is known
to be defined in the same linkage unit. Specifically, the symbol must have
either hidden visibility or a strong definition in the current module in
order to not use the the GOT.

This is a change from the previous behaviour where we would use the GOT to
address externally visible symbols defined in the same module. I think the
only cases where this could matter are cases involving symbol interposition,
but we don't really support that well anyway.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251322 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-26 18:23:16 +00:00
Diego Novillo
d51ca816b5 Cleanup test case debug info. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251320 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-26 18:14:44 +00:00
Alexey Samsonov
0d3cc554fe Refactor: Simplify boolean conditional return statements in lib/Transforms/Instrumentation
Summary: Use clang-tidy to simplify boolean conditional return statements.

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

Patch by Richard (legalize@xmission.com)!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251318 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-26 18:06:40 +00:00
Cong Hou
2d382f246b Check the case that the numerator and denominator are both zeros when getting edge probabilities in BPI and return 100% in this case.
This issue is triggered in PGO mode when bootstrapping LLVM. It seems that it is not guaranteed that edge weights are always greater than zero which are read from profile data.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251317 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-26 18:00:17 +00:00
Alexey Samsonov
0cd635f750 Move parts of llvm-symbolizer tool into LLVMSymbolize library.
Summary: See http://lists.llvm.org/pipermail/llvm-dev/2015-October/091624.html

Reviewers: echristo

Subscribers: llvm-commits, aizatsky

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251316 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-26 17:56:12 +00:00
Jonas Paulsson
98a8bb4c52 [SystemZ] LTGFR use regclass should be GR32, not GR64.
Discovered by testing int-cmp-44.ll with -verify-machineinstrs (added to
test run).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251299 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-26 15:03:49 +00:00
Jonas Paulsson
955fcc6b5e [SystemZ] Also clear kill flag for index reg in splitMove().
Discovered by running fp-move-05.ll with -verify-machineinstrs (added
to test case run).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251298 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-26 15:03:41 +00:00
Jonas Paulsson
599024dc12 [SystemZ] Don't forget the CC def op on LTEBRCompare pseudos
Discovered by running fp-cmp-02.ll with -verify-machineinstrs (now added
to test run).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251297 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-26 15:03:32 +00:00
Jonas Paulsson
436e7ea464 [SystemZ] Tie operands in SystemZShorteInst if MI becomes 2-address.
Discovered by testing fp-add-02.ll with -verify-machineinstrs.

Test case updated to always run with -verify-machineinstrs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251296 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-26 15:03:07 +00:00
Vasileios Kalintiris
2df12188c5 [mips] Check for the correct error message in tests for interrupt attributes.
Instead of XFAIL-ing the tests with the wrong usage of the "interrupt"
attribute, we should check that we emit the correct error messages to
the user.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251295 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-26 14:24:30 +00:00
James Molloy
bf7b3fed5c [ValueTracking] Extend r251146 to catch a fairly common case
Even though we may not know the value of the shifter operand, it's possible we know the shifter operand is non-zero. This can allow us to infer more known bits - for example:

  %1 = load %p !range {1, 5}
  %2 = shl %q, %1

We don't know %1, but we do know that it is nonzero so %2[0] is known zero, and importantly %2 is known non-zero.

Calling isKnownNonZero is nontrivially expensive so use an Optional to run it lazily and cache its result.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251294 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-26 14:10:46 +00:00
Silviu Baranga
bd8522817d [SCEV] Fix issues found during the review of r251283. NFC.
Summary:
Replace (const SCEVAddRecExpr *) with cast<SCEVAddRecExpr>.

Rename SCEVApplyRewriter to SCEVLoopAddRecRewriter (which is a more
appropriate name) since the description is "takes a scalar evolution
expression and applies the Map (Loop -> SCEV) to all AddRecExprs."

Subscribers: llvm-commits, sanjoy

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251292 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-26 13:50:06 +00:00
Elena Demikhovsky
df91a787c0 Loop Vectorizer - skipping "bitcast" before GEP
Vectorization of memory instruction (Load/Store) is possible when the pointer is coming from GEP. The GEP analysis allows to estimate the profit.
In some cases we have a "bitcast" between GEP and memory instruction.
I added code that skips the "bitcast".

http://reviews.llvm.org/D13886



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251291 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-26 13:42:41 +00:00
Tim Northover
3d79a7932c Tests: be slightly more specific to avoid conflict with path.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251290 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-26 13:40:03 +00:00
Igor Breger
5f131f7a37 fix test errors (on windows) for commit r251287
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251288 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-26 13:31:41 +00:00
Igor Breger
e9ad33d22d AVX512: Enabled VPBROADCASTB lowering for v64i8 vectors.
Differential Revision: http://reviews.llvm.org/D13896

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251287 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-26 13:01:02 +00:00
Vasileios Kalintiris
9f2026ed3f [mips] Interrupt attribute support for mips32r2+.
Summary:
This patch adds support for using the "interrupt" attribute on Mips
for interrupt handling functions. At this time only mips32r2+ with the
o32 ABI with the static relocation model is supported. Unsupported
configurations will be rejected

Patch by Simon Dardis (+ clang-format & some trivial changes to follow the
LLVM coding standards by me).

Reviewers: mpf, dsanders

Subscribers: dsanders, vkalintiris, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251286 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-26 12:38:43 +00:00
Igor Breger
40b928c9fe AVX-512: Use correct extract vector length.
Bug https://llvm.org/bugs/show_bug.cgi?id=25318

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251285 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-26 12:26:34 +00:00
Silviu Baranga
e1ed72f459 [SCEV] Factor out common visiting patterns for SCEV rewriters. NFC.
Summary:
Add a SCEVRewriteVisitor class which contains the common
visiting patterns used when rewriting SCEVs.

SCEVParameterRewriter and SCEVApplyRewriter now inherit
from SCEVRewriteVisitor (and are therefore much simpler).

Reviewers: anemet, mzolotukhin, sanjoy

Subscribers: rengolin, llvm-commits, sanjoy

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251283 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-26 11:18:31 +00:00
Silviu Baranga
ebacf44320 [InstCombine] Teach instcombine not to create extra PHI nodes when folding GEPs
Summary:
InstCombine tries to transform GEP(PHI(GEP1, GEP2, ..)) into GEP(GEP(PHI(...))
when possible. However, this may leave the old PHI node around. Even if we
do end up folding the GEPs, having an extra PHI node might not be beneficial.

This change makes the transformation more conservative. We now only do this if
the PHI has only one use, and can therefore be removed after the transformation.

Reviewers: jmolloy, majnemer

Subscribers: mcrosier, mssimpso, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251281 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-26 10:25:05 +00:00
James Molloy
82ace96a30 [ARM] Handle the inline asm constraint type 'o'
This means "memory with offset" and requires very little plumbing to get working. This fixes PR25317.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251280 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-26 10:04:52 +00:00
Benjamin Kramer
6f975c928c Drop code after unreachable. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251278 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-26 09:55:45 +00:00
Igor Breger
31a3f5f4a1 AVX512: Add AVX-512 not materializable instructions.
Otherwise value can be reused , despite its value could be changed - produces incorrect assembler.

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

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251275 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-26 08:37:12 +00:00
Lang Hames
540bea1f52 [Orc] Add license header to OrcTargetSupport.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251274 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-26 06:40:28 +00:00
Lang Hames
88b1f94ab5 [Orc] In the CompileOnDemand layer, wrap module ownership in order to preserve
the module pointer type passed in by the user.

The previous ownership scheme, where the user pointer was always moved into a
std::shared_ptr, breaks if the user passes in a raw pointer.

Discovered while working on the Orc C API, which should be landing shortly.
I expect to include a test-case with that.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251273 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-26 06:37:04 +00:00
David Majnemer
c08caf7413 Update test to take into account for r251271.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251272 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-26 03:34:29 +00:00
David Majnemer
434302d503 [MC] Add support for GNU as-compatible binary operator precedence
GNU as and Darwin give the various binary operators different
precedence.  LLVM's MC supported the Darwin semantics but not the GNU
semantics.

This fixes PR25311.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251271 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-26 03:15:34 +00:00
David Majnemer
7e2b51ddb0 [MC] Don't crash when .word is given bogus values
We didn't validate that the .word directive was given a sane value,
leading to crashes when we attempt to write out the object file.

Instead, perform some validation and issue a diagnostic pointing at the
start of the diagnostic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251270 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-26 02:45:50 +00:00
Tobias Grosser
aaf72bc7c6 RegionInfo: Correctly expand regions
Instead of playing around with dominance to verify if the possible expansion of
a scop region is indeed a single entry single exit region, we now distinguish
two cases. In case we only append a basic block, all edges entering this basic
block need to have come from within the region that is expanded. In case we join
two regions, the source basic blocks of the edges that end at the entry node of
the region that is appended most be part of either the original region or the
region that is appended.

This change will be tested through Polly.

This fixes llvm.org/PR25242

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251267 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-25 22:55:59 +00:00
Benjamin Kramer
165b4f4e46 Convert assert(false) into llvm_unreachable where it makes sense.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251266 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-25 22:28:27 +00:00
Simon Pilgrim
28c3d642ad [X86][AVX] Regenerate tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251263 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-25 21:47:09 +00:00
Saleem Abdulrasool
e368f9477a docs: document x mangling in LangRef
Windows has two different mangling specifiers.  `x` is used on x86 for the `_`
UserLabelPrefix.  Others use `w` for the no UserLabelPrefix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251260 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-25 20:39:35 +00:00
Davide Italiano
d4e4715f54 [ScalarEvolution] Throw away dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251256 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-25 20:00:49 +00:00
Davide Italiano
94c5c1d096 [ScalarEvolution] Get rid of NDEBUG in header (correctly this time).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251255 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-25 19:55:24 +00:00
Sanjoy Das
dd4f44833e [LCSSA] Unbreak build, don't reuse L; NFC
The build broke in r251248.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251251 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-25 19:27:17 +00:00
Davide Italiano
33624191af [ScalarEvolution] Get rid of NDEBUG in header.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251249 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-25 19:13:36 +00:00
Sanjoy Das
f04aae61fa [LCSSA] Use range for loops; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251248 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-25 19:08:32 +00:00
Simon Pilgrim
49cf761925 [X86][SSE4A] Fix for EXTRQI shuffle lowering.
Incorrect range test - found during fuzz testing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251245 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-25 17:40:54 +00:00
Simon Pilgrim
1415da8392 [X86][SSE] Refreshed tests (missing AVX512 patterns)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251238 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-25 15:39:22 +00:00
Elena Demikhovsky
16ed8780c7 Scalarizer for masked.gather and masked.scatter intrinsics.
When the target does not support these intrinsics they should be converted to a chain of scalar load or store operations.
If the mask is not constant, the scalarizer will build a chain of conditional basic blocks.
I added isLegalMaskedGather() isLegalMaskedScatter() APIs.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251237 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-25 15:37:55 +00:00
Simon Pilgrim
aa2b60f016 [X86][SSE] Added tests for shuffling through bitcasts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251236 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-25 15:32:04 +00:00
Simon Pilgrim
fc0eed896e [X86][SSE] vector sext/zext tests - remove unnecessary mcpu arguments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251233 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-25 12:15:00 +00:00
Simon Pilgrim
696e2f7d49 [X86][SSE] shift/rotate tests - remove unnecessary mcpu arguments and regenerate/cleanup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251232 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-25 12:07:45 +00:00
Simon Pilgrim
6bd9ab9c64 [X86] PMOV*X* tests - remove unnecessary mcpu arguments and regenerate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251230 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-25 11:55:10 +00:00
Simon Pilgrim
1487603333 [X86] Stack folding tests - just use mtriple - no need for mcpu in these tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251229 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-25 11:42:46 +00:00
Michael Kuperstein
8052f4541d [X86] Use correct calling convention for MCU psABI libcalls
When using the MCU psABI, compiler-generated library calls should pass
some parameters in-register. However, since inreg marking for x86 is currently
done by the front end, it will not be applied to backend-generated calls.

This is a workaround for PR3997, which describes a similar issue for -mregparm.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251223 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-25 08:14:05 +00:00
Michael Kuperstein
c50c6907aa [X86] Add support for elfiamcu triple
This adds support for the i?86-*-elfiamcu triple, which indicates the IAMCU psABI is used.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251222 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-25 08:07:37 +00:00
Craig Topper
30a1e5aa96 Remove two unnecessary conversions from MVT to EVT. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251219 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-25 03:15:29 +00:00
Craig Topper
e4745a7931 Use MVT::SimpleValueType instead of MVT in template parameter. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251217 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-25 00:27:14 +00:00
Rafael Espindola
ef85994685 Simplify boolean conditional return statements in tools/llvm-symbolizer.
Patch by Richard.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251216 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-24 23:23:25 +00:00