Commit Graph

123490 Commits

Author SHA1 Message Date
Matt Arsenault
e2849a9de0 AMDGPU: Fix off by one error in register parsing
If trying to use one past the end, this would assert.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252008 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-03 22:50:27 +00:00
Derek Schuff
5c3718f501 Address nit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252004 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-03 22:40:45 +00:00
Derek Schuff
4f71e3c355 Align whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252003 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-03 22:40:43 +00:00
Derek Schuff
05d7d32e12 [WebAssembly] Support wasm select operator
Summary:
Add support for wasm's select operator, and lower LLVM's select DAG node
to it.

Reviewers: sunfish

Subscribers: dschuff, llvm-commits, jfb

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252002 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-03 22:40:40 +00:00
Matt Arsenault
378e661deb AMDGPU: s[102:103] is unavailable on VI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252000 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-03 22:39:52 +00:00
Matt Arsenault
3e8ea1658e AMDGPU: Define correct number of SGPRs
There are actually 104 so 2 were missing.

More assembler tests with high register number tuples
will be included in later patches.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251999 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-03 22:39:50 +00:00
Matt Arsenault
4447636b49 AMDGPU: Make findUsedSGPR more readable
Add more comments etc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251996 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-03 22:30:15 +00:00
Matt Arsenault
01d92b08c8 AMDGPU: Initialize SIFixSGPRCopies so -print-after works
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251995 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-03 22:30:13 +00:00
Matt Arsenault
8e6c1f5761 AMDGPU: Alphabetize includes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251994 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-03 22:30:08 +00:00
Fiona Glaser
0b7ecee988 InstCombine: fix sinking of convergent calls
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251991 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-03 22:23:39 +00:00
Simon Pilgrim
cec7b16a3b [SelectionDAG] Use existing constant nodes instead of recreating them. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251990 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-03 22:21:38 +00:00
Alexey Samsonov
55e87bbf66 [LLVMSymbolize] Factor out the logic for printing structs from DIContext. NFC.
Introduce DIPrinter which takes care of rendering DILineInfo and
friends. This allows LLVMSymbolizer class to return a structured data
instead of plain std::strings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251989 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-03 22:20:52 +00:00
Simon Pilgrim
be22715ca8 [X86][AVX] Tweaked shuffle stack folding tests
To avoid alternative lowerings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251986 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-03 21:58:35 +00:00
Adam Nemet
7d1e09e79f [LAA] LLE 3/6: Rename InterestingDependence to Dependences, NFC
Summary:
We now collect all types of dependences including lexically forward
deps not just "interesting" ones.

Reviewers: hfinkel

Subscribers: rengolin, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251985 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-03 21:39:52 +00:00
Simon Pilgrim
6c02d22686 [X86][AVX512] Fixed shuffle test name to match shuffle
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251984 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-03 21:39:30 +00:00
Alexey Samsonov
3c6ecc0e22 [LLVMSymbolize] Move demangling away from printing routines. NFC.
Make printDILineInfo and friends responsible for just rendering the
contents of the structures, demangling should actually be performed
earlier, when we have the information about the originating
SymbolizableModule at hand.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251981 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-03 21:36:13 +00:00
Davide Italiano
1b506d8aa4 [SimplifyLibCalls] Add a new transformation: pow(exp(x), y) -> exp(x*y)
This one is enabled only under -ffast-math (due to rounding/overflows)
but allows us to emit shorter code.

Before (on FreeBSD x86-64):
4007f0:       50                      push   %rax
4007f1:       f2 0f 11 0c 24          movsd  %xmm1,(%rsp)
4007f6:       e8 75 fd ff ff          callq  400570 <exp2@plt>
4007fb:       f2 0f 10 0c 24          movsd  (%rsp),%xmm1
400800:       58                      pop    %rax
400801:       e9 7a fd ff ff          jmpq   400580 <pow@plt>
400806:       66 2e 0f 1f 84 00 00    nopw   %cs:0x0(%rax,%rax,1)
40080d:       00 00 00

After:
4007b0:       f2 0f 59 c1             mulsd  %xmm1,%xmm0
4007b4:       e9 87 fd ff ff          jmpq   400540 <exp2@plt>
4007b9:       0f 1f 80 00 00 00 00    nopl   0x0(%rax)

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251976 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-03 20:32:23 +00:00
Simon Pilgrim
91c642526e [X86][XOP] Add support for the matching of the VPCMOV bit select instruction
XOP has the VPCMOV instruction that performs the common vector bit select operation OR( AND( SRC1, SRC3 ), AND( SRC2, ~SRC3 ) )

This patch adds tablegen pattern matching for this instruction.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251975 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-03 20:27:01 +00:00
Rui Ueyama
7c5ec54082 llmv-pdbdump: Make BuiltinDumper shorter. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251974 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-03 20:16:18 +00:00
Adam Nemet
07bcdf3c68 [LAA] LLE 2/6: Fix a NoDep case that should be a Forward dependence
Summary:
When the dependence distance in zero then we have a loop-independent
dependence from the earlier to the later access.

No current client of LAA uses forward dependences so other than
potentially hitting the MaxDependences threshold earlier, this change
shouldn't affect anything right now.

This and the previous patch were tested together for compile-time
regression.  None found in LNT/SPEC.

Reviewers: hfinkel

Subscribers: rengolin, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251973 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-03 20:13:43 +00:00
Adam Nemet
26abcb3277 [LAA] LLE 1/6: Expose Forward dependences
Summary:
Before this change, we didn't use to collect forward dependences since
none of the current clients (LV, LDist) required them.

The motivation to also collect forward dependences is a new pass
LoopLoadElimination (LLE) which discovers store-to-load forwarding
opportunities across the loop's backedge.  The pass uses both lexically
forward or backward loop-carried dependences to detect these
opportunities.

The new pass also analyzes loop-independent (forward) dependences since
they can conflict with the loop-carried dependences in terms of how the
data flows through memory.

The newly added test only covers loop-carried forward dependences
because loop-independent ones are currently categorized as NoDep.  The
next patch will fix this.

The two patches were tested together for compile-time regression.  None
found in LNT/SPEC.

Note that with this change LAA provides all dependences rather than just
"interesting" ones.  A subsequent NFC patch will remove the now trivial
isInterestingDependence and rename the APIs.

Reviewers: hfinkel

Subscribers: jmolloy, rengolin, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251972 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-03 20:13:23 +00:00
Rafael Espindola
556ddccf74 Don't create empty sections just to look like gas.
We are long past the time when this much bug for bug compatibility was
useful.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251970 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-03 20:02:22 +00:00
Rafael Espindola
d7bfacbfea Relax a few more overspecified tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251967 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-03 19:38:19 +00:00
Teresa Johnson
5030f311e8 Revert "Move metadata linking after lazy global materialization/linking."
This reverts commit r251926. I believe this is causing an LTO
bootstrapping bot failure
(http://lab.llvm.org:8080/green/job/llvm-stage2-cmake-RgLTO_build/3669/).

Haven't been able to repro it yet, but after looking at the metadata I
am pretty sure I know what is going on.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251965 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-03 19:36:04 +00:00
Rafael Espindola
1cc68742af Remove unnecessary dependency on section and string positions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251964 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-03 19:24:17 +00:00
Kostya Serebryany
af639be62f [libFuzzer] make -test_single_input more reliable: make sure the input's size is equal to it's capacity
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251961 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-03 18:57:25 +00:00
Rafael Espindola
49d691389e Delete dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251960 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-03 18:55:58 +00:00
Rafael Espindola
ca792d80c4 Simplify local common output.
We now create them as they are found and use higher level APIs.

This is a step in avoiding creating unnecessary sections.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251958 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-03 18:50:51 +00:00
Igor Laevsky
e78962ca4a [CodegenPrepare] Do not rematerialize gc.relocates across different basic blocks
Differential Revision: http://reviews.llvm.org/D14258



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251957 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-03 18:37:40 +00:00
Rafael Espindola
f026f70e79 Move code out of a loop and use a range loop.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251952 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-03 18:04:07 +00:00
Rafael Espindola
25d7145b34 Revert "Revert "[Orc] Directly emit machine code for the x86 resolver block and trampolines.""
This reverts commit r251937.

The test was updated to the new API, bring the API back.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251944 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-03 16:40:37 +00:00
Lang Hames
166aa4459f [Kaleidoscope][Orc] Fix the fully_lazy Orc Kaleidoscope example.
r251933 changed the Orc compile callbacks API, which broke this.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251942 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-03 16:35:10 +00:00
Silviu Baranga
94652aba1f Fix PR25372 - teach replaceCongruentPHIs to handle cases where SE evaluates a PHI to a SCEVConstant
Summary:
Since now Scalar Evolution can create non-add rec expressions for PHI
nodes, it can also create SCEVConstant expressions. This will confuse
replaceCongruentPHIs, which previously relied on the fact that SCEV
could not produce constants in this case.

We will now replace the node with a constant in these cases - or avoid
processing the Phi in case of a type mismatch.

Reviewers: sanjoy

Subscribers: llvm-commits, majnemer

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251938 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-03 16:27:04 +00:00
Rafael Espindola
1b023a319e Revert "[Orc] Directly emit machine code for the x86 resolver block and trampolines."
This reverts commit r251933.

It broke the build of examples/Kaleidoscope/Orc/fully_lazy/toy.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251937 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-03 16:25:20 +00:00
David Blaikie
6ea7358436 Kaleidoscope-ch2: Remove the dependence on LLVM by cloning make_unique into this project
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251936 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-03 16:23:21 +00:00
Lang Hames
73cd3516cc [Orc] Directly emit machine code for the x86 resolver block and trampolines.
Bypassing LLVM for this has a number of benefits:

1) Laziness support becomes asm-syntax agnostic (previously lazy jitting didn't
   work on Windows as the resolver block was in Darwin asm).

2) For cross-process JITs, it allows resolver blocks and trampolines to be
   emitted directly in the target process, reducing cross process traffic.

3) It should be marginally faster.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251933 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-03 16:10:18 +00:00
Teresa Johnson
20f7585a5c Move metadata linking after lazy global materialization/linking.
Summary:
Currently, named metadata is linked before the LazilyLinkGlobalValues
list is walked and materialized/linked. As a result, references
from DISubprogram and DIGlobalVariable metadata to yet unmaterialized
functions and variables cause them to be added to the lazy linking
list and their definitions are materialized and linked.

This makes the llvm-link -only-needed option not have the intended
effect when debug information is present, as the otherwise unneeded
functions/variables are still linked in.

Additionally, for ThinLTO I have implemented a mechanism to only link
in debug metadata needed by imported functions. Moving named metadata
linking after lazy GV linking will facilitate applying this mechanism
to the LTO and "llvm-link -only-needed" cases as well.

Reviewers: dexonsmith, tra, dblaikie

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251926 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-03 15:11:27 +00:00
Teresa Johnson
fb792d346f Pass enum instead of bool to new linkInModule call in llvm-link
A new call I added to linkInModule from llvm-link in r251866
was still passing in a boolean for an argument that was changed to an
enum in r246561. I didn't catch this in my merge since the bool false
matched the flag value it mapped to.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251925 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-03 15:10:50 +00:00
Filipe Cabecinhas
32a2349a79 Don't assert if materializing before seeing any function bodies
This assert was reachable from user input. A minimized test case (no
FUNCTION_BLOCK_ID record) is attached.

Bug found with afl-fuzz

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251910 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-03 13:48:26 +00:00
Filipe Cabecinhas
b6e9fa5e10 Don't use Twine objects after their lifetimes end.
No test, since it would depend on what the compiler can optimize/reuse.
My next commit made this bug visible on Linux Release compiles with some
versions of gcc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251909 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-03 13:48:21 +00:00
Elena Demikhovsky
2c4a333422 LoopVectorizer - skip 'bitcast' between GEP and load.
Skipping 'bitcast' in this case allows to vectorize load:

  %arrayidx = getelementptr inbounds double*, double** %in, i64 %indvars.iv
  %tmp53 = bitcast double** %arrayidx to i64*
  %tmp54 = load i64, i64* %tmp53, align 8

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251907 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-03 10:29:34 +00:00
Michael Kuperstein
a64f17562f [X86] Generate .cfi_adjust_cfa_offset correctly when pushing arguments
When push instructions are being used to pass function arguments on
the stack, and either EH or debugging are enabled, we need to generate
.cfi_adjust_cfa_offset directives appropriately. For (synch) EH, it is
enough for the CFA offset to be correct at every call site, while
for debugging we want to be correct after every push.

Darwin does not support this well, so don't use pushes whenever it
would be required.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251904 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-03 08:17:25 +00:00
Igor Breger
5a1297dc77 AVX512: add encoding tests for vmovq/d instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251903 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-03 07:30:17 +00:00
Tobias Grosser
0efe7b620e Revert "[IndVarSimplify] Rewrite loop exit values with their initial values from loop preheader"
Commit 251839 triggers miscompiles on some bots:

http://lab.llvm.org:8011/builders/perf-x86_64-penryn-O3-polly-fast/builds/13723

(The commit is listed in 13722, but due to an existing failure introduced in
13721 and reverted in 13723 the failure is only visible in 13723)

To verify r251839 is indeed the only change that triggered the buildbot failures
and to ensure the buildbots remain green while investigating I temporarily
revert this commit. At the current state it is unclear if this commit introduced
some miscompile or if it only exposed code to Polly that is subsequently
miscompiled by Polly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251901 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-03 07:14:39 +00:00
Matthias Braun
e5065bdcd7 Fix build problme introduced in r251883
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251888 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-03 02:19:07 +00:00
Matthias Braun
cfe39babc5 RegisterPressure: Improve assert message
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251885 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-03 01:53:36 +00:00
Matthias Braun
363f18097a RegisterPressure: Slightly nicer pressure diff dumping
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251884 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-03 01:53:33 +00:00
Matthias Braun
e9564b2bbe ScheduleDAGInstrs: Remove IsPostRA flag; NFC
ScheduleDAGInstrs doesn't behave differently before or after register
allocation. It was only used in a method of MachineSchedulerBase which
behaved differently in MachineScheduler/PostMachineScheduler. Change
this to let MachineScheduler/PostMachineScheduler just pass in a
parameter to that function.

The order of the LiveIntervals* and bool RemoveKillFlags paramters have
been switched to make out-of-tree code fail instead of unintentionally
passing a value intended for the IsPostRA flag to the (previously
following and default initialized) RemoveKillFlags.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251883 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-03 01:53:29 +00:00
Rafael Espindola
030d7a3004 Don't implicitly construct a Archive::child_iterator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251878 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-03 01:32:40 +00:00
Rafael Espindola
2356f2b5d9 This never returns end(), simplify to use Child instead of iterator. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251876 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-03 01:20:44 +00:00