Evan Cheng
2a81dd4a3c
First chunk of MachineInstr bundle support.
...
1. Added opcode BUNDLE
2. Taught MachineInstr class to deal with bundled MIs
3. Changed MachineBasicBlock iterator to skip over bundled MIs; added an iterator to walk all the MIs
4. Taught MachineBasicBlock methods about bundled MIs
llvm-svn: 145975
2011-12-06 22:12:01 +00:00
Jakob Stoklund Olesen
b91e489923
Trim an unneeded header.
...
llvm-svn: 137184
2011-08-09 23:49:21 +00:00
Rafael Espindola
f9f012ea88
Move most of the pre BB code to TailDuplicateAndUpdate. Change the
...
HasIndirectbr variable to be just that. No functionality change.
llvm-svn: 134371
2011-07-04 01:21:42 +00:00
Rafael Espindola
79dc4e7709
Reduce indentation and fix the count of how many PHIs we have inserted.
...
llvm-svn: 134370
2011-07-04 00:13:36 +00:00
Evan Cheng
6cc775f905
- Rename TargetInstrDesc, TargetOperandInfo to MCInstrDesc and MCOperandInfo and
...
sink them into MC layer.
- Added MCInstrInfo, which captures the tablegen generated static data. Chang
TargetInstrInfo so it's based off MCInstrInfo.
llvm-svn: 134021
2011-06-28 19:10:37 +00:00
Rafael Espindola
5135ae2383
Simplify
...
llvm-svn: 133798
2011-06-24 15:50:56 +00:00
Rafael Espindola
cb0213bda6
Now that bb with phis are not considered simple, duplicate them even if
...
we cannot duplicate to every predecessor.
llvm-svn: 133797
2011-06-24 15:47:41 +00:00
Rafael Espindola
ad0cdd5606
Simplify now that blocks with phis are not considered simple.
...
llvm-svn: 133793
2011-06-24 14:04:13 +00:00
Rafael Espindola
e25a8710e5
Move more logic to shouldTailDuplicate and only duplicate regular bb before
...
register allocation if it has a indirectbr or if we can duplicate it to
every predecessor.
This fixes the SingleSource/Benchmarks/Shootout-C++/matrix.cpp regression but
keeps the previous improvements to sunspider.
llvm-svn: 133682
2011-06-23 03:41:29 +00:00
Rafael Espindola
2496c1f1f8
Reenable tail duplication of bb with just an unconditional jump, but
...
don't remove blocks that have their address taken.
llvm-svn: 133659
2011-06-22 22:31:57 +00:00
Chad Rosier
cb7cfa4954
Revert r133607. This is causing failures in the Clang gccTestSuite.
...
Specifically, gcc.c-torture/compile/pr21356.c.
llvm-svn: 133646
2011-06-22 21:13:23 +00:00
Rafael Espindola
0850f709de
Reenable the optimization added in 133415, but change the definition of a "simple" bb to
...
be one with only one unconditional branch and no phis. Duplicating the phis in this case
is possible, but requeres liveness analysis or breaking edges.
llvm-svn: 133607
2011-06-22 04:01:58 +00:00
Rafael Espindola
02f262e942
Disable again.
...
llvm-svn: 133446
2011-06-20 17:04:08 +00:00
Rafael Espindola
336e10236f
Re enable 133415 with two fixes
...
* Don't introduce a duplicated bb in the CFG
* When making a branch unconditional, clear the PredCond array so that it
is really unconditional.
llvm-svn: 133432
2011-06-20 14:11:42 +00:00
Duncan Sands
406b9be057
Disable the logic added by rafael in commit 133415 to see if it brings the
...
dragonegg buildbots back to life. Original commit message:
Teach early dup how to duplicate basic blocks with one successor and only phi instructions
into more complex blocks.
llvm-svn: 133430
2011-06-20 09:26:23 +00:00
Francois Pichet
3f60acade6
Fix MSVC build. next() function already exists in the MSVC headers. This create a overload conflict. Make sure we pick up the llvm one.
...
llvm-svn: 133416
2011-06-20 05:19:37 +00:00
Rafael Espindola
ef636bffb5
Teach early dup how to duplicate basic blocks with one successor and only phi instructions
...
into more complex blocks.
llvm-svn: 133415
2011-06-20 04:16:35 +00:00
Rafael Espindola
e0304d1df9
Two fixes relating to debug value:
...
* We should change the generated code because of a debug use.
* Avoid creating debug uses of undef, as they become a kill.
Test to follow.
llvm-svn: 133255
2011-06-17 13:59:43 +00:00
Rafael Espindola
79a4b7e55c
Enable early duplication of small blocks. There are still improvements to
...
be made, but this is already a win.
llvm-svn: 133240
2011-06-17 05:54:50 +00:00
Rafael Espindola
0f62e4c428
Removed tabs. Also fixed my editor...
...
llvm-svn: 132857
2011-06-10 21:01:53 +00:00
Rafael Espindola
1ffadd7809
Remove duplicated test.
...
Thanks Bob Wilson for noticing it!
llvm-svn: 132851
2011-06-10 20:08:23 +00:00
Rafael Espindola
9e97a895f3
Make the optional verification step more strict.
...
llvm-svn: 132822
2011-06-09 23:55:56 +00:00
Rafael Espindola
c9e93a44be
Avoid a gcc warning about multiline comments.
...
llvm-svn: 132821
2011-06-09 23:51:45 +00:00
Rafael Espindola
c735f13368
On last fix to the early tail duplication.
...
With this I am able to bootstrap clang with early tail duplication enabled
for any small bb and setting tail-dup-size to a relatively large value(8) to
stress this code.
llvm-svn: 132816
2011-06-09 23:22:56 +00:00
Rafael Espindola
81512fc1bb
Also consider phi nodes when deciding if a register is live out.
...
llvm-svn: 132814
2011-06-09 22:53:47 +00:00
Rafael Espindola
c90a32a4e6
AnalyzeBranch modifies the bb, but we don't want to modify a bb with
...
eh edges. Swap the order of the checks to avoid it.
llvm-svn: 132806
2011-06-09 21:43:25 +00:00
Rafael Espindola
887fc1bdeb
A PHI in this basic block is a use in another basic block.
...
llvm-svn: 132805
2011-06-09 20:55:41 +00:00
Rafael Espindola
73f93930e0
Refactor some checks into shouldTailDuplicate. Update comments.
...
No functionality change.
llvm-svn: 132798
2011-06-09 19:54:42 +00:00
Rafael Espindola
eabd18b931
Fix count.
...
llvm-svn: 132749
2011-06-08 14:23:19 +00:00
Rafael Espindola
dfbf6de747
Count how many phis we are creating.
...
llvm-svn: 132748
2011-06-08 14:13:31 +00:00
Evan Cheng
f7073d1445
Update comments.
...
llvm-svn: 124843
2011-02-04 01:10:12 +00:00
Jakob Stoklund Olesen
9af7afcb7f
Respect the -tail-dup-size command line option even when optimizing for size.
...
This is similar to the -unroll-threshold option. There should be no change in
behavior when -tail-dup-size is not explicit on the llc command line.
llvm-svn: 124564
2011-01-30 20:38:12 +00:00
Evan Cheng
d983eba7dc
Re-apply r124518 with fix. Watch out for invalidated iterator.
...
llvm-svn: 124526
2011-01-29 04:46:23 +00:00
Evan Cheng
65b8ccf6ac
Revert r124518. It broke Linux self-host.
...
llvm-svn: 124522
2011-01-29 02:43:04 +00:00
Evan Cheng
d4eff31476
Re-commit r124462 with fixes. Tail recursion elim will now dup ret into unconditional predecessor to enable TCE on demand.
...
llvm-svn: 124518
2011-01-29 01:29:26 +00:00
Evan Cheng
aaa9606b2f
Revert r124462. There are a few big regressions that I need to fix first.
...
llvm-svn: 124478
2011-01-28 07:12:38 +00:00
Evan Cheng
417fca86c4
- Stop simplifycfg from duplicating "ret" instructions into unconditional
...
branches. PR8575, rdar://5134905, rdar://8911460.
- Allow codegen tail duplication to dup small return blocks after register
allocation is done.
llvm-svn: 124462
2011-01-28 02:19:21 +00:00
Jakob Stoklund Olesen
2fb5b31578
Simplify a bunch of isVirtualRegister() and isPhysicalRegister() logic.
...
These functions not longer assert when passed 0, but simply return false instead.
No functional change intended.
llvm-svn: 123155
2011-01-10 02:58:51 +00:00
Owen Anderson
a7aed18624
Reapply r110396, with fixes to appease the Linux buildbot gods.
...
llvm-svn: 110460
2010-08-06 18:33:48 +00:00
Owen Anderson
bda59bd247
Revert r110396 to fix buildbots.
...
llvm-svn: 110410
2010-08-06 00:23:35 +00:00
Owen Anderson
755aceb5d0
Don't use PassInfo* as a type identifier for passes. Instead, use the address of the static
...
ID member as the sole unique type identifier. Clean up APIs related to this change.
llvm-svn: 110396
2010-08-05 23:42:04 +00:00
Jakob Stoklund Olesen
37c42a3d02
Remove many calls to TII::isMoveInstr. Targets should be producing COPY anyway.
...
TII::isMoveInstr is going tobe completely removed.
llvm-svn: 108507
2010-07-16 04:45:42 +00:00
Jakob Stoklund Olesen
0c76d6ec21
Replace copyRegToReg with COPY everywhere in lib/CodeGen except for FastISel.
...
llvm-svn: 108062
2010-07-10 22:42:59 +00:00
Dan Gohman
779c69bbc5
Add a DebugLoc argument to TargetInstrInfo::copyRegToReg, so that it
...
doesn't have to guess.
llvm-svn: 103194
2010-05-06 20:33:48 +00:00
Devang Patel
a0bb715977
Ignore debug value instructions while analyzing BB for tail duplication.
...
llvm-svn: 98675
2010-03-16 21:02:07 +00:00
Chris Lattner
07293da97e
eliminate InvalidateLabel and LabelIDList from MMI and replace
...
them with a counter.
llvm-svn: 98462
2010-03-14 02:24:55 +00:00
Jakob Stoklund Olesen
75521cab3e
Reuse operand location when updating PHI instructions.
...
Calling RemoveOperand is very expensive on huge PHI instructions. This makes
early tail duplication run twice as fast on the Firefox JavaScript
interpreter.
llvm-svn: 95832
2010-02-11 00:34:33 +00:00
Chris Lattner
b06015aa69
move target-independent opcodes out of TargetInstrInfo
...
into TargetOpcodes.h. #include the new TargetOpcodes.h
into MachineInstr. Add new inline accessors (like isPHI())
to MachineInstr, and start using them throughout the
codebase.
llvm-svn: 95687
2010-02-09 19:54:29 +00:00
Bob Wilson
97598f0cba
Treat indirect branches specially only during pre-regalloc tail duplication,
...
not during the later post-alloc tail duplication.
llvm-svn: 93600
2010-01-16 00:42:25 +00:00
Jakob Stoklund Olesen
73ef9556dd
Simplify logic. Any functional change is unintended.
...
llvm-svn: 93540
2010-01-15 19:59:57 +00:00