124657 Commits

Author SHA1 Message Date
Sanjay Patel
7cb4a767f8 [InstCombine] add tests to show potential vector IR shuffle transforms
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254342 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-30 22:39:36 +00:00
Simon Pilgrim
0f73ee481b [X86][FMA4] Prefer FMA4 to FMA
We currently output FMA instructions on targets which support both FMA4 + FMA (i.e. later Bulldozer CPUS bdver2/bdver3/bdver4).

This patch flips this so FMA4 is preferred; this is for several reasons:

1 - FMA4 is non-destructive reducing the need for mov instructions.
2 - Its more straighforward to commute and fold inputs (although the recent work on FMA has reduced this difference).
3 - All supported targets have FMA4 performance equal or better to FMA - Piledriver (bdver2) in particular has half the throughput when executing FMA instructions.

Its looks like no future AMD processor lines will support FMA4 after the Bulldozer series so we're not causing problems for later CPUs.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254339 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-30 22:22:06 +00:00
Rafael Espindola
a586fd2c56 Start deciding earlier what to link.
A traditional linker is roughly split in symbol resolution and "copying
stuff".

The two tasks are badly mixed in lib/Linker.

This starts splitting them apart.

With this patch there are no direct call to linkGlobalValueBody or
linkGlobalValueProto. Everything is linked via WapValue.

This also includes a few fixes:
* A GV goes undefined if the comdat is dropped (comdat11.ll).
* We error if an internal GV goes undefined (comdat13.ll).
* We don't link an unused comdat.

The first two match the behavior of an ELF linker. The second one is
equivalent to running globaldce on the input.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254336 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-30 22:01:43 +00:00
Paul Robinson
ae5d4bfbbe Have 'optnone' respect the -fast-isel=false option.
This is primarily useful for debugging optnone v. ISel issues.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254335 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-30 21:56:16 +00:00
Cong Hou
f44d69a9c3 [X86] Update test/CodeGen/X86/avg.ll with the help of update_llc_test_checks.py. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254334 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-30 21:46:08 +00:00
Matt Arsenault
504d89597a AMDGPU: Fix unused function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254333 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-30 21:32:10 +00:00
Matt Arsenault
7a47a7be12 AMDGPU: Error if too many user SGPRs used
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254332 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-30 21:16:07 +00:00
Matt Arsenault
0f1b95f818 AMDGPU: Rework how private buffer passed for HSA
If we know we have stack objects, we reserve the registers
that the private buffer resource and wave offset are passed
and use them directly.

If not, reserve the last 5 SGPRs just in case we need to spill.
After register allocation, try to pick the next available registers
instead of the last SGPRs, and then insert copies from the inputs
to the reserved registers in the progloue.

This also only selectively enables all of the input registers
which are really required instead of always enabling them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254331 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-30 21:16:03 +00:00
Matt Arsenault
d4a0a430cc AMDGPU: Rename enums to be consistent with HSA code object terminology
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254330 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-30 21:15:57 +00:00
Matt Arsenault
956f59ab56 AMDGPU: Remove SIPrepareScratchRegs
It does not work because of emergency stack slots.
This pass was supposed to eliminate dummy registers for the
spill instructions, but the register scavenger can introduce
more during PrologEpilogInserter, so some would end up
left behind if they were needed.

The potential for spilling the scratch resource descriptor
and offset register makes doing something like this
overly complicated. Reserve registers to use for the resource
descriptor and use them directly in eliminateFrameIndex.

Also removes creating another scratch resource descriptor
when directly selecting scratch MUBUF instructions.

The choice of which registers are reserved is temporary.
For now it attempts to pick the next available registers
after the user and system SGPRs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254329 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-30 21:15:53 +00:00
Matt Arsenault
32851c191d AMDGPU: Use assert zext for workgroup sizes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254328 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-30 21:15:45 +00:00
Quentin Colombet
ddaf09c192 [ARM] For old thumb ISA like v4t, we cannot use PC directly in pop.
Fix the epilogue emission to account for that.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254325 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-30 20:37:58 +00:00
Reid Kleckner
3be8e6a768 Avoid writing to source directory of tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254324 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-30 20:36:23 +00:00
Davide Italiano
76755680f6 [SimplifyLibCalls] Remove useless bits of this tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254318 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-30 19:38:35 +00:00
Davide Italiano
24c91af18b [SimplifyLibCalls] Transform log(exp2(y)) to y*log(2) under fast-math.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254317 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-30 19:36:35 +00:00
David Majnemer
fbb7433e07 [X86] Add RIP to GR64_TCW64
The MachineVerifier wants to check that the register operands of an
instruction belong to the instruction's register class.  RIP-relative
control flow instructions violated this by referencing RIP.  While this
was fixed for SysV, it was never fixed for Win64.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254315 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-30 19:04:19 +00:00
Kit Barton
56faeb049c Enable shrink wrapping for PPC64
Re-enable shrink wrapping for PPC64 Little Endian.

One minor modification to PPCFrameLowering::findScratchRegister was necessary to handle fall-thru blocks (blocks with no terminator) correctly.

Tested with all LLVM test, clang tests, and the self-hosting build, with no problems found.

PHabricator: http://reviews.llvm.org/D14778

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254314 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-30 18:59:41 +00:00
Rafael Espindola
e87f0932d9 Fix another llvm.ctors merging bug.
We were not looking past casts to see if an element should be included
or not.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254313 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-30 18:54:24 +00:00
Dan Gohman
8dc6e6c3bb [WebAssembly] Fix a few minor compiler warnings. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254311 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-30 18:42:08 +00:00
Sanjay Patel
351aaa5d3e fix formatting; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254310 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-30 17:52:02 +00:00
Colin LeMahieu
d27440bc80 [Hexagon] NFC Reordering headers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254307 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-30 17:32:34 +00:00
Matt Arsenault
9d75bc9904 AMDGPU: Don't reserve SCRATCH_PTR input register
This hasn't been doing anything since using relocations was added.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254304 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-30 15:46:47 +00:00
Aaron Ballman
9ec9305f06 Silencing a 32-bit to 64-bit implicit conversion warning; NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254302 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-30 14:52:33 +00:00
Hrvoje Varga
30709900f3 [mips][microMIPS] Implement LBUX, LHX, LWX, MAQ_S[A].W.PHL, MAQ_S[A].W.PHR, MFHI, MFLO, MTHI and MTLO instructions
Differential Revision: http://reviews.llvm.org/D14436


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254297 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-30 12:58:39 +00:00
Zoran Jovanovic
b294a7b51a [mips][microMIPS] Fix issue with offset operand of BALC and BC instructions
Value of offset operand for microMIPS BALC and BC instructions is currently shifted 2 bits, but it should be 1 bit.
Differential Revision: http://reviews.llvm.org/D14770


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254296 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-30 12:56:18 +00:00
Igor Breger
bffca30038 AVX512: regenerate avx512bw intrincics tests results.
Differential Revision: http://reviews.llvm.org/D15069

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254295 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-30 10:40:52 +00:00
Daniel Sanders
1d44f044d7 [mips][ias] Removed MSA instructions from base architecture valid-xfail.s's.
valid-xfail.s is for instructions that should be valid in the given ISA but
incorrectly fail. MSA instructions are correct to fail since MSA is not enabled.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254293 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-30 09:52:00 +00:00
Zlatko Buljan
0dd0d39ecd [mips][microMIPS] Implement PRECR.QB.PH, PRECR_SRA[_R].PH.W, PRECRQ.PH.W, PRECRQ.QB.PH, PRECRQU_S.QB.PH and PRECRQ_RS.PH.W instructions
Differential Revision: http://reviews.llvm.org/D14605


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254291 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-30 08:37:38 +00:00
Craig Topper
f13caceefc Revert r254279 "[X86] Use ArrayRef. NFC". It seems to have upset an MSVC build bot.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254280 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-30 02:28:19 +00:00
Craig Topper
ebbca899ac [X86] Use ArrayRef. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254279 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-30 02:08:05 +00:00
Sanjoy Das
4ab382c3c8 [ADT] Fix typo in comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254278 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-30 01:24:17 +00:00
Craig Topper
da85caae7a [AVX512] The vpermi2 instructions require an integer vector for the index vector. This is reflected correctly in the intrinsics, but was not refelected in the isel patterns.
For the floating point types, this requires adding a bitcast to the index vector when its passed through to the output.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254277 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-30 00:13:24 +00:00
Sanjoy Das
dffe9f4fa6 [SCEV] Use lambda instead of std::bind; NFC
The lambda is more readable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254276 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-29 23:40:57 +00:00
Sanjoy Das
cce49eb8a6 [SCEV] Use range version of all_of; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254275 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-29 23:40:53 +00:00
Craig Topper
d67244292e [X86] Remove duplicate entries from intrinsics tables and add asserts to verify there are no others.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254274 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-29 23:18:32 +00:00
Sanjoy Das
4e6293afeb Fix out of bounds access in hasStructRetAttr
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254273 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-29 23:15:43 +00:00
Dan Gohman
1ee4c0e239 [WebAssembly] Delete an obsolete TODO comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254272 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-29 23:09:41 +00:00
Dan Gohman
10ad208c62 [WebAssembly] Set several MCInstrDesc flags.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254271 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-29 22:59:19 +00:00
Craig Topper
ae475496f6 [X86] int_x86_avx2_permps and X86ISD::VPERMV should take an integer vector for its shuffle indices.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254269 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-29 22:53:22 +00:00
Dan Gohman
99ef26c43e [WebAssembly] Delete unused functions. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254268 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-29 22:48:57 +00:00
Dan Gohman
85d0f9ca6d [WebAssembly] Minor clang-format and selected clang-tidy cleanups. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254267 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-29 22:32:02 +00:00
Sanjay Patel
f7790eca1d fix typos in comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254266 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-29 22:09:34 +00:00
Davide Italiano
401b67d4eb [SimplifyLibCalls] Don't crash if the function doesn't have a name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254265 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-29 21:58:56 +00:00
Davide Italiano
276f2af536 [SimplifyLibCalls] Cross out implemented transformations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254264 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-29 21:00:43 +00:00
Davide Italiano
0f019d6283 [SimplifyLibCalls] Tranform log(pow(x, y)) -> y*log(x).
This one is enabled only under -ffast-math. There are cases where the
difference between the value computed and the correct value is huge
even for ffast-math, e.g. as Steven pointed out:

x = -1, y = -4
log(pow(-1), 4) = 0
4*log(-1) = NaN

I checked what GCC does and apparently they do the same optimization
(which result in the dramatic difference). Future work might try to
make this (slightly) less worse.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254263 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-29 20:58:04 +00:00
Diego Novillo
173327b7af SamplePGO - Do not use std::to_string in diagnostics.
This fixes buildbots in systems that std::to_string is not present. It
also tidies the output of the diagnostic to render doubles a bit better
(thanks Ben Kramer for help with string streams and format).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254261 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-29 18:23:26 +00:00
Craig Topper
96be2c60e3 Use a lambda instead of std::bind and std::mem_fn I introduced in r254242. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254260 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-29 18:05:22 +00:00
Simon Pilgrim
86ccb92227 [X86][SSE] Added support for lowering to ADDSUBPS/ADDSUBPD with commuted inputs
We could already recognise shuffle(FSUB, FADD) -> ADDSUB, this allow us to recognise shuffle(FADD, FSUB) -> ADDSUB by commuting the shuffle mask prior to matching.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254259 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-29 16:41:04 +00:00
Rafael Espindola
e3f14b0e8c Add a passing test.
When a comdat is discarded, any globals defined in it become undefined.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254258 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-29 15:52:12 +00:00
Rafael Espindola
eab2da952c Don't depend on the order the IR is copied.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254257 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-29 15:22:49 +00:00