Commit Graph

138410 Commits

Author SHA1 Message Date
Mehdi Amini
a364825f51 Fix auto-upgrade of TBAA tags in Bitcode Reader
If TBAA is on an intrinsic and it gets upgraded, it'll delete the call
instruction that we collected in a vector. Even if we were to use
WeakVH, it'll drop the TBAA and we'll hit the assert on the upgrade
path.

r263673 gave a shot to make sure the TBAA upgrade happens before
intrinsics upgrade, but failed to account for all cases.

Instead of collecting instructions in a vector, this patch makes it
just upgrade the TBAA on the fly, because metadata are always
already loaded at this point.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281549 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 22:29:59 +00:00
Reid Kleckner
86a6238dca Fix indentation in codeview code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281542 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 21:49:21 +00:00
Mehdi Amini
fd7afc4d38 [LTO] Move tests from test/tools to test/LTO, as they're testing the API functionalities (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281539 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 21:07:32 +00:00
Mehdi Amini
bdf517a05c [LTO] Fix commons handling
Previously the prevailing information was not honored, and commons
symbols could override a strong definition. This patch fixes it and
propose the following semantic for commons: the client should mark
as prevailing the commons that it expects the LTO implementation to
merge (i.e. take the maximum size and alignment).
It implies that commons are allowed to have multiple prevailing
definitions.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281538 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 21:05:04 +00:00
Mehdi Amini
e0384663d6 [ThinLTO] Add an option to llvm-lto to print some basic statistics for the index
Differential Revision: https://reviews.llvm.org/D24290

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281537 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 21:04:59 +00:00
Matt Arsenault
93e6e5414d Finish renaming remaining analyzeBranch functions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281535 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 20:43:16 +00:00
Sanjoy Das
9becdeed48 [Stackmap] Added callsite counts to emitted function information.
Summary:
It was previously not possible for tools to use solely the stackmap
information emitted to reconstruct the return addresses of callsites in
the map, which is necessary to use the information to walk a stack. This
patch adds per-function callsite counts when emitting the stackmap
section in order to resolve the problem. Note that this slightly alters
the stackmap format, so external tools parsing these maps will need to
be updated.

**Problem Details:**
Records only store their offset from the beginning of the function they
belong to. While these records and the functions are output in program
order, it is not possible to determine where the end of one function's
records are without the callsite count when processing the records to
compute return addresses.

Patch by Kavon Farvardin!

Reviewers: atrick, ributzka, sanjoy

Subscribers: nemanjai

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281532 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 20:22:03 +00:00
Sanjay Patel
0890bf3ed4 [x86] regenerate checks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281531 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 20:21:28 +00:00
Sanjay Patel
421442ef63 [x86] regenerate checks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281529 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 20:16:24 +00:00
Evgeniy Stepanov
eb967fb89e Revert "[ARM] Promote small global constants to constant pools"
Breaks Android tests by introducing text relocations to ARM binaries.

http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/25362/steps/run%20asan%20lit%20tests%20%5Barm%2Fbullhead-userdebug%2FMTC20F%5D/logs/stdio

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281526 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 20:02:30 +00:00
Sanjay Patel
4e8d86c037 [x86] regenerate checks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281523 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 19:42:03 +00:00
Davide Italiano
d41f227035 [lib/LTO] Fix a typo. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281517 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 18:48:43 +00:00
Matt Arsenault
aceeb33943 Revert "AMDGPU: Use SOPK compare instructions"
Accidentally committed

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281514 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 18:04:42 +00:00
Matt Arsenault
fff5113a50 AMDGPU: Use SOPK compare instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281513 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 18:03:53 +00:00
Adrian Prantl
50aa9109c6 Verifier: Mark orphaned DICompileUnits as a debug info failure.
This is a follow-up to r268778 that adds a couple of missing cases,
most notably orphaned compile units.

rdar://problem/28193346

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281508 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 17:30:37 +00:00
Matt Arsenault
b1a710d5f0 Make analyzeBranch family of instruction names consistent
analyzeBranch was renamed to use lowercase first, rename
the related set to match.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281506 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 17:24:15 +00:00
Matt Arsenault
ab302cda5e AArch64: Use TTI branch functions in branch relaxation
The main change is to return the code size from
InsertBranch/RemoveBranch.

Patch mostly by Tim Northover

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281505 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 17:23:48 +00:00
Sanjay Patel
b4dbf03541 [x86] fix formatting; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281504 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 17:23:18 +00:00
Etienne Bergeron
24624732a0 [compiler-rt] Avoid instrumenting sanitizer functions
Summary:
Function __asan_default_options is called by __asan_init before the
shadow memory got initialized. Instrumenting that function may lead
to flaky execution.

As the __asan_default_options is provided by users, we cannot expect
them to add the appropriate function atttributes to avoid
instrumentation.

Reviewers: kcc, rnk

Subscribers: dberris, chrisha, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281503 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 17:18:37 +00:00
Simon Pilgrim
c348bc4aeb [X86][SSE] Improve recognition of i64 sitofp conversions that can be performed as i32 (PR29078)
Until AVX512DQ we only support i64/vXi64 sitofp conversion as scalars.

This patch sees if the sign bit extends far enough that we can truncate to a i32 type and then perform sitofp without loss of precision.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281502 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 17:15:26 +00:00
Chad Rosier
1e06f6cc99 [LoopInterchange] Typo. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281501 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 17:12:30 +00:00
Chad Rosier
1e694f09c9 [LoopInterchange] Add CL option to override cost threshold.
Mostly useful for getting consistent lit testing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281500 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 17:07:13 +00:00
Simon Pilgrim
e65dbf0620 [X86][SSE] Don't use PSHUFD directly - lower with generic shuffle
Remove the last user of the old getTargetShuffleNode helpers

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281499 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 17:04:22 +00:00
Sanjay Patel
47eb9d5b63 getValueType().getScalarSizeInBits() -> getScalarValueSizeInBits(), round 2 ; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281498 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 16:54:10 +00:00
Chad Rosier
fb1804be65 [LoopInterchange] Cleanup debug whitespace. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281497 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 16:43:19 +00:00
Sanjay Patel
c0a42ffc17 getVectorElementType().getSizeInBits() -> getScalarSizeInBits() ; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281495 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 16:37:15 +00:00
Sanjay Patel
a7c48ccd3f getValueType().getSizeInBits() -> getValueSizeInBits() ; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281493 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 16:05:51 +00:00
Etienne Bergeron
e9c64c5da5 Fix typo in comment [NFC]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281492 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 15:59:32 +00:00
Matt Arsenault
0f7125844e AMDGPU: Support folding FrameIndex operands
This avoids test regressions in a future commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281491 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 15:51:33 +00:00
Sanjay Patel
04e0167eac getValueType().getScalarSizeInBits() -> getScalarValueSizeInBits() ; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281490 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 15:43:44 +00:00
Sanjay Patel
f4559b5e2c getScalarType().getSizeInBits() -> getScalarSizeInBits() ; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281489 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 15:21:00 +00:00
Matt Arsenault
8bc95d0a47 AMDGPU: Improve splitting 64-bit bit ops by constants
This addresses a TODO to handle operations besides and. This
also starts eliminating no-op operations with a constant that
can emerge later.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281488 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 15:19:03 +00:00
Matthew Simpson
be3fec6cf2 [LV] Process pointer IVs with PHINodes in collectLoopUniforms
This patch moves the processing of pointer induction variables in
collectLoopUniforms from the consecutive pointer phase of the analysis to the
phi node phase. Previously, if a pointer induction variable was used by both a
scalarized non-memory instruction as well as a vectorized memory instruction,
we would incorrectly identify the pointer as uniform. Pointer induction
variables should be treated the same as other phi nodes. That is, they are
uniform if all users of the induction variable and induction variable update
are uniform.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281485 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 14:47:40 +00:00
James Molloy
b50cea7150 [ARM] Promote small global constants to constant pools
If a constant is unamed_addr and is only used within one function, we can save
on the code size and runtime cost of an indirection by changing the global's storage
to inside the constant pool. For example, instead of:

      ldr r0, .CPI0
      bl printf
      bx lr
    .CPI0: &format_string
    format_string: .asciz "hello, world!\n"

We can emit:

      adr r0, .CPI0
      bl printf
      bx lr
    .CPI0: .asciz "hello, world!\n"

This can cause significant code size savings when many small strings are used in one
function (4 bytes per string).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281484 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 14:47:27 +00:00
Sjoerd Meijer
2ecc1fc02a MCInstrDesc: this fixes an issue setting/getting member Flags, which
is an uint64_t. However, getter function getFlags returned an unsigned,
and in function hasProperty (1 << MCFlag) was used instead of (1ULL << MCFlag).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281483 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 14:32:17 +00:00
Simon Pilgrim
3824319ab4 [X86][SSE] Removed unused getTargetShuffleNode function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281481 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 14:30:00 +00:00
Simon Pilgrim
1c820899c7 [X86] Added i128 lshr+shl -> mask combine test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281480 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 14:29:16 +00:00
Nemanja Ivanovic
7328eb7558 Fix code-gen crash on Power9 for insert_vector_elt with variable index (PR30189)
This patch corresponds to review:
https://reviews.llvm.org/D24021

In the initial implementation of this instruction, I forgot to account for
variable indices. This patch fixes PR30189 and should probably be merged into
3.9.1 (I'll open a bug according to the new instructions).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281479 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 14:19:09 +00:00
Andrea Di Biagio
707666e59d [InstCombine] Merged two test files and regenerated checks using update_test_checks.py. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281478 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 14:18:21 +00:00
Silviu Baranga
f64fd3777c [StackProtector] Use INITIALIZE_TM_PASS instead of INITIALIZE_PASS
in order to make sure that its TargetMachine constructor is
registered.

This allows us to run the PEI machine pass with MIR input
(see PR30324).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281474 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 14:09:43 +00:00
Nemanja Ivanovic
3477191193 Adding missing directive for Power9.
There is currently no codegen for Power9 that depends on the directive
so this is NFC for now but will be important in the future. This was
missed in r268950 so I'm adding it now.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281473 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 14:09:39 +00:00
Simon Pilgrim
9320a1273e [X86][SSE] Don't blend vector shifts with MOVSS/MOVSD directly, lower from generic shuffle
Shuffle lowering will correctly lower to MOVSS/MOVSD/PBLEND, improving commutation opportunities

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281471 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 14:08:18 +00:00
Kuba Brecka
62660f0e5a [asan] Enable -asan-use-private-alias on Darwin/Mach-O, add test for ODR false positive with LTO (llvm part)
The '-asan-use-private-alias’ option (disabled by default) option is currently only enabled for Linux and ELF, but it also works on Darwin and Mach-O. This option also fixes a known problem with LTO on Darwin (https://github.com/google/sanitizers/issues/647). This patch enables the support for Darwin (but still keeps it off by default) and adds the LTO test case.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281470 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 14:06:33 +00:00
James Molloy
9502e5be6f Revert "[Thumb] Teach ISel how to lower compares of AND bitmasks efficiently"
This reverts commit r281323. It caused chromium test failures and a selfhost failure.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281451 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 09:45:28 +00:00
Vassil Vassilev
76c5395c55 Missing includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281450 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 08:55:18 +00:00
Tim Northover
d40a5626fc GlobalISel: mark pointer stores as legal on AArch64.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281448 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 08:28:54 +00:00
Sjoerd Meijer
82d457bf36 This reapplies r281304. The issue was that I had missed
to copy the new isAdd field in the tablegen data structure.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281447 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 08:20:03 +00:00
Elena Demikhovsky
ad1b22c748 AVX-512: Fixed a bug in kortest.z intrinsic
Lowering was wrong - X86ISD::SETCC node should return i8 type.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281446 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 08:06:54 +00:00
Igor Breger
3ef99c9f83 [AVX512BW] Change truncStore action (v16i16->v16i18). It can be legal only with AVX512VL.
Differential Revision: http://reviews.llvm.org/D24547

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281445 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 08:04:28 +00:00
Craig Topper
cb2901c00a [X86] Remove the VCVTSI2SD32 with rounding intrinsic. It's not used by clang and not needed since 32-bit integer to double is always exact.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281442 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 06:27:46 +00:00