Jakob Stoklund Olesen [Sat, 9 Jun 2012 02:13:10 +0000 (02:13 +0000)]
Sketch a LiveRegMatrix analysis pass.
The LiveRegMatrix represents the live range of assigned virtual
registers in a Live interval union per register unit. This is not
fundamentally different from the interference tracking in RegAllocBase
that both RABasic and RAGreedy use.
The important differences are:
- LiveRegMatrix tracks interference per register unit instead of per
physical register. This makes interference checks cheaper and
assignments slightly more expensive. For example, the ARM D7 reigster
has 24 aliases, so we would check 24 physregs before assigning to one.
With unit-based interference, we check 2 units before assigning to 2
units.
- LiveRegMatrix caches regmask interference checks. That is currently
duplicated functionality in RABasic and RAGreedy.
- LiveRegMatrix is a pass which makes it possible to insert
target-dependent passes between register allocation and rewriting.
Such passes could tweak the register assignments with interference
checking support from LiveRegMatrix.
Eventually, RABasic and RAGreedy will be switched to LiveRegMatrix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158255
91177308-0d34-0410-b5e6-
96231b3b80d8
Jack Carter [Sat, 9 Jun 2012 00:27:55 +0000 (00:27 +0000)]
Test commit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158250
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Sat, 9 Jun 2012 00:14:47 +0000 (00:14 +0000)]
Also compute MBB live-in lists in the new rewriter pass.
This deduplicates some code from the optimizing register allocators, and
it means that it is now possible to change the register allocators'
solutions simply by editing the VirtRegMap between the register
allocator pass and the rewriter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158249
91177308-0d34-0410-b5e6-
96231b3b80d8
Dmitri Gribenko [Sat, 9 Jun 2012 00:01:45 +0000 (00:01 +0000)]
Convert comments to proper Doxygen comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158248
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Fri, 8 Jun 2012 23:56:26 +0000 (23:56 +0000)]
Removing strange "using" declarations form TargetInstrInfo.
I can't imagine why these were added. Trial and error.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158247
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Fri, 8 Jun 2012 23:44:45 +0000 (23:44 +0000)]
Reintroduce VirtRegRewriter.
OK, not really. We don't want to reintroduce the old rewriter hacks.
This patch extracts virtual register rewriting as a separate pass that
runs after the register allocator. This is possible now that
CodeGen/Passes.cpp can configure the full optimizing register allocator
pipeline.
The rewriter pass uses register assignments in VirtRegMap to rewrite
virtual registers to physical registers, and it inserts kill flags based
on live intervals.
These finalization steps are the same for the optimizing register
allocators: RABasic, RAGreedy, and PBQP.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158244
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Fri, 8 Jun 2012 23:15:12 +0000 (23:15 +0000)]
Don't run RAFast in the optimizing regalloc pipeline.
The fast register allocator is not supposed to work in the optimizing
pipeline. It doesn't make sense to compute live intervals, run full copy
coalescing, and then run RAFast.
Fast register allocation in the optimizing pipeline is better done by
RABasic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158242
91177308-0d34-0410-b5e6-
96231b3b80d8
Nuno Lopes [Fri, 8 Jun 2012 22:30:05 +0000 (22:30 +0000)]
canonicalize:
-%a + 42
into
42 - %a
previously we were emitting:
-(%a + 42)
This fixes the infinite loop in PR12338. The generated code is still not perfect, though.
Will work on that next
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158237
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Fri, 8 Jun 2012 21:53:50 +0000 (21:53 +0000)]
Start implementing pre-ra if-converter: using speculation and selects to eliminate branches.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158234
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Fri, 8 Jun 2012 21:52:38 +0000 (21:52 +0000)]
TargetInstrInfo hooks implemented in codegen should be declared pure virtual.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158233
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan Sands [Fri, 8 Jun 2012 20:15:33 +0000 (20:15 +0000)]
Reapply commit 158073 with a fix (the testcase was already committed). The
problem was that by moving instructions around inside the function, the pass
could accidentally move the iterator being used to advance over the function
too. Fix this by only processing the instruction equal to the iterator, and
leaving processing of instructions that might not be equal to the iterator
to later (later = after traversing the basic block; it could also wait until
after traversing the entire function, but this might make the sets quite big).
Original commit message:
Grab-bag of reassociate tweaks. Unify handling of dead instructions and
instructions to reoptimize. Exploit this to more systematically eliminate
dead instructions (this isn't very useful in practice but is convenient for
analysing some testcase I am working on). No need for WeakVH any more: use
an AssertingVH instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158226
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Fri, 8 Jun 2012 20:02:09 +0000 (20:02 +0000)]
Remove the TODO statement in the PPC README re: CTR loops
As Chris points out, this can now be removed!
TODO: check if the associated section on viterbi's inner loop can also be removed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158224
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Fri, 8 Jun 2012 19:19:53 +0000 (19:19 +0000)]
Enable PPC CTR loop formation by default.
Thanks to Jakob's help, this now causes no new test suite failures!
Over the entire test suite, this gives an average 1% speedup. The largest speedups are:
SingleSource/Benchmarks/Misc/pi - 108%
SingleSource/Benchmarks/CoyoteBench/lpbench - 54%
MultiSource/Benchmarks/Prolangs-C/unix-smail/unix-smail - 50%
SingleSource/Benchmarks/Shootout/ary3 - 32%
SingleSource/Benchmarks/Shootout-C++/matrix - 30%
The largest slowdowns are:
MultiSource/Benchmarks/mediabench/gsm/toast/toast - -30%
MultiSource/Benchmarks/Prolangs-C/bison/mybison - -25%
MultiSource/Benchmarks/BitBench/uuencode/uuencode - -22%
MultiSource/Applications/d/make_dparser - -14%
SingleSource/Benchmarks/Shootout-C++/ary - -13%
In light of these slowdowns, additional profiling work is obviously needed!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158223
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Fri, 8 Jun 2012 19:02:08 +0000 (19:02 +0000)]
Mark the PPC CTRRC and CTRRC8 register classes as non-allocatable.
Marking these classes as non-alocatable allows CTR loop generation to
work correctly with the block placement passes, etc. These register
classes are currently used only by some unused TCRETURN patterns.
In future cleanup, these will be removed.
Thanks again to Jakob for suggesting this fix to the CTR loop problem!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158221
91177308-0d34-0410-b5e6-
96231b3b80d8
Manman Ren [Fri, 8 Jun 2012 18:58:26 +0000 (18:58 +0000)]
Enable optimization for integer ABS on X86 if Subtarget has CMOV.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158220
91177308-0d34-0410-b5e6-
96231b3b80d8
Manman Ren [Fri, 8 Jun 2012 18:42:37 +0000 (18:42 +0000)]
Test case for r158160
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158218
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Fri, 8 Jun 2012 18:25:47 +0000 (18:25 +0000)]
Sched itinerary fix: Avoid static initializers.
This fixes an accidental dependence on static initialization order that I introduced yesterday.
Thank you Lang!!!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158215
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Fri, 8 Jun 2012 18:04:52 +0000 (18:04 +0000)]
Fix a crash in APInt::lshr when shiftAmt > BitWidth.
Patch by James Benton <jbenton@vmware.com>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158213
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Fri, 8 Jun 2012 17:23:27 +0000 (17:23 +0000)]
Fix Target->Codegen dependence.
Bulk move of TargetInstrInfo implementation into
TargetInstrInfoImpl. This is dirty because the code isn't part of
TargetInstrInfoImpl class, nor should it be, because the methods are
not target hooks. However, it's the current mechanism for keeping
libTarget useful outside the backend. You'll get a not-so-nice link
error if you invoke a TargetInstrInfo method that depends on CodeGen.
The TargetInstrInfoImpl class should probably be removed since it
doesn't really solve this problem.
To really fix this, we probably need separate interfaces for the
CodeGen/nonCodeGen sides of TargetInstrInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158212
91177308-0d34-0410-b5e6-
96231b3b80d8
Nuno Lopes [Fri, 8 Jun 2012 16:31:42 +0000 (16:31 +0000)]
BoundsChecking: add support for ConstantPointerNull. fixes a bunch of instrumentation failures in loops with reallocs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158210
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Fri, 8 Jun 2012 16:28:06 +0000 (16:28 +0000)]
test/CodeGen/Generic/APIntLoadStore.ll: Mark as XFAIL:ppc since r157911.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158209
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Fri, 8 Jun 2012 15:38:25 +0000 (15:38 +0000)]
Disable the PPC CTR-Loops pass by default.
The pass itself works well, but the something in the Machine* infrastructure
does not understand terminators which define registers. Without the ability
to use the block-placement pass, etc. this causes performance regressions (and
so is turned off by default). Turning off the analysis turns off the problems
with the Machine* infrastructure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158206
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Fri, 8 Jun 2012 15:38:23 +0000 (15:38 +0000)]
Fix a bug in the new PPC CTR-Loops pass.
The code which tests for an induction operation cannot assume that any
ADDI instruction will have a register operand because the operand could
also be a frame index; for example:
%vreg16<def> = ADDI8 <fi#0>, 0; G8RC:%vreg16
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158205
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Fri, 8 Jun 2012 15:38:21 +0000 (15:38 +0000)]
Add the PPCCTRLoops pass: a PPC machine-code-level optimization pass to form CTR-based loop branching code.
This pass is derived from the Hexagon HardwareLoops pass. The only significant enhancement over the Hexagon
pass is that PPCCTRLoops will also attempt to delete the replaced add and compare operations if they are
no longer otherwise used. Also, invalid preheader DebugLoc is not used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158204
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan Sands [Fri, 8 Jun 2012 13:37:30 +0000 (13:37 +0000)]
Revert commit 158073 while waiting for a fix. The issue is that reassociate
can move instructions within the instruction list. If the instruction just
happens to be the one the basic block iterator is pointing to, and it is
moved to a different basic block, then we get into an infinite loop due to
the iterator running off the end of the basic block (for some reason this
doesn't fire any assertions). Original commit message:
Grab-bag of reassociate tweaks. Unify handling of dead instructions and
instructions to reoptimize. Exploit this to more systematically eliminate
dead instructions (this isn't very useful in practice but is convenient for
analysing some testcase I am working on). No need for WeakVH any more: use
an AssertingVH instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158199
91177308-0d34-0410-b5e6-
96231b3b80d8
Tobias Grosser [Fri, 8 Jun 2012 09:41:23 +0000 (09:41 +0000)]
cmake: Pass the -m32 flag to modules if LLVM_BUILD_32_BITS is enabled
This was previously only done for executables and shared libraries, but not
for modules. As modules are essentially shared libraries (that need to be
dlopened explicitly), threating them the same as shared libraries seems
reasonable. This fixes the LLVM_BUILD_32_BITS build of Polly.
Contributed by: Ondra Hosek <ondra.hosek@gmail.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158195
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Fri, 8 Jun 2012 00:25:03 +0000 (00:25 +0000)]
Teach the AsmMatcherEmitter to allow InstAlias' where the suboperands of a complex operand are called out explicitly in the asm string.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158183
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael J. Spencer [Thu, 7 Jun 2012 23:33:56 +0000 (23:33 +0000)]
[CMake] Promote extension warnings to errors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158176
91177308-0d34-0410-b5e6-
96231b3b80d8
Manman Ren [Thu, 7 Jun 2012 22:39:10 +0000 (22:39 +0000)]
X86: optimize generated code for integer ABS
This patch will generate the following for integer ABS:
movl %edi, %eax
negl %eax
cmovll %edi, %eax
INSTEAD OF
movl %edi, %ecx
sarl $31, %ecx
leal (%rdi,%rcx), %eax
xorl %ecx, %eax
There exists a target-independent DAG combine for integer ABS, which converts
integer ABS to sar+add+xor. For X86, we match this pattern back to neg+cmov.
This is implemented in PerformXorCombine.
rdar://
10695237
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158175
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael J. Spencer [Thu, 7 Jun 2012 21:34:31 +0000 (21:34 +0000)]
[CMake] Order MSVC warnings numerically.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158171
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael J. Spencer [Thu, 7 Jun 2012 21:34:15 +0000 (21:34 +0000)]
[CMake] Adjust MSVC warnings.
Remove /Wall from LLVM_ENABLE_WARNINGS (it's useless) and promote 4239
to a level 1 warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158170
91177308-0d34-0410-b5e6-
96231b3b80d8
Nadav Rotem [Thu, 7 Jun 2012 20:53:48 +0000 (20:53 +0000)]
Do not optimize the used bits of the x86 vselect condition operand, when the condition operand is a vector of 1-bit predicates.
This may happen on MIC devices.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158168
91177308-0d34-0410-b5e6-
96231b3b80d8
Nadav Rotem [Thu, 7 Jun 2012 20:28:57 +0000 (20:28 +0000)]
Fix a bug in FoldSelectOpOp. Bitcast ops may change the number of vector elements, which may disagree with the select condition type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158166
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Thu, 7 Jun 2012 19:42:04 +0000 (19:42 +0000)]
Continue factoring computeOperandLatency. Use it for ARM hasHighOperandLatency.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158164
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Thu, 7 Jun 2012 19:42:00 +0000 (19:42 +0000)]
ARM getOperandLatency rewrite.
Match expectations of the new latency API. Cleanup and make the logic consistent.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158163
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Thu, 7 Jun 2012 19:41:58 +0000 (19:41 +0000)]
ARM getOperandLatency should return -1 for unknown, consistent with API
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158162
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Thu, 7 Jun 2012 19:41:55 +0000 (19:41 +0000)]
Fix ARM getInstrLatency logic to work with the current API.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158161
91177308-0d34-0410-b5e6-
96231b3b80d8
Manman Ren [Thu, 7 Jun 2012 19:27:33 +0000 (19:27 +0000)]
PR13046: we can't replace usage of SUB with CMP in the lowering phase.
It will cause assertion failure later on.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158160
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 7 Jun 2012 18:39:19 +0000 (18:39 +0000)]
Use a base register instead of an index register with the local dynamic model.
Fixes pr13048.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158158
91177308-0d34-0410-b5e6-
96231b3b80d8
Pete Cooper [Thu, 7 Jun 2012 17:41:39 +0000 (17:41 +0000)]
Move terminator machine verification to check MachineBasicBlock::instr_iterator instead of MBB::iterator
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158154
91177308-0d34-0410-b5e6-
96231b3b80d8
Pete Cooper [Thu, 7 Jun 2012 04:43:52 +0000 (04:43 +0000)]
Add internal read flags to MachineInstrBuilder and hook them into the MachineOperand flag of the same name
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158137
91177308-0d34-0410-b5e6-
96231b3b80d8
Meador Inge [Thu, 7 Jun 2012 01:02:13 +0000 (01:02 +0000)]
Adding a missing -S to the opt invocation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158128
91177308-0d34-0410-b5e6-
96231b3b80d8
Manman Ren [Thu, 7 Jun 2012 00:42:47 +0000 (00:42 +0000)]
X86: replace SUB with CMP if possible
This patch will optimize the following
movq %rdi, %rax
subq %rsi, %rax
cmovsq %rsi, %rdi
movq %rdi, %rax
to
cmpq %rsi, %rdi
cmovsq %rsi, %rdi
movq %rdi, %rax
Perform this optimization if the actual result of SUB is not used.
rdar:
11540023
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158126
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Wed, 6 Jun 2012 23:53:23 +0000 (23:53 +0000)]
Spell optimization name correclty.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158123
91177308-0d34-0410-b5e6-
96231b3b80d8
Manman Ren [Wed, 6 Jun 2012 23:53:03 +0000 (23:53 +0000)]
Revert r157755.
The commit is intended to fix rdar://
11540023.
It is implemented as part of peephole optimization. We can actually implement
this in the SelectionDAG lowering phase.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158122
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Wed, 6 Jun 2012 23:36:22 +0000 (23:36 +0000)]
Another testcase for r156548.
<rdar://problem/
10889741>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158121
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael J. Spencer [Wed, 6 Jun 2012 23:34:10 +0000 (23:34 +0000)]
[llvm-nm] Update documentation to cover object file support and arguments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158120
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Wed, 6 Jun 2012 22:34:30 +0000 (22:34 +0000)]
Properly verify liveness with bundled machine instructions.
Bundles should be treated as one atomic transaction when checking
liveness. That is how the register allocator (and VLIW targets) treats
bundles.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158116
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Wed, 6 Jun 2012 20:45:10 +0000 (20:45 +0000)]
Add accessors for all private members of DisasmContext.
LLVM should be -Wunused-private-field clean now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158103
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Wed, 6 Jun 2012 20:29:31 +0000 (20:29 +0000)]
Move RegisterClassInfo.h.
Allow targets to access this API. It's required for RegisterPressure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158102
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Wed, 6 Jun 2012 20:23:00 +0000 (20:23 +0000)]
Remove dead private member variables from gtest.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158101
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Wed, 6 Jun 2012 19:47:35 +0000 (19:47 +0000)]
Move RegisterPressure.h.
Make it a general utility for use by Targets.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158097
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Wed, 6 Jun 2012 19:47:08 +0000 (19:47 +0000)]
Round 2 of dead private variable removal.
LLVM is now -Wunused-private-field clean except for
- lib/MC/MCDisassembler/Disassembler.h. Not sure why it keeps all those unaccessible fields.
- gtest.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158096
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Wed, 6 Jun 2012 18:25:08 +0000 (18:25 +0000)]
Remove unused private fields found by clang's new -Wunused-private-field.
There are some that I didn't remove this round because they looked like
obvious stubs. There are dead variables in gtest too, they should be
fixed upstream.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158090
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Wed, 6 Jun 2012 17:37:40 +0000 (17:37 +0000)]
Add support for dynamic stack realignment in the presence of dynamic allocas on
X86.
rdar://
11496434
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158087
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Wed, 6 Jun 2012 17:22:40 +0000 (17:22 +0000)]
Fix combine of uno && ord -> false so that the ordering of the fcmps doesn't
matter.
rdar://
11579835
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158084
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Wed, 6 Jun 2012 16:22:41 +0000 (16:22 +0000)]
Remove dead debug option -disable-rematerialization.
Remat has been stable for years, and it isn't done by
LiveIntervalAnalysis any longer. (See LiveRangeEdit).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158079
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan Sands [Wed, 6 Jun 2012 14:53:10 +0000 (14:53 +0000)]
Grab-bag of reassociate tweaks. Unify handling of dead instructions and
instructions to reoptimize. Exploit this to more systematically eliminate
dead instructions (this isn't very useful in practice but is convenient for
analysing some testcase I am working on). No need for WeakVH any more: use
an AssertingVH instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158073
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Wed, 6 Jun 2012 13:53:41 +0000 (13:53 +0000)]
Stop leaking RegScavengers from TailDuplication.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158069
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Barton [Wed, 6 Jun 2012 09:12:53 +0000 (09:12 +0000)]
Correct decoder for T1 conditional B encoding
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158055
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan Sands [Wed, 6 Jun 2012 07:39:39 +0000 (07:39 +0000)]
Add a new broken compiler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158053
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Wed, 6 Jun 2012 06:45:27 +0000 (06:45 +0000)]
Mark several instructions SSE2 instead of SSE3 as they should be.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158049
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Holewinski [Wed, 6 Jun 2012 03:11:20 +0000 (03:11 +0000)]
Fix gtest build issue on Visual Studio 2012 RC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158046
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Wed, 6 Jun 2012 02:12:17 +0000 (02:12 +0000)]
Remove extraneous CHECK-NOTs from previous commit and add a new test case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158045
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Wed, 6 Jun 2012 01:38:32 +0000 (01:38 +0000)]
FileCheckize this test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158044
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Tue, 5 Jun 2012 23:57:30 +0000 (23:57 +0000)]
Move LiveUnionArray into LiveIntervalUnion.h
It is useful outside RegAllocBase.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158041
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Tue, 5 Jun 2012 23:07:19 +0000 (23:07 +0000)]
Don't print register names in LiveIntervalUnion::print().
Soon we'll be making LiveIntervalUnions for register units as well.
This was the only place using the RepReg member, so just remove it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158038
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Beaumont-Gay [Tue, 5 Jun 2012 23:00:03 +0000 (23:00 +0000)]
Suppress -Wunused-variable in -Asserts build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158037
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Tue, 5 Jun 2012 22:51:54 +0000 (22:51 +0000)]
Simplify LiveInterval::print().
Don't print out the register number and spill weight, making the TRI
argument unnecessary.
This allows callers to interpret the reg field. It can currently be a
virtual register, a physical register, a spill slot, or a register unit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158031
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Tue, 5 Jun 2012 22:02:15 +0000 (22:02 +0000)]
Add experimental support for register unit liveness.
Instead of computing a live interval per physreg, LiveIntervals can
compute live intervals per register unit. This makes impossible the
confusing situation where aliasing registers could have overlapping live
intervals. It should also make fixed interferernce checking cheaper
since registers have fewer register units than aliases.
Live intervals for regunits are computed on demand, using MRI use-def
chains and the new LiveRangeCalc class. Only regunits live in to ABI
blocks are precomputed during LiveIntervals::runOnMachineFunction().
The regunit liveness computations don't depend on LiveVariables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158029
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Tue, 5 Jun 2012 21:54:09 +0000 (21:54 +0000)]
Implement LiveRangeCalc::extendToUses() and createDeadDefs().
These LiveRangeCalc methods are to be used when computing a live range
from scratch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158027
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Tue, 5 Jun 2012 21:44:23 +0000 (21:44 +0000)]
MachineInstr::eraseFromParent fix for removing bundled instrs.
Patch by Ivan Llopard.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158025
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Tue, 5 Jun 2012 21:11:27 +0000 (21:11 +0000)]
misched: API for minimum vs. expected latency.
Minimum latency determines per-cycle scheduling groups.
Expected latency determines critical path and cost.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158021
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Tue, 5 Jun 2012 20:35:50 +0000 (20:35 +0000)]
Add 3.0 and 3.1 tags to the getting started guide.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158020
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Tue, 5 Jun 2012 19:07:46 +0000 (19:07 +0000)]
Add a new intrinsic: llvm.fmuladd. This intrinsic represents a multiply-add
expression (a * b + c) that can be implemented as a fused multiply-add (fma)
if the target determines that this will be more efficient. This intrinsic
will be used to implement FP_CONTRACT support and an aggressive FMA formation
mode.
If your target has a fast FMA instruction you should override the
isFMAFasterThanMulAndAdd method in TargetLowering to return true.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158014
91177308-0d34-0410-b5e6-
96231b3b80d8
Yuan Lin [Tue, 5 Jun 2012 19:06:13 +0000 (19:06 +0000)]
Fix header file include order in NVPTX backend NV_CONTRIB
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158013
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Tue, 5 Jun 2012 17:51:05 +0000 (17:51 +0000)]
LoopUnroll: always check for NULL LoopPassManager
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158007
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Tue, 5 Jun 2012 17:19:07 +0000 (17:19 +0000)]
Remove dead function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158005
91177308-0d34-0410-b5e6-
96231b3b80d8
Roman Divacky [Tue, 5 Jun 2012 17:14:17 +0000 (17:14 +0000)]
PPC32 uses R2 as the TLS register. Fix the copy and paste.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158004
91177308-0d34-0410-b5e6-
96231b3b80d8
Stepan Dyatkovskiy [Tue, 5 Jun 2012 07:57:36 +0000 (07:57 +0000)]
IntegersSubsetMapping: added exclude operation, that allows to exclude subset of integers from current mapping.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157989
91177308-0d34-0410-b5e6-
96231b3b80d8
Stepan Dyatkovskiy [Tue, 5 Jun 2012 07:43:08 +0000 (07:43 +0000)]
IntegersSubsetMapping:
Changed type of Items collection: from std::vector to std::list.
Also some small fixes made in IntegersSubset.h, IntegersSubsetMapping.h and IntegersSubsetTest.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157987
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Tue, 5 Jun 2012 03:44:46 +0000 (03:44 +0000)]
X86 itinerary properties.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157981
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Tue, 5 Jun 2012 03:44:43 +0000 (03:44 +0000)]
ARM itinerary properties.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157980
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Tue, 5 Jun 2012 03:44:40 +0000 (03:44 +0000)]
misched: Added MultiIssueItineraries.
This allows a subtarget to explicitly specify the issue width and
other properties without providing pipeline stage details for every
instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157979
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Tue, 5 Jun 2012 03:44:34 +0000 (03:44 +0000)]
sdsched: Use the right heuristics when -mcpu is not provided and we have no itinerary.
Use ILP heuristics for long latency instrs if no scoreboard exists.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157978
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Tue, 5 Jun 2012 03:44:32 +0000 (03:44 +0000)]
misched: Allow disabling scoreboard hazard checking for subtargets with a
valid itinerary but no pipeline stages.
An itinerary can contain useful scheduling information without specifying pipeline stages for each instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157977
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Tue, 5 Jun 2012 03:44:29 +0000 (03:44 +0000)]
whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157976
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Tue, 5 Jun 2012 03:44:26 +0000 (03:44 +0000)]
misched: comments from code review.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157975
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Tue, 5 Jun 2012 01:06:15 +0000 (01:06 +0000)]
Remove the last remat-related code from LiveIntervalAnalysis.
Rematerialization is handled by LiveRangeEdit now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157974
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Tue, 5 Jun 2012 01:06:12 +0000 (01:06 +0000)]
Stop using LiveIntervals::isReMaterializable().
It is an old function that does a lot more than required by
CalcSpillWeights, which was the only remaining caller.
The isRematerializable() function never actually sets the isLoad
argument, so don't try to compute that.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157973
91177308-0d34-0410-b5e6-
96231b3b80d8
Joel Jones [Tue, 5 Jun 2012 00:47:21 +0000 (00:47 +0000)]
Revert commit r157966
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157972
91177308-0d34-0410-b5e6-
96231b3b80d8
Joel Jones [Mon, 4 Jun 2012 23:38:57 +0000 (23:38 +0000)]
This change handles a another case for generating the bic instruction
when a compile time constant is known. This occurs when implicitly zero
extending function arguments from 16 bits to 32 bits.
<rdar://problem/
11481151>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157966
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Mon, 4 Jun 2012 23:01:41 +0000 (23:01 +0000)]
Delete dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157963
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 4 Jun 2012 22:44:21 +0000 (22:44 +0000)]
When gvn decides to replace an instruction with another, we have to patch the
replacement to make it at least as generic as the instruction being replaced.
This includes:
* dropping nsw/nuw flags
* getting the least restrictive tbaa and fpmath metadata
* merging ranges
Fixes PR12979.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157958
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Mon, 4 Jun 2012 22:39:14 +0000 (22:39 +0000)]
Switch LiveIntervals member variable to LLVM naming standards.
No functional change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157957
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Mon, 4 Jun 2012 18:21:16 +0000 (18:21 +0000)]
Pass context pointers to LiveRangeCalc::reset().
Remove the same pointers from all the other LiveRangeCalc functions,
simplifying the interface.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157941
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Mon, 4 Jun 2012 17:57:06 +0000 (17:57 +0000)]
Add a test case for mips64 unaligned load/store instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157939
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Mon, 4 Jun 2012 17:50:36 +0000 (17:50 +0000)]
Rename test/CodeGen/Mips/load-shift-left-right.ll.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157938
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Mon, 4 Jun 2012 17:46:29 +0000 (17:46 +0000)]
Fix a bug in MipsTargetLowering::LowerLOAD. A shift-right-logical node is
inserted after the shift-left-logical node.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157937
91177308-0d34-0410-b5e6-
96231b3b80d8
Roman Divacky [Mon, 4 Jun 2012 17:36:38 +0000 (17:36 +0000)]
Implement local-exec TLS on PowerPC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157935
91177308-0d34-0410-b5e6-
96231b3b80d8