139292 Commits

Author SHA1 Message Date
Tom Stellard
9aa8644318 AMDGPU/SI: Emit fixups for long branches
Reviewers: arsenm

Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, llvm-commits, tony-tye

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283570 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-07 16:01:18 +00:00
Simon Pilgrim
8a6c2f92ba [X86][SSE] Reapplied: Add vector fcopysign combine tests
Now with better lowering and fix for PR30443

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283569 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-07 16:00:59 +00:00
Artem Tamazov
97a1f765a3 [AMDGPU][mc] Add support for buffer_load_dwordx3, buffer_store_dwordx3.
Partially fixes Bug 28232.
Lit tests added.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283567 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-07 15:53:16 +00:00
Dehao Chen
588a79510c Invoke add-discriminator at -g0 -fsample-profile
Summary: -fsample-profile needs discriminator, which will not be added if built with -g0. This patch makes sure the discriminator is added for sample-profile at -g0. A followup patch will be send out to update clang tests.

Reviewers: davidxl, dblaikie, echristo, dnovillo

Subscribers: mehdi_amini, probinson, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283565 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-07 15:21:31 +00:00
Matthew Simpson
cf5c0d7439 [LV] Don't mark multi-use branch conditions uniform
Previously, we marked the branch conditions of latch blocks uniform after
vectorization if they were instructions contained in the loop. However, if a
condition instruction has users other than the branch, it may not remain
uniform. This patch ensures the conditions we mark uniform are only used by the
branch. This should fix PR30627.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283563 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-07 15:20:13 +00:00
Krzysztof Parzyszek
5cbeeedeaa Only track physical registers in LivePhysRegs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283561 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-07 14:50:49 +00:00
Sam Kolton
a7de0c7962 [AMDGPU] Assembler: support v_mac_f32 DPP and SDWA. Move getNamedOperandIdx to AMDGPUBaseInfo.h
Reviewers: artem.tamazov, tstellarAMD

Subscribers: arsenm, kzhuravl, wdng, nhaehnle, yaxunl, tony-tye

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283560 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-07 14:46:06 +00:00
Simon Pilgrim
64cb9919ee [X86][SSE] Tidied up tests - use standard check prefixes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283559 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-07 14:42:22 +00:00
Konstantin Zhuravlyov
fbd12bbb90 [AMDGPU] AMDGPUCodeGenPrepare: remove extra ';'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283558 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-07 14:39:53 +00:00
Tom Stellard
8b2bb5de9a [ValueTracking] Fix crash in GetPointerBaseWithConstantOffset()
Summary:
While walking defs of pointer operands we were assuming that the pointer
size would remain constant.  This is not true, because addresspacecast
instructions may cast the pointer to an address space with a different
pointer width.

This partial reverts r282612, which was a more conservative solution
to this problem.

Reviewers: reames, sanjoy, apilipenko

Subscribers: wdng, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283557 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-07 14:23:29 +00:00
Konstantin Zhuravlyov
2d50d3f3c9 [AMDGPU] Promote uniform (i1, i16] operations to i32
Differential Revision: https://reviews.llvm.org/D25302


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283555 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-07 14:22:58 +00:00
Benjamin Kramer
674bd2c304 Remove spurious non-printable character from source file.
NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283552 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-07 13:46:38 +00:00
Javed Absar
e3eba57f7a [ARM]: add missing switch case for cortex-r52
Adds a missing switch case for handling cortex-r52
in init-subtarget-features.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283551 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-07 13:41:55 +00:00
Martin Storsjo
c3339a54ac [ARM] Reapply: Use __rt_div functions for divrem on Windows
Reapplying r283383 after revert in r283442. The additional fix
is a getting rid of a stray space in a function name, in the
refactoring part of the commit.

This avoids falling back to calling out to the GCC rem functions
(__moddi3, __umoddi3) when targeting Windows.

The __rt_div functions have flipped the two arguments compared
to the __aeabi_divmod functions. To match MSVC, we emit a
check for division by zero before actually calling the library
function (even if the library function itself also might do
the same check).

Not all calls to __rt_div functions for division are currently
merged with calls to the same function with the same parameters
for the remainder. This is more wasteful than a div + mls as before,
but avoids calls to __moddi3.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283550 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-07 13:28:53 +00:00
Javed Absar
a297939a6a [ARM]: Add Cortex-R52 target to LLVM
This patch adds Cortex-R52, the new ARM real-time processor, to LLVM. 
Cortex-R52 implements the ARMv8-R architecture.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283542 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-07 12:06:40 +00:00
Simon Pilgrim
c5606f9b0b [X86][SSE] Update register class during MOVSD/MOVSS - BLENDPD/BLENDPS commutation
MOVSD/MOVSS take a 128-bit register and a FR32/FR64 register input, the commutation code wasn't taking this into account leading to verification errors.

This patch inserts a vreg copy mi to ensure that the registers are correct.

Fix for PR30607

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283539 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-07 11:18:38 +00:00
Alexey Bataev
ccab47139f [SLPVectorizer] Fix for PR25748: reduction vectorization after loop
unrolling.

The next code is not vectorized by the SLPVectorizer:
```
 int test(unsigned int *p) {
  int sum = 0;
  for (int i = 0; i < 8; i++)
    sum += p[i];
  return sum;
 }
```
During optimization this loop is fully unrolled and SLPVectorizer is
unable to vectorize it. Patch tries to fix this problem.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283535 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-07 09:39:22 +00:00
Oliver Stannard
9dc8cca063 [ARM] Don't convert switches to lookup tables of pointers with ROPI/RWPI
With the ROPI and RWPI relocation models we can't always have pointers
to global data or functions in constant data, so don't try to convert switches
into lookup tables if any value in the lookup table would require a relocation.
We can still safely emit lookup tables of other values, such as simple
constants.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283530 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-07 08:48:24 +00:00
Mehdi Amini
744a261c31 Use StringRef in ARMELFStreamer (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283529 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-07 08:48:07 +00:00
Nicolai Haehnle
f3907ede55 AMDGPU: Fix use-after-free in SIOptimizeExecMasking
Summary:
There was a bug with sequences like

   s_mov_b64 s[0:1], exec
   s_and_b64 s[2:3]<def>, s[0:1], s[2:3]<kill>
   ...
   s_mov_b64_term exec, s[2:3]

because s[2:3] was defined and used in the same instruction, ending up with
SaveExecInst inside OtherUseInsts.

Note that the test case also exposes an unrelated bug.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98028

Reviewers: tstellarAMD, arsenm

Subscribers: kzhuravl, wdng, yaxunl, llvm-commits, tony-tye

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283528 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-07 08:40:14 +00:00
Mehdi Amini
a47cbd993e Use StringReg in TargetParser APIs (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283527 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-07 08:37:29 +00:00
Mehdi Amini
a259671d73 Revert "Revert "Add a static_assert to enforce that parameters to llvm::format() are not totally unsafe""
This reverts commit r283510 and reapply r283509, with updates to
clang-tools-extra as well.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283525 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-07 08:25:42 +00:00
Craig Topper
0885462106 [X86] Fix patterns for VPMULLD and VPCMPEQQ to not require aligned loads.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283524 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-07 06:54:43 +00:00
Craig Topper
de084c52e6 [X86] Remove unused PatFrags. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283523 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-07 06:54:39 +00:00
Dylan McKay
61fdf5d8e9 [AVR] Add the AVRMCInstLower class
Summary:
This class deals with the lowering of CodeGen `MachineInstr` objects to
MC `MCInst` objects.

Reviewers: kparzysz, arsenm

Subscribers: wdng, beanz, japaric, mgorny

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283522 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-07 06:13:09 +00:00
Matt Arsenault
0b0321b9a7 AMDGPU: Change check prefix in test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283521 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-07 03:55:04 +00:00
Hal Finkel
837bcf7984 [llvm-opt-report] Left justify unrolling counts, etc.
In the left part of the reports, we have things like U<number>; if some of
these numbers use more digits than others, we don't want a space in between the
U and the start of the number. Instead, the space should come afterward. This
way it is clear that the number goes with the U and not any other optimization
indicator that might come later on the line.

Tests committed in r283518.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283519 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-07 02:01:03 +00:00
Hal Finkel
68dd546484 [llvm-opt-report] Left justify unrolling counts, etc.
In the left part of the reports, we have things like U<number>; if some of
these numbers use more digits than others, we don't want a space in between the
U and the start of the number. Instead, the space should come afterward. This
way it is clear that the number goes with the U and not any other optimization
indicator that might come later on the line.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283518 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-07 01:57:06 +00:00
David Majnemer
433ffa6a88 [SimplifyCFG] Correctly test for unconditional branches in GetCaseResults
GetCaseResults assumed that a terminator with one successor was an
unconditional branch.  This is not necessarily the case, it could be a
cleanupret.

Strengthen the check by querying whether or not the terminator is
exceptional.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283517 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-07 01:38:35 +00:00
Hal Finkel
28b12d7747 [llvm-opt-report] Use -no-demangle to disable demangling
As this is intended to be a user-facing option, -no-demangle seems much better
than -demangle=0. Add testing for the option.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283516 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-07 01:30:59 +00:00
Peter Collingbourne
a425991140 Target: Remove unused patterns and transforms. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283515 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-07 00:30:49 +00:00
Colin LeMahieu
ff22dc34df [Hexagon] NFC Removing 'V4_' prefix from duplex instruction names.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283514 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-07 00:15:07 +00:00
Michael Kuperstein
d225df2f18 [LV] Remove triples from target-independent vectorizer tests. NFC.
Vectorizer tests in the target-independent directory should not have a target
triple. If a test really needs to query a specific backend, it belongs in the
right target subdirectory (which "REQUIRES" the right backend). Otherwise, it
should not specify a triple.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283512 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-06 23:57:25 +00:00
Mehdi Amini
5f95e5b2e3 Revert "Add a static_assert to enforce that parameters to llvm::format() are not totally unsafe"
This reverts commit r283509, clang is hitting the assert.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283510 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-06 23:41:49 +00:00
Mehdi Amini
647e467795 Add a static_assert to enforce that parameters to llvm::format() are not totally unsafe
Summary:
I had for the second time today a bug where llvm::format("%s", Str)
was called with Str being a StringRef. The Linux and MacOS bots were
fine, but windows having different calling convention, it printed
garbage.

Instead we can catch this at compile-time: it is never expected to
call a C vararg printf-like function with non scalar type I believe.

Reviewers: bogner, Bigcheese, dexonsmith

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283509 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-06 23:26:29 +00:00
Colin LeMahieu
27ab1b8a7a [Hexagon] NFC. Canonicalizing absolute address instruction names.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283507 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-06 23:02:11 +00:00
Vedant Kumar
4a0edca8c6 Delete some dead code in SelectionDAG (NFC)
Differential Revision: https://reviews.llvm.org/D24435

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283505 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-06 22:53:43 +00:00
Dan Gohman
12bd3d1963 [WebAssemby] Implement block signatures.
Per spec changes, this implements block signatures, and adds just enough
logic to produce correct block signatures at the ends of functions.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283503 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-06 22:29:32 +00:00
Dan Gohman
d8d953ef76 [WebAssembly] Remove loop's bottom label.
Per spec changes, loop constructs no longer have a bottom label.

https://reviews.llvm.org/D25118


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283502 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-06 22:10:23 +00:00
Dan Gohman
a5e77a0215 [WebAssembly] Remove the output operand from stores.
Per spec changes, store instructions in WebAssembly no longer have a return
value. Update the instruction descriptions.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283501 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-06 22:08:28 +00:00
Wolfgang Pieb
65236ec176 Preserve the debug location when CodeGenPrepare sinks a compare instruction into the
basic block of a user.

Patch by Andrea DiBiagio.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283500 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-06 21:43:45 +00:00
Pirama Arumuga Nainar
e936b22336 Handle *_EXTEND_VECTOR_INREG during Integer Legalization
Summary:
These nodes need legalization for 3-element vectors.  This commit
handles the legalization and adds tests for zext and sext.

This fixes PR30614.

Reviewers: RKSimon, srhines

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283496 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-06 21:27:05 +00:00
Rong Xu
bb6f9b5aff [PGO] Create weak alias for the renamed Comdat function
Add a weak alias to the renamed Comdat function in IR level instrumentation,
using it's original name. This ensures the same behavior w/ and w/o IR
instrumentation, even for non standard conforming code.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283490 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-06 20:38:13 +00:00
Michael Kuperstein
f978224d50 [X86] Preserve BasePtr for LEA64_32r
When replacing FrameIndex with BasePtr, we must preserve BasePtr for
LEA64_32r since BasePtr is used later for stack adjustment if it is
the same as StackPtr.

Patch by H.J Lu <hjl.tools@gmail.com>

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283486 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-06 19:31:27 +00:00
Simon Pilgrim
b3650b57fe [X86][SSE] Add f16/f80/f128 vector sitofp test cases
As discussed on D23808

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283485 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-06 19:29:25 +00:00
Michael Kuperstein
1ac52953b4 [DAG] Generalize build_vector -> vector_shuffle combine for more than 2 inputs
This generalizes the build_vector -> vector_shuffle combine to support any
number of inputs. The idea is to create a binary tree of shuffles, where
the first layer performs pairwise shuffles of the input vectors placing each
input element into the correct lane, and the rest of the tree blends these
shuffles together.

This doesn't try to be smart and create any sort of "optimal" shuffles.
The assumption is that even a "poor" shuffle sequence is better than extracting
and inserting the elements one by one.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283480 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-06 18:58:24 +00:00
Michael Ilseman
33fe838cad Revert "Add -strip-nonlinetable-debuginfo capability"
This reverts commit r283473.

Reverted until review is completed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283478 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-06 18:30:26 +00:00
Matt Arsenault
5f58f8ecb6 AMDGPU: Don't fold undef uses or copies with implicit uses
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283476 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-06 18:12:13 +00:00
Matt Arsenault
ba29379c20 AMDGPU: Remove scheduling info from si_mask_branch
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283475 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-06 18:12:07 +00:00
Michael Ilseman
bda4e020b8 Add -strip-nonlinetable-debuginfo capability
This adds a new function to DebugInfo.cpp that takes an llvm::Module
as input and removes all debug info metadata that is not directly
needed for line tables, thus effectively stripping all type and
variable information from the module.

The primary motivation for this feature was the bitcode work flow
(cf. http://lists.llvm.org/pipermail/llvm-dev/2016-June/100643.html
for more background). This is not wired up yet, but will be in
subsequent patches.  For testing, the new functionality is exposed to
opt with a -strip-nonlinetable-debuginfo option.

The secondary use-case (and one that works right now!) is as a
reduction pass in bugpoint. I added two new bugpoint options
(-disable-strip-debuginfo and -disable-strip-debug-types) to control
the new features. By default it will first attempt to remove all debug
information, then only the type info, and then proceed to hack at any
remaining MDNodes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283473 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-06 17:58:38 +00:00