Marina Yatsina [Tue, 11 Aug 2015 11:28:10 +0000 (11:28 +0000)]
[X86] Fix REPE, REPZ, REPNZ for intel syntax
REPE, REPZ, REPNZ, REPNE should have mnemonics for Intel syntax as well.
Currently using these instructions causes compilation errors for Intel syntax.
Differential Revision: http://reviews.llvm.org/D11794
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244584
91177308-0d34-0410-b5e6-
96231b3b80d8
Marina Yatsina [Tue, 11 Aug 2015 10:43:04 +0000 (10:43 +0000)]
[X86] Fix imul alias for intel syntax
The "imul reg, imm" alias is not defined for intel syntax.
In intel syntax there is no w/l/q suffix for the imul instruction.
Differential Revision: http://reviews.llvm.org/D11887
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244582
91177308-0d34-0410-b5e6-
96231b3b80d8
James Molloy [Tue, 11 Aug 2015 09:13:05 +0000 (09:13 +0000)]
Add new ISD nodes: ISD::FMINNAN and ISD::FMAXNAN
The intention of these is to be a corollary to ISD::FMINNUM/FMAXNUM,
differing only on how NaNs are treated. FMINNUM returns the non-NaN
input (when given one NaN and one non-NaN), FMINNAN returns the NaN
input instead.
This patch includes support for scalarizing, widening and splitting
vectors, but not expansion or softening. The reason is that these
should never be needed - FMINNAN nodes are only going to be created
in one place (SDAGBuilder::visitSelect) and there we'll check if the
node is legal or custom. I could preemptively add expand and soften
code, but I'm fairly opposed to adding code I can't test. It's bad
enough I can't create tests with this patch, but at least this code
will be exercised by the ARM and AArch64 backends fairly shortly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244581
91177308-0d34-0410-b5e6-
96231b3b80d8
James Molloy [Tue, 11 Aug 2015 09:12:57 +0000 (09:12 +0000)]
Add support for floating-point minnum and maxnum
The select pattern recognition in ValueTracking (as used by InstCombine
and SelectionDAGBuilder) only knew about integer patterns. This teaches
it about minimum and maximum operations.
matchSelectPattern() has been extended to return a struct containing the
existing Flavor and a new enum defining the pattern's behavior when
given one NaN operand.
C minnum() is defined to return the non-NaN operand in this case, but
the idiomatic C "a < b ? a : b" would return the NaN operand.
ARM and AArch64 at least have different instructions for these different cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244580
91177308-0d34-0410-b5e6-
96231b3b80d8
Vasileios Kalintiris [Tue, 11 Aug 2015 08:56:25 +0000 (08:56 +0000)]
[mips] Remap move as or.
Summary:
This patch remaps the assembly idiom 'move' to 'or' instead of 'daddu' or
'addu'. The use of addu/daddu instead of or as move was highlighted as a
performance issue during the analysis of a recent 64bit design. Originally
move was encoded as 'or' by binutils but was changed for the r10k cpu family
due to their pipeline which had 2 arithmetic units and a single logical unit,
and so could issue multiple (d)addu based moves at the same time but only 1
logical move.
This patch preserves the disassembly behaviour so that disassembling a old style
(d)addu move still appears as move, but assembling move always gives an or
Patch by Simon Dardis.
Reviewers: vkalintiris
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D11796
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244579
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Kuperstein [Tue, 11 Aug 2015 08:48:48 +0000 (08:48 +0000)]
[X86] When optimizing for minsize, use POP for small post-call stack clean-up
When optimizing for size, replace "addl $4, %esp" and "addl $8, %esp"
following a call by one or two pops, respectively. We don't try to do it in
general, but only when the stack adjustment immediately follows a call - which
is the most common case.
That allows taking a short-cut when trying to find a free register to pop into,
instead of a full-blown liveness check. If the adjustment immediately follows a
call, then every register the call clobbers but doesn't define should be dead at
that point, and can be used.
Differential Revision: http://reviews.llvm.org/D11749
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244578
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Kuperstein [Tue, 11 Aug 2015 08:19:43 +0000 (08:19 +0000)]
Allow PeepholeOptimizer to fold a few more cases
The condition for clearing the folding candidate list was clamped together
with the "uninteresting instruction" condition. This is too conservative,
e.g. we don't need to clear the list when encountering an IMPLICIT_DEF.
Differential Revision: http://reviews.llvm.org/D11591
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244577
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Kuperstein [Tue, 11 Aug 2015 08:06:44 +0000 (08:06 +0000)]
[GMR] Be a bit smarter about which globals don't alias when doing recursive lookups
Should hopefully fix the remainder of PR24288.
Differential Revision: http://reviews.llvm.org/D11900
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244575
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Tue, 11 Aug 2015 06:27:53 +0000 (06:27 +0000)]
[RuntimeDyld][AArch64] Add explicit addends before calling relocationValueRef.
relocationValueRef uses the addend, so it has to be set before the call.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244574
91177308-0d34-0410-b5e6-
96231b3b80d8
Yaron Keren [Tue, 11 Aug 2015 06:05:27 +0000 (06:05 +0000)]
Enable five passing dsymutil tests on Windows.
These tests pass with Windows 7 x64 + MSYS2. I'll see if the bots like
them as well and disable the failing ones.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244572
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Tue, 11 Aug 2015 05:57:10 +0000 (05:57 +0000)]
Fix unused variable 'X' in release builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244571
91177308-0d34-0410-b5e6-
96231b3b80d8
JF Bastien [Tue, 11 Aug 2015 04:52:24 +0000 (04:52 +0000)]
WebAssembly: NFC fix release build break, unused variable.
Summary: Caused by D11914, pointed out by blaikie.
Subscribers: llvm-commits, jfb, dblaikie
Differential Revision: http://reviews.llvm.org/D11929
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244570
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Tue, 11 Aug 2015 04:16:37 +0000 (04:16 +0000)]
[libFuzzer] fix docs build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244566
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Tue, 11 Aug 2015 02:48:30 +0000 (02:48 +0000)]
[IR] Verify EH pad predecessors
Make sure that an EH pad's predecessors are using their unwind edge to
transfer control to the EH pad.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244563
91177308-0d34-0410-b5e6-
96231b3b80d8
JF Bastien [Tue, 11 Aug 2015 02:45:15 +0000 (02:45 +0000)]
WebAssembly: add basic floating-point tests
Summary: I somehow forgot to add these when I added the basic floating-point opcodes. Also remove ceil/floor/trunc/nearestint for now, and add them only when properly tested.
Subscribers: llvm-commits, sunfish, jfb
Differential Revision: http://reviews.llvm.org/D11927
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244562
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Tue, 11 Aug 2015 01:53:45 +0000 (01:53 +0000)]
[libFuzzer] add the list of trophies to the docs. It is incomplete, additions are welcome :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244560
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Tue, 11 Aug 2015 01:44:42 +0000 (01:44 +0000)]
[libFuzzer] add -only_ascii flag
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244559
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Tue, 11 Aug 2015 01:15:26 +0000 (01:15 +0000)]
[WinEHPrepare] Add rudimentary support for the new EH instructions
This adds somewhat basic preparation functionality including:
- Formation of funclets via coloring basic blocks.
- Cloning of polychromatic blocks to ensure that funclets have unique
program counters.
- Demotion of values used between different funclets.
- Some amount of cleanup once we have removed predecessors from basic
blocks.
- Verification that we are left with a CFG that makes some amount of
sense.
N.B. Arguments and numbering still need to be done.
Differential Revision: http://reviews.llvm.org/D11750
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244558
91177308-0d34-0410-b5e6-
96231b3b80d8
Cameron Esfahani [Tue, 11 Aug 2015 01:15:07 +0000 (01:15 +0000)]
Explicitly clear the MI operand list when getInstruction() is called. Call MI.clear() within MCD::OPC_Decode case and inside of translateInstruction() for the X86 target. Remove now unnecessary MI.clear() from ARMDisassembler.
Summary: Explicitly clear the MI operand list when getInstruction() is called.
Reviewers: hfinkel, t.p.northover, hvarga, kparzysz, jyknight, qcolombet, uweigand
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D11665
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244557
91177308-0d34-0410-b5e6-
96231b3b80d8
Tyler Nowicki [Tue, 11 Aug 2015 01:09:15 +0000 (01:09 +0000)]
Print vectorization analysis when loop hint is specified.
This patch and a relatec clang patch solve the problem of having to explicitly enable analysis when specifying a loop hint pragma to get the diagnostics. Passing AlwasyPrint as the pass name (see below) causes the front-end to print the diagnostic if the user has specified '-Rpass-analysis' without an '=<target-pass>’. Users of loop hints can pass that compiler option without having to specify the pass and they will get diagnostics for only those loops with loop hints.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244555
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Tue, 11 Aug 2015 01:05:16 +0000 (01:05 +0000)]
Update the syntax for load instruction in this example.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244554
91177308-0d34-0410-b5e6-
96231b3b80d8
Tyler Nowicki [Tue, 11 Aug 2015 00:52:54 +0000 (00:52 +0000)]
Moved LoopVectorizeHints and related functions before LoopVectorizationLegality and LoopVectorizationCostModel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244552
91177308-0d34-0410-b5e6-
96231b3b80d8
JF Bastien [Tue, 11 Aug 2015 00:49:20 +0000 (00:49 +0000)]
WebAssembly: simply assert on SNaN and NaNs with payloads
Summary: convertToHexString doesn't represent them correctly at this point in time. This is a follow-up to sunfish's suggestion in D11914.
Subscribers: llvm-commits, sunfish, jfb
Differential Revision: http://reviews.llvm.org/D11925
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244551
91177308-0d34-0410-b5e6-
96231b3b80d8
Tyler Nowicki [Tue, 11 Aug 2015 00:35:44 +0000 (00:35 +0000)]
Simplify processLoop() by moving loop hint verification into Hints::allowVectorization().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244550
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Tue, 11 Aug 2015 00:32:49 +0000 (00:32 +0000)]
MIR Serialization: Serialize UsedPhysRegMask from the machine register info.
This commit serializes the UsedPhysRegMask register mask from the machine
register information class. The mask is serialized as an inverted
'calleeSavedRegisters' mask to keep the output minimal.
This commit also allows the MIR parser to infer this mask from the register
mask operands if the machine function doesn't specify it.
Reviewers: Duncan P. N. Exon Smith
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244548
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Tue, 11 Aug 2015 00:26:05 +0000 (00:26 +0000)]
use range-based for loops; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244545
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Tue, 11 Aug 2015 00:24:39 +0000 (00:24 +0000)]
[libFuzzer] don't crash if the condition in a switch has unusual type (e.g. i72)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244544
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Tue, 11 Aug 2015 00:20:24 +0000 (00:20 +0000)]
Address post-commit review from r243378.
This checks that bork_directive occurs exactly twice in the test output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244543
91177308-0d34-0410-b5e6-
96231b3b80d8
Adam Nemet [Tue, 11 Aug 2015 00:09:37 +0000 (00:09 +0000)]
[LAA] Change name from addRuntimeCheck to addRuntimeChecks, NFC
This was requested by Hal in D11205.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244540
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Mon, 10 Aug 2015 23:50:41 +0000 (23:50 +0000)]
MIR Parser: Report an error when a stack object is redefined.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244536
91177308-0d34-0410-b5e6-
96231b3b80d8
Joerg Sonnenberger [Mon, 10 Aug 2015 23:47:22 +0000 (23:47 +0000)]
Add lduw and lwua aliases for SPARCv9.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244535
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Mon, 10 Aug 2015 23:45:02 +0000 (23:45 +0000)]
MIR Parser: Report an error when a fixed stack object is redefined.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244534
91177308-0d34-0410-b5e6-
96231b3b80d8
Joerg Sonnenberger [Mon, 10 Aug 2015 23:33:17 +0000 (23:33 +0000)]
Load/store for float registers from/to alternate space.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244532
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Mon, 10 Aug 2015 23:29:41 +0000 (23:29 +0000)]
use range-based for loop; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244531
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Mon, 10 Aug 2015 23:24:42 +0000 (23:24 +0000)]
MIR Serialization: Serialize the liveout register mask machine operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244529
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Mon, 10 Aug 2015 23:07:26 +0000 (23:07 +0000)]
fix minsize detection: minsize attribute implies optimizing for size
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244528
91177308-0d34-0410-b5e6-
96231b3b80d8
Adam Nemet [Mon, 10 Aug 2015 23:05:31 +0000 (23:05 +0000)]
[LoopVer] Remove unused pointer partition argument, NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244527
91177308-0d34-0410-b5e6-
96231b3b80d8
Tyler Nowicki [Mon, 10 Aug 2015 23:01:55 +0000 (23:01 +0000)]
Extend late diagnostics to include late test for runtime pointer checks.
This patch moves checking the threshold of runtime pointer checks to the vectorization requirements (late diagnostics) and emits a diagnostic that infroms the user the loop would be vectorized if not for exceeding the pointer-check threshold. Clang will also append the options that can be used to allow vectorization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244523
91177308-0d34-0410-b5e6-
96231b3b80d8
JF Bastien [Mon, 10 Aug 2015 22:36:48 +0000 (22:36 +0000)]
WebAssembly: print immediates
Summary:
For now output using C99's hexadecimal floating-point representation.
This patch also cleans up how machine operands are printed: instead of special-casing per type of machine instruction, the code now handles operands generically.
Reviewers: sunfish
Subscribers: llvm-commits, jfb
Differential Revision: http://reviews.llvm.org/D11914
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244520
91177308-0d34-0410-b5e6-
96231b3b80d8
Joerg Sonnenberger [Mon, 10 Aug 2015 22:32:25 +0000 (22:32 +0000)]
Add support for the signx instrution alias of SPARCv9.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244519
91177308-0d34-0410-b5e6-
96231b3b80d8
Cong Hou [Mon, 10 Aug 2015 22:27:10 +0000 (22:27 +0000)]
NFC. Fix some format issues in lib/CodeGen/MachineBasicBlock.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244518
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Bogner [Mon, 10 Aug 2015 21:58:27 +0000 (21:58 +0000)]
cmake: Make CMAKE_BUILD_TYPE check case-insensitive
Juergen pointed out that this variable is treated in a case
insensitive way.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244516
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Mon, 10 Aug 2015 21:47:36 +0000 (21:47 +0000)]
MachineVerifier: Handle the optional def operand in a PATCHPOINT instruction.
The PATCHPOINT instructions have a single optional defined register operand,
but the machine verifier can't verify the optional defined register operands.
This commit makes sure that the machine verifier won't report an error when a
PATCHPOINT instruction doesn't have its optional defined register operand.
This change will allow us to enable the machine verifier for the code
generation tests for the patchpoint intrinsics.
Reviewers: Juergen Ributzka
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244513
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Mon, 10 Aug 2015 21:47:11 +0000 (21:47 +0000)]
[llvm-symbolizer] Remove underscores and other C mangling on Windows
Summary:
This makes it so that reports symbolized after the fact with
llvm-symbolizer are more similar to the ones we generate at runtime with
in-process dbghelp.
Reviewers: samsonov
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D11785
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244512
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 10 Aug 2015 21:29:35 +0000 (21:29 +0000)]
Don't iterate over all sections in the ELFFile constructor.
With this we finally have an ELFFile that is O(1) to construct. This is helpful
for programs like lld which have to do their own section walk.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244510
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Mon, 10 Aug 2015 21:28:16 +0000 (21:28 +0000)]
remove function names from comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244509
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Mon, 10 Aug 2015 21:27:03 +0000 (21:27 +0000)]
StackMap: FastISel: Add an appropriate number of immediate operands to the
frame setup instruction.
This commit ensures that the stack map lowering code in FastISel adds an
appropriate number of immediate operands to the frame setup instruction.
The previous code added just one immediate operand, which was fine for a target
like AArch64, but on X86 the ADJCALLSTACKDOWN64 instruction needs two explicit
operands. This caused the machine verifier to report an error when the old code
added just one.
Reviewers: Juergen Ributzka
Differential Revision: http://reviews.llvm.org/D11853
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244508
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 10 Aug 2015 21:25:44 +0000 (21:25 +0000)]
Rename improperly named variable. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244507
91177308-0d34-0410-b5e6-
96231b3b80d8
Tyler Nowicki [Mon, 10 Aug 2015 21:14:38 +0000 (21:14 +0000)]
Make fp vectorization test X86 specified to avoid cost-model related problems on arm-thumb and hexagon.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244505
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 10 Aug 2015 21:00:15 +0000 (21:00 +0000)]
Add a test showing that objdump (and so ObjectFIle) can handle shndx.
It was already passing, we were just not testing the code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244504
91177308-0d34-0410-b5e6-
96231b3b80d8
JF Bastien [Mon, 10 Aug 2015 20:59:36 +0000 (20:59 +0000)]
x86: Emit LAHF/SAHF instead of PUSHF/POPF
NaCl's sandbox doesn't allow PUSHF/POPF out of security concerns (priviledged emulators have forgotten to mask system bits in the past, and EFLAGS's DF bit is a constant source of hilarity). Commit r220529 fixed PR20376 by saving cmpxchg's flags result using EFLAGS, this commit now generated LAHF/SAHF instead, for all of x86 (not just NaCl) because it leads to an overall performance gain over PUSHF/POPF.
As with the previous patch this code generation is pretty bad because it occurs very later, after register allocation, and in many cases it rematerializes flags which were already available (e.g. already in a register through SETE). Fortunately it's somewhat rare that this code needs to fire.
I did [[ https://github.com/jfbastien/benchmark-x86-flags | a bit of benchmarking ]], the results on an Intel Haswell E5-2690 CPU at 2.9GHz are:
| Time per call (ms) | Runtime (ms) | Benchmark |
| 0.
000012514 | 6257 | sete.i386 |
| 0.
000012810 | 6405 | sete.i386-fast |
| 0.
000010456 | 5228 | sete.x86-64 |
| 0.
000010496 | 5248 | sete.x86-64-fast |
| 0.
000012906 | 6453 | lahf-sahf.i386 |
| 0.
000013236 | 6618 | lahf-sahf.i386-fast |
| 0.
000010580 | 5290 | lahf-sahf.x86-64 |
| 0.
000010304 | 5152 | lahf-sahf.x86-64-fast |
| 0.
000028056 | 14028 | pushf-popf.i386 |
| 0.
000027160 | 13580 | pushf-popf.i386-fast |
| 0.
000023810 | 11905 | pushf-popf.x86-64 |
| 0.
000026468 | 13234 | pushf-popf.x86-64-fast |
Clearly `PUSHF`/`POPF` are suboptimal. It doesn't really seems to be worth teaching LLVM about individual flags, at least not for this purpose.
Reviewers: rnk, jvoung, t.p.northover
Subscribers: llvm-commits
Differential revision: http://reviews.llvm.org/D6629
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244503
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 10 Aug 2015 20:50:40 +0000 (20:50 +0000)]
Use higher level functions in llvm-objdump.
This matches the rest of llvm-objdump better and isolates it from upcoming
changes to ELFFile.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244500
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Mon, 10 Aug 2015 20:45:44 +0000 (20:45 +0000)]
fix minsize detection: minsize attribute implies optimizing for size
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244499
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Mon, 10 Aug 2015 20:34:34 +0000 (20:34 +0000)]
[x86, SSE]]add missing tests for load folding with partial register update
The minsize case is wrong; that will be fixed in the next commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244498
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 10 Aug 2015 20:25:04 +0000 (20:25 +0000)]
Delete getDotSymtabSec.
Another step in avoiding iterating over all sections in the ELFFile constructor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244496
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Mon, 10 Aug 2015 20:21:15 +0000 (20:21 +0000)]
[InstCombine] Move SSE2/AVX2 arithmetic vector shift folding to instcombiner
As discussed in D11760, this patch moves the (V)PSRA(WD) arithmetic shift-by-constant folding to InstCombine to match the logical shift implementations.
Differential Revision: http://reviews.llvm.org/D11886
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244495
91177308-0d34-0410-b5e6-
96231b3b80d8
Tyler Nowicki [Mon, 10 Aug 2015 20:13:32 +0000 (20:13 +0000)]
Removed unused and incorrectly implemented classof() on Optimization Remark base class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244494
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Mon, 10 Aug 2015 19:58:06 +0000 (19:58 +0000)]
[TableGen] NFC improving comments about what the tokenized identifiers will contain.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244493
91177308-0d34-0410-b5e6-
96231b3b80d8
Jonathan Roelofs [Mon, 10 Aug 2015 19:56:39 +0000 (19:56 +0000)]
Fix a few more cases of 'CHECK[^:]*$'. NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244491
91177308-0d34-0410-b5e6-
96231b3b80d8
Tyler Nowicki [Mon, 10 Aug 2015 19:51:46 +0000 (19:51 +0000)]
Late evaluation of the fast-math vectorization requirement.
This patch moves the verification of fast-math to just before vectorization is done. This way we can tell clang to append the command line options would that allow floating-point commutativity. Specifically those are enableing fast-math or specifying a loop hint.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244489
91177308-0d34-0410-b5e6-
96231b3b80d8
Jonathan Roelofs [Mon, 10 Aug 2015 19:22:55 +0000 (19:22 +0000)]
Fix another case of 'CHECK[^:]*$'. NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244486
91177308-0d34-0410-b5e6-
96231b3b80d8
Tyler Nowicki [Mon, 10 Aug 2015 19:14:16 +0000 (19:14 +0000)]
Modify diagnostic messages to clearly indicate the why interleaving wasn't done.
Sometimes interleaving is not beneficial, as determined by the cost-model and sometimes it is disabled by a loop hint (by the user). This patch modifies the diagnostic messages to make it clear why interleaving wasn't done.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244485
91177308-0d34-0410-b5e6-
96231b3b80d8
James Y Knight [Mon, 10 Aug 2015 19:11:39 +0000 (19:11 +0000)]
[Sparc] Implement i64 load/store support for 32-bit sparc.
The LDD/STD instructions can load/store a 64bit quantity from/to
memory to/from a consecutive even/odd pair of (32-bit) registers. They
are part of SparcV8, and also present in SparcV9. (Although deprecated
there, as you can store 64bits in one register).
As recommended on llvmdev in the thread "How to enable use of 64bit
load/store for 32bit architecture" from Apr 2015, I've modeled the
64-bit load/store operations as working on a v2i32 type, rather than
making i64 a legal type, but with few legal operations. The latter
does not (currently) work, as there is much code in llvm which assumes
that if i64 is legal, operations like "add" will actually work on it.
The same assumption does not hold for v2i32 -- for vector types, it is
workable to support only load/store, and expand everything else.
This patch:
- Adds a new register class, IntPair, for even/odd pairs of registers.
- Modifies the list of reserved registers, the stack spilling code,
and register copying code to support the IntPair register class.
- Adds support in AsmParser. (note that in asm text, you write the
name of the first register of the pair only. So the parser has to
morph the single register into the equivalent paired register).
- Adds the new instructions themselves (LDD/STD/LDDA/STDA).
- Hooks up the instructions and registers as a vector type v2i32. Adds
custom legalizer to transform i64 load/stores into v2i32 load/stores
and bitcasts, so that the new instructions can actually be
generated, and marks all operations other than load/store on v2i32
as needing to be expanded.
- Copies the unfortunate SelectInlineAsm hack from ARMISelDAGToDAG.
This hack undoes the transformation of i64 operands into two
arbitrarily-allocated separate i32 registers in
SelectionDAGBuilder. and instead passes them in a single
IntPair. (Arbitrarily allocated registers are not useful, asm code
expects to be receiving a pair, which can be passed to ldd/std.)
Also adds a bunch of test cases covering all the bugs I've added along
the way.
Differential Revision: http://reviews.llvm.org/D8713
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244484
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 10 Aug 2015 19:10:37 +0000 (19:10 +0000)]
rename toELFShdrIter to getSection and move it closer to getSymbol. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244483
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 10 Aug 2015 19:07:56 +0000 (19:07 +0000)]
toELFSymIter and getSymbol are now the same thing. Merge them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244482
91177308-0d34-0410-b5e6-
96231b3b80d8
Jonathan Roelofs [Mon, 10 Aug 2015 19:01:27 +0000 (19:01 +0000)]
Fix a bunch of trivial cases of 'CHECK[^:]*$' in the tests. NFCI
I looked into adding a warning / error for this to FileCheck, but there doesn't
seem to be a good way to avoid it triggering on the instances of it in RUN lines.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244481
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 10 Aug 2015 18:57:42 +0000 (18:57 +0000)]
Use continue to reduce indentation. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244480
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Mon, 10 Aug 2015 18:42:45 +0000 (18:42 +0000)]
[AArch64] Convert a conditional check that will always be true to an assert. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244479
91177308-0d34-0410-b5e6-
96231b3b80d8
Yaron Keren [Mon, 10 Aug 2015 18:27:51 +0000 (18:27 +0000)]
Recommit r244470+ r244471 together, the bot failed between them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244476
91177308-0d34-0410-b5e6-
96231b3b80d8
Igor Laevsky [Mon, 10 Aug 2015 18:23:58 +0000 (18:23 +0000)]
[IndVarSimplify] Make cost estimation in RewriteLoopExitValues smarter
Differential Revision: http://reviews.llvm.org/D11687
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244474
91177308-0d34-0410-b5e6-
96231b3b80d8
Yaron Keren [Mon, 10 Aug 2015 18:14:56 +0000 (18:14 +0000)]
Revert r244470 and 244471 while looking into it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244472
91177308-0d34-0410-b5e6-
96231b3b80d8
Yaron Keren [Mon, 10 Aug 2015 18:06:01 +0000 (18:06 +0000)]
Second part of r244470 (source file was unsaved in editor).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244471
91177308-0d34-0410-b5e6-
96231b3b80d8
Yaron Keren [Mon, 10 Aug 2015 18:03:35 +0000 (18:03 +0000)]
Really implement David Blaikie suggestion in full of seperating
variable initialization from its usage in the push_back making
collapse of the two statements unlikely even without a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244470
91177308-0d34-0410-b5e6-
96231b3b80d8
Mark Heffernan [Mon, 10 Aug 2015 17:28:08 +0000 (17:28 +0000)]
Add new llvm.loop.unroll.enable metadata.
This change adds the unroll metadata "llvm.loop.unroll.enable" which directs
the optimizer to unroll a loop fully if the trip count is known at compile time, and
unroll partially if the trip count is not known at compile time. This differs from
"llvm.loop.unroll.full" which explicitly does not unroll a loop if the trip count is not
known at compile time.
The "llvm.loop.unroll.enable" is intended to be added for loops annotated with
"#pragma unroll".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244466
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Mon, 10 Aug 2015 17:17:19 +0000 (17:17 +0000)]
Typo. Move comment closer to relevant code. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244465
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Mon, 10 Aug 2015 17:15:17 +0000 (17:15 +0000)]
fix minsize detection: minsize attribute implies optimizing for size
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244464
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Mon, 10 Aug 2015 17:00:44 +0000 (17:00 +0000)]
fix minsize detection: minsize attribute implies optimizing for size
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244463
91177308-0d34-0410-b5e6-
96231b3b80d8
Yaron Keren [Mon, 10 Aug 2015 16:53:30 +0000 (16:53 +0000)]
Fully apply David Blaikie suggestion and add comment explaining why.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244461
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Mon, 10 Aug 2015 16:47:47 +0000 (16:47 +0000)]
fix minsize detection: minsize attribute implies optimizing for size
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244460
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Mon, 10 Aug 2015 16:43:20 +0000 (16:43 +0000)]
fix minsize detection: minsize attribute implies optimizing for size
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244458
91177308-0d34-0410-b5e6-
96231b3b80d8
Yaron Keren [Mon, 10 Aug 2015 16:37:40 +0000 (16:37 +0000)]
Add missing include guard to FuzzerInternal.h, NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244457
91177308-0d34-0410-b5e6-
96231b3b80d8
Yaron Keren [Mon, 10 Aug 2015 16:15:51 +0000 (16:15 +0000)]
Modify r244405 to clearer code, per David Blaikie suggestion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244455
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Mon, 10 Aug 2015 15:22:39 +0000 (15:22 +0000)]
Silence a sign mismatch warning; NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244452
91177308-0d34-0410-b5e6-
96231b3b80d8
Silviu Baranga [Mon, 10 Aug 2015 14:50:54 +0000 (14:50 +0000)]
[TTI] Add a hook for specifying per-target defaults for Interleaved Accesses
Summary:
This adds a hook to TTI which enables us to selectively turn on by default
interleaved access vectorization for targets on which we have have performed
the required benchmarking.
Reviewers: rengolin
Subscribers: rengolin, llvm-commits
Differential Revision: http://reviews.llvm.org/D11901
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244449
91177308-0d34-0410-b5e6-
96231b3b80d8
Fraser Cormack [Mon, 10 Aug 2015 14:48:47 +0000 (14:48 +0000)]
Prevent the scalarizer from caching incorrect entries
The scalarizer can cache incorrect entries when walking up a chain of
insertelement instructions. This occurs when it encounters more than one
instruction that it is not actively searching for, as it unconditionally caches
every element it finds. The fix is to only cache the first element that it
isn't searching for so we don't overwrite correct entries.
Reviewers: hfinkel
Differential Revision: http://reviews.llvm.org/D11559
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244448
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 10 Aug 2015 14:27:50 +0000 (14:27 +0000)]
elf2yaml: Use existing section walk to find the symbol table. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244447
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Kruse [Mon, 10 Aug 2015 13:26:09 +0000 (13:26 +0000)]
[RegionInfo] Fix typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244445
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Kruse [Mon, 10 Aug 2015 13:21:59 +0000 (13:21 +0000)]
[RegionInfo] Add debug-time region viewer functions
Summary:
Analogously to Function::viewCFG(), RegionInfo::view() and RegionInfo::viewOnly() are meant to be called in debugging sessions. They open a viewer to show how RegionInfo currently understands the region hierarchy.
The functions viewRegion(Function*) and viewRegionOnly(Function*) invoke a fresh region analysis of the function in contrast to viewRegion(RegionInfo*) and viewRegionOnly(RegionInfo*) which show the current analysis result.
Reviewers: grosser
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D11875
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244444
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Kruse [Mon, 10 Aug 2015 12:57:23 +0000 (12:57 +0000)]
[RegionInfo] Use RegionInfo* instead of RegionInfoPass* as graph type
This allows printing region graphs when only the RegionInfo (e.g. Region::getRegionInfo()), but no RegionInfoPass object is available.
Specifically, we will use this to print RegionInfo graphs in the debugger.
Differential version: http://reviews.llvm.org/D11874
Reviewed-by: grosser
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244442
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Kruse [Mon, 10 Aug 2015 12:40:41 +0000 (12:40 +0000)]
[RegionInfo] Update old-style comments
Authorized-by: grosser
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244441
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Kruse [Mon, 10 Aug 2015 12:28:52 +0000 (12:28 +0000)]
[RegionInfo] More descriptive error messages in verifier
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244440
91177308-0d34-0410-b5e6-
96231b3b80d8
Robert Lougher [Mon, 10 Aug 2015 11:59:44 +0000 (11:59 +0000)]
Trace copies when checking for rematerializability in spill weight calculation
PR24139 contains an analysis of poor register allocation. One of the findings
was that when calculating the spill weight, a rematerializable interval once
split is no longer rematerializable. This is because the isRematerializable
check in CalcSpillWeights.cpp does not follow the copies introduced by live
range splitting (after splitting, the live interval register definition is a
copy which is not rematerializable).
Reviewers: qcolombet
Differential Revision: http://reviews.llvm.org/D11686
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244439
91177308-0d34-0410-b5e6-
96231b3b80d8
Marina Yatsina [Mon, 10 Aug 2015 11:33:10 +0000 (11:33 +0000)]
Test commit to verify commit access
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244438
91177308-0d34-0410-b5e6-
96231b3b80d8
Yaron Keren [Mon, 10 Aug 2015 07:04:29 +0000 (07:04 +0000)]
Rangify for loop, NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244434
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Mon, 10 Aug 2015 04:22:36 +0000 (04:22 +0000)]
Reformat headers in ADT and Support partially.
Note, I didn't reformat entirely, but partially where I touched in previous commits.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244432
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Mon, 10 Aug 2015 04:22:09 +0000 (04:22 +0000)]
Whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244431
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Mon, 10 Aug 2015 04:21:43 +0000 (04:21 +0000)]
Reformat linebreaks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244430
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Mon, 10 Aug 2015 04:21:19 +0000 (04:21 +0000)]
llvm/include/llvm/Support/Memory.h: Fix comment header.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244429
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 9 Aug 2015 22:03:04 +0000 (22:03 +0000)]
[TableGen] Make StringInit constructor take a StringRef instead of const std::string&. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244426
91177308-0d34-0410-b5e6-
96231b3b80d8
Saleem Abdulrasool [Sun, 9 Aug 2015 20:39:09 +0000 (20:39 +0000)]
X86: remove a dead store (NFC)
The SP was always unconditionally assigned to later, but initialised early.
This delays the initialisation, and avoids the dead store. Identified by
clang static analysis. No functional change intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244423
91177308-0d34-0410-b5e6-
96231b3b80d8