139605 Commits

Author SHA1 Message Date
Davide Italiano
6d57e1cce1 [InstCombine] Don't unpack arrays that are too large (part 2).
This is similar to r283599, but for store instructions.
Thanks to David for pointing out!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283612 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-07 21:53:09 +00:00
Zachary Turner
4be86fdee6 Add missing include.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283610 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-07 21:40:06 +00:00
Zachary Turner
254b4d2617 Refactor Symbol visitor code.
Type visitor code had already been refactored previously to
decouple the visitor and the visitor callback interface.  This
was necessary for having the flexibility to visit in different
ways (for example, dumping to yaml, reading from yaml, dumping
to ScopedPrinter, etc).

This patch merely implements the same visitation pattern for
symbol records that has already been implemented for type records.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283609 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-07 21:34:46 +00:00
Hongbin Zheng
65f9ae178e [cmake] Treat polly as "in tree" if LLVM_EXTERNAL_POLLY_SOURCE_DIR is provided
Differential Revision: https://reviews.llvm.org/D25354

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283608 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-07 21:32:47 +00:00
Davide Italiano
b6ae30c083 [InstCombine] Don't unpack arrays that are too large
Differential Revision:  https://reviews.llvm.org/D25376

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283599 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-07 20:57:42 +00:00
Sanjay Patel
7e1f5027b3 [DAG] move fold (select C, 0, 1 -> xor C, 1) to a helper function; NFC
We're missing at least 3 other similar folds based on what we have in InstCombine. 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283596 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-07 20:47:51 +00:00
Tom Stellard
b44dba3340 AMDGPU/SI: Add support for 8-byte relocations
Reviewers: arsenm, kzhuravl

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

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283593 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-07 20:36:58 +00:00
Anna Thomas
e25a48dd36 [RS4GC] Strengthen coverage: add more tests
Summary: Add tests for cases where we have zero coverage in RS4GC.

Reviewers: sanjoy, reames

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283591 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-07 20:34:00 +00:00
Colin LeMahieu
3d9f32058b [Hexagon][NFC] Using documented instruction type name V4LDST instead of MEMOP.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283582 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-07 19:11:28 +00:00
Mehdi Amini
c16b74e39e Recommit "Use StringRef in LTOModule implementation (NFC)""
This reverts commit r283456 and reapply r282997, with explicitly
zeroing the struct member to workaround a bug in MSVC2013 with
zero-initialization: https://connect.microsoft.com/VisualStudio/feedback/details/802160

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283581 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-07 19:05:14 +00:00
Davide Italiano
db0b3fa3a9 [LoopIdiomRecognize] Merge two if conditions into one. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283579 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-07 18:39:43 +00:00
Sanjay Patel
7a0dadb15b [InstCombine] fold select X, (ext X), C
If we're going to canonicalize IR towards select of constants, try harder to create those.
Also, don't lose the metadata.

This is actually 4 related transforms in one patch:
      // select X, (sext X), C --> select X, -1, C
      // select X, (zext X), C --> select X,  1, C
      // select X, C, (sext X) --> select X, C, 0
      // select X, C, (zext X) --> select X, C, 0

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283575 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-07 17:53:07 +00:00
Adam Nemet
db695f404d New utility to visualize optimization records
This is a new tool built on top of the new YAML ouput generated from
optimization remarks.  It produces HTML for easy navigation and
visualization.

The tool assumes that hotness information for the remarks is available
(the YAML file was produced with PGO).  It uses hotness to list the
remarks prioritized by the hotness on the index page.  Clicking the
source location of the remark in the list takes you the source where the
remarks are rendedered inline in the source.

For now, the tool is meant as prototype.

It's written in Python.  It uses PyYAML to parse the input.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283571 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-07 17:06:34 +00:00
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