Brian Gaeke
48b008db57
Apply simplification suggested by Chris: why assign() when operator = will do?
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13364 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-04 22:02:41 +00:00
John Criswell
4a9c90446d
Fixed inconsistent indentation.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13363 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-04 21:46:05 +00:00
Brian Gaeke
7ca6712f81
Missing piece of fix for Bug 333
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13362 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-04 21:41:45 +00:00
Brian Gaeke
7e4375365e
Correctly mangle function names when they are used as part of a
...
constant pool member's name.
This is intended to address Bug 333.
Also, fix an anachronistic usage of "M" as a parameter of type Function *.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13357 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-04 21:09:02 +00:00
Brian Gaeke
d11577b68b
Add "Args" optional argument to AbstractInterpreter factory methods, which
...
fills in a ToolArgs vector in the AbstractInterpreter if it is set. This
ToolArgs vector is used to pass additional arguments to LLI and/or LLC.
This is intended to address Bug 40.
Also, make -debug-only=toolrunner work for the LLC and CBE
AbstractInterpreters.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13356 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-04 21:09:01 +00:00
Chris Lattner
bbc130d110
Remove unneeded check
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13355 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-04 19:35:11 +00:00
Chris Lattner
c8af02c403
Improve signed division by power of 2 *dramatically* from this:
...
div:
mov %EDX, DWORD PTR [%ESP + 4]
mov %ECX, 64
mov %EAX, %EDX
sar %EDX, 31
idiv %ECX
ret
to this:
div:
mov %EAX, DWORD PTR [%ESP + 4]
mov %ECX, %EAX
sar %ECX, 5
shr %ECX, 26
mov %EDX, %EAX
add %EDX, %ECX
sar %EAX, 6
ret
Note that the intel compiler is currently making this:
div:
movl 4(%esp), %edx #3.5
movl %edx, %eax #4.14
sarl $5, %eax #4.14
shrl $26, %eax #4.14
addl %edx, %eax #4.14
sarl $6, %eax #4.14
ret #4.14
Which has one less register->register copy. (hint hint alkis :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13354 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-04 19:33:58 +00:00
Brian Gaeke
b171d7949d
Add stub support for reading BBTraces.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13352 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-04 17:11:14 +00:00
Chris Lattner
b9110c61fb
Do not mark instructions in unreachable sections of the function as live.
...
This fixes PR332 and ADCE/2004-05-04-UnreachableBlock.llx
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13349 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-04 17:00:46 +00:00
Brian Gaeke
660ef70b62
Share ProfilingType enum with the C profiling runtime libraries.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13346 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-04 16:53:07 +00:00
Chris Lattner
9eb9b8ecb9
Improve code generated for integer multiplications by 2,3,5,9
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13342 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-04 15:47:14 +00:00
Chris Lattner
32ed46b36e
Minor efficiency tweak, suggested by Patrick Meredith
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13341 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-04 15:19:33 +00:00
Brian Gaeke
96e68f9ab1
Fix typo
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13340 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-03 23:52:07 +00:00
Brian Gaeke
ebbc0e9bbf
In InsertProfilingInitCall(), make it legal to pass in a null array, in
...
which case you'll get a null array and zero passed to the profiling function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13336 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-03 22:06:33 +00:00
Brian Gaeke
c03eb7b923
Add initial implementation of basic-block tracing instrumentation pass.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13335 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-03 22:06:32 +00:00
Chris Lattner
7b11e339d2
Fix a problem with double freeing memory. For some reason, CallGraph is not
...
acting like a normal pass. :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13318 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-02 16:06:18 +00:00
Chris Lattner
224f7e65e0
Plug a minor memory leak
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13317 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-02 07:31:34 +00:00
Chris Lattner
bdcc0b8c55
Do not clone arbitrary condition instructions.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13316 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-02 05:19:36 +00:00
Chris Lattner
12fe2b1b82
Do not infinitely "unroll" single BB loops.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13315 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-02 05:02:03 +00:00
Chris Lattner
a1f79fb08b
Dont' merge terminators that are needed to select PHI node values.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13312 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-02 01:00:44 +00:00
Chris Lattner
e67fa05036
Implement SimplifyCFG/branch-cond-merge.ll
...
Turning "if (A < B && B < C)" into "if (A < B & B < C)"
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13311 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-01 23:35:43 +00:00
Chris Lattner
00d513182d
Make sure to reprocess instructions used by deleted instructions to avoid
...
missing opportunities for combination.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13309 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-01 23:27:23 +00:00
Chris Lattner
216d4d85fd
Make sure the instruction combiner doesn't lose track of instructions
...
when replacing them, missing the opportunity to do simplifications
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13308 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-01 23:19:52 +00:00
Chris Lattner
951fdb9764
Fix my missing parens
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13307 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-01 22:41:51 +00:00
Chris Lattner
92da2c2053
Implement SimplifyCFG/branch-cond-prop.ll
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13306 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-01 22:36:37 +00:00
Chris Lattner
77993632a1
Remove unused #include
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13304 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-01 21:29:16 +00:00
Chris Lattner
2268684f6f
Iterate over the Machine CFG that Brian added instead of the LLVM CFG.
...
Look at all of the pretty minuses. :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13303 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-01 21:27:53 +00:00
Chris Lattner
015959ee38
Operate on the Machine CFG instead of on the LLVM CFG
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13302 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-01 21:24:39 +00:00
Chris Lattner
f25fb4bc64
Stop LiveVariables from using BasicBlocks as part of the mapping, instead
...
use MachineBasicBlocks. To do this, we traverse the Machine CFG instead of
the LLVM CFG, which is also *MUCH* more efficient by having fewer levels of
indirections and mappings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13301 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-01 21:24:24 +00:00
Chris Lattner
55a4700857
Add a constructor that got lost
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13297 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-01 11:17:13 +00:00
Brian Gaeke
3c66c355b6
Generalize the strlen size_t hack, for the benefit of the other external
...
functions with wrappers that either take or return size_ts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13296 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-01 06:42:15 +00:00
Tanya Lattner
0e1c48b209
Removing MachineResource class.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13291 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-30 20:40:38 +00:00
Chris Lattner
c1526a9da1
Fix a major pessimization in the instcombiner. If an allocation instruction
...
is only used by a cast, and the casted type is the same size as the original
allocation, it would eliminate the cast by folding it into the allocation.
Unfortunately, it was placing the new allocation instruction right before
the cast, which could pull (for example) alloca instructions into the body
of a function. This turns statically allocatable allocas into expensive
dynamically allocated allocas, which is bad bad bad.
This fixes the problem by placing the new allocation instruction at the same
place the old one was, duh. :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13289 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-30 04:37:52 +00:00
Misha Brukman
96a8bd7f54
Wrapped code and comments at 80 cols; doxygenified some comments.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13264 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-29 04:05:30 +00:00
Misha Brukman
bf94a1e22a
Reorder #includes as per style guide.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13263 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-29 04:04:47 +00:00
Misha Brukman
e5242def97
class AssemblyWriter:
...
* Make contained ostream pointer, not reference
* Allow setting of that ostream via setStream()
class CachedWriter:
* setStream() in turn calls setStream() on the AssemblyWriter
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13247 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-28 19:24:28 +00:00
Misha Brukman
8618e52be5
Send text and numbers directly to CachedWriter's contained ostream.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13243 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-28 18:52:43 +00:00
Misha Brukman
500acf72cc
Squelch compile-time warning (profile build).
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13228 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-28 15:32:09 +00:00
Misha Brukman
5cf1acff3c
* Add ability to print out type as symbolic
...
* Add Module accessor to AssemblyWriter
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13227 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-28 15:31:21 +00:00
Brian Gaeke
1afe7736ff
Make RequiresFPRegKill() take a MachineBasicBlock arg.
...
In InsertFPRegKills(), just check the MachineBasicBlock for successors
instead of its corresponding BasicBlock.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13213 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-28 04:45:55 +00:00
Brian Gaeke
235aa5eba7
In InsertFPRegKills(), use the machine-CFG itself rather than the
...
LLVM CFG when trying to find the successors of BB.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13212 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-28 04:34:16 +00:00
Brian Gaeke
ea9ca67304
Update the machine-CFG edges whenever we see a branch.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13211 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-28 04:19:37 +00:00
Brian Gaeke
235d3b7b52
Integrate the rest of my random sparcv9 scribblings into this file
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13204 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-27 22:04:03 +00:00
Chris Lattner
003d5173ca
Fix warning building in optimized mode
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13190 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-27 18:24:38 +00:00
Chris Lattner
6ffe551f65
Changes to fix up the inst_iterator to pass to boost iterator checks. This
...
patch was graciously contributed by Vladimir Prus.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13185 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-27 15:13:33 +00:00
Brian Gaeke
c6e2d8a2ff
Add functions that return instances of these printer passes
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13175 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-26 16:27:08 +00:00
Chris Lattner
bac7da8461
If an object is not in the scalar map then it must be a global from another
...
graph.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13173 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-26 14:44:08 +00:00
Chris Lattner
83a2e6e4a1
Instcombine X/-1 --> 0-X
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13172 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-26 14:01:59 +00:00
Brian Gaeke
3ca4fccac5
Fix file header comments and include guards -- many files have been moved or
...
renamed since they were last spiffed up, or they just never had proper comments
in the first place.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13148 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-25 07:04:49 +00:00
Brian Gaeke
27beae85a0
Add a getRegisterInfo() accessor just like on the X86 target.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13147 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-25 06:32:28 +00:00
Brian Gaeke
c991586b92
Regularize file header comment and include guard.
...
Include SparcV9RegisterInfo.h.
Add a getRegisterInfo() accessor and SparcV9RegisterInfo instance, just like
on the X86 target.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13146 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-25 06:32:16 +00:00
Brian Gaeke
2363b4ef5b
Add MRegisterInfo subclass for the SparcV9 target (containing only stub
...
functions for now). This automatically turns on the printing of machine
registers using their own real names, instead of goofy things like %mreg(42),
and allows us to migrate code incrementally to the new interface as we see fit.
The register file description it uses is hand-written, so that the register
numbers will match the ones that the SparcV9 target already uses.
Perhaps someday we'll tablegen it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13145 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-25 06:32:05 +00:00
Misha Brukman
22108fac63
* Allow aggregating extracted function arguments (controlled by flag)
...
* Commandline option (for now) controls that flag that is passed in
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13141 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-23 23:54:17 +00:00
Brian Gaeke
dd6d822fa6
Fix a typo.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13136 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-23 21:45:02 +00:00
Chris Lattner
4a7553e2da
Move the scev expansion code into this pass, where it belongs. There is
...
still room for cleanup, but at least the code modification is out of the
analysis now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13135 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-23 21:29:48 +00:00
Chris Lattner
b06432c276
Eliminate all of the SCEV Expansion code which is really part of the
...
IndVars pass, not part of SCEV *analysis*.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13134 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-23 21:29:03 +00:00
Brian Gaeke
18f9f66369
Merge TargetRegInfo.h into SparcV9RegInfo.h, which is its only subclass.
...
This prepares us to be able to de-virtualize and de-abstract it, and
take the register allocator bits out and move them into the register allocator
proper...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13127 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-23 18:15:48 +00:00
Brian Gaeke
3b2e5e619e
Include SparcV9RegInfo.h instead of TargetRegInfo.h.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13126 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-23 18:15:47 +00:00
Brian Gaeke
35450d2aaa
Include SparcV9RegInfo.h instead of TargetRegInfo.h. This serves as a bit of
...
documentation that this module needs to be made independent of the
register file description of the current target.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13125 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-23 18:15:46 +00:00
Brian Gaeke
4d529bc07b
Get rid of the old byte-at-a-time emission code used when the Sparc JIT was
...
being tested on X86, as per Chris's request.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13124 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-23 18:10:38 +00:00
Brian Gaeke
b440dea57b
Go back to the interpreter main loop after performing intrinsic lowering,
...
because 1) the first instruction might not be a call site, and
2) CS and SF.Caller were not getting set to point to the new call site
anyway (resulting in a crash on e.g. call %llvm.memset).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13122 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-23 18:05:28 +00:00
Brian Gaeke
b61fc83ecb
Use emitWordAt() to emit forward-branch fixups.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13120 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-23 17:11:16 +00:00
Brian Gaeke
62c6f879ae
Emit SPARC machine code a word at a time instead of a byte at a time.
...
Use emitWordAt() to emit forward-branch fixups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13119 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-23 17:11:15 +00:00
Brian Gaeke
aea1b58f1e
Implement emitWordAt() for the JIT emitter.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13118 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-23 17:11:14 +00:00
Brian Gaeke
da8246bb71
Implement emitWordAt() for the debug emitter and the file printer emitter. (I
...
am not so sure about the file printer emitter, but the debug emitter change
should be harmless.)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13117 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-23 17:11:13 +00:00
Misha Brukman
7d248397a7
Clarify the logic: the flag is renamed to `deleteFn' to signify it will delete
...
the function instead of isolating it. This also means the condition is reversed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13112 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-22 23:00:51 +00:00
Misha Brukman
79906c9825
Add a flag to choose between isolating a function or deleting the function from
...
the Module. The default behavior keeps functionality as before: the chosen
function is the one that remains.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13111 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-22 22:52:22 +00:00
Chris Lattner
b4782d13d1
Disable a previous patch that was causing indvars to loop infinitely :(
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13108 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-22 15:12:36 +00:00
Chris Lattner
fcb81f5f4c
Fix an extremely serious thinko I made in revision 1.60 of this file.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13106 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-22 14:59:40 +00:00
Chris Lattner
1363e85df7
Implement a todo, rewriting all possible scev expressions inside of the
...
loop. This eliminates the extra add from the previous case, but it's
not clear that this will be a performance win overall. Tommorows test
results will tell. :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13103 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-21 23:36:08 +00:00
Chris Lattner
4e5f03602c
This code really wants to iterate over the OPERANDS of an instruction, not
...
over its USES. If it's dead it doesn't have any uses! :)
Thanks to the fabulous and mysterious Bill Wendling for pointing this out. :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13102 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-21 22:29:37 +00:00
Chris Lattner
5d461d20ae
Implement a fixme. The helps loops that have induction variables of different
...
types in them. Instead of creating an induction variable for all types, it
creates a single induction variable and casts to the other sizes. This generates
this code:
no_exit: ; preds = %entry, %no_exit
%indvar = phi uint [ %indvar.next, %no_exit ], [ 0, %entry ] ; <uint> [#uses=4]
*** %j.0.0 = cast uint %indvar to short ; <short> [#uses=1]
%indvar = cast uint %indvar to int ; <int> [#uses=1]
%tmp.7 = getelementptr short* %P, uint %indvar ; <short*> [#uses=1]
store short %j.0.0, short* %tmp.7
%inc.0 = add int %indvar, 1 ; <int> [#uses=2]
%tmp.2 = setlt int %inc.0, %N ; <bool> [#uses=1]
%indvar.next = add uint %indvar, 1 ; <uint> [#uses=1]
br bool %tmp.2, label %no_exit, label %loopexit
instead of:
no_exit: ; preds = %entry, %no_exit
%indvar = phi ushort [ %indvar.next, %no_exit ], [ 0, %entry ] ; <ushort> [#uses=2]
*** %indvar = phi uint [ %indvar.next, %no_exit ], [ 0, %entry ] ; <uint> [#uses=3]
%indvar = cast uint %indvar to int ; <int> [#uses=1]
%indvar = cast ushort %indvar to short ; <short> [#uses=1]
%tmp.7 = getelementptr short* %P, uint %indvar ; <short*> [#uses=1]
store short %indvar, short* %tmp.7
%inc.0 = add int %indvar, 1 ; <int> [#uses=2]
%tmp.2 = setlt int %inc.0, %N ; <bool> [#uses=1]
%indvar.next = add uint %indvar, 1
*** %indvar.next = add ushort %indvar, 1
br bool %tmp.2, label %no_exit, label %loopexit
This is an improvement in register pressure, but probably doesn't happen that
often.
The more important fix will be to get rid of the redundant add.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13101 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-21 22:22:01 +00:00
Chris Lattner
3e1358a9fa
Fix an incredibly nasty iterator invalidation problem. I am too spoiled by ilists :)
...
Eventually it would be nice if CallGraph maintained an ilist of CallGraphNode's instead
of a vector of pointers to them, but today is not that day.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13100 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-21 20:44:33 +00:00
Misha Brukman
af76cfb0fb
I'm allergic to the word `stuff'.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13096 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-21 18:27:56 +00:00
Brian Gaeke
6896a7dd43
Make SparcV9RegInfo::getRegType() return the right answer for registers
...
of IntCC, FloatCC, and Special types.
Make SparcV9RegInfo::getRegClassIDOfRegType() return the right answer
if you ask for the class corresponding to SpecialRegType.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13095 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-21 17:53:58 +00:00
Alkis Evlogimenos
09233fb86e
Include cerrno (gcc-3.4 fix)
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13091 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-21 16:11:40 +00:00
Chris Lattner
107fb18d89
Fix typeo
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13089 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-21 14:23:18 +00:00
Chris Lattner
68d57e7ae8
REALLY fix PR324: don't delete linkonce functions until after the SCC traversal
...
is done, which avoids invalidating iterators in the SCC traversal routines
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13088 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-20 22:06:53 +00:00
Chris Lattner
72035995d5
Pass the callgraph not the module
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13087 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-20 21:52:26 +00:00
Chris Lattner
a10df50282
Add the ability for SCC passes to initialize and finalize themselves
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13084 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-20 21:30:06 +00:00
Chris Lattner
c99acc3709
Fix PR325
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13081 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-20 20:26:03 +00:00
Chris Lattner
5ad2b1d544
Fix PR324 and testcase: Inline/2004-04-20-InlineLinkOnce.llx
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13080 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-20 20:20:59 +00:00
Brian Gaeke
3f083d5de6
Make it legal to ask for the type of a specialreg
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13078 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-20 20:12:57 +00:00
Chris Lattner
759d34ffb7
Add support for the select instruction
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13076 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-20 16:43:21 +00:00
Brian Gaeke
0eb61037f7
Make it legal to request a load or store of %fsr.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13073 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-19 19:12:12 +00:00
Brian Gaeke
94178e9fca
Regularize include guards and remove some excess whitespace.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13071 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-19 18:53:44 +00:00
Brian Gaeke
03b562aecb
Tighten up SparcV9FloatCCRegClass::getRegName()'s assertion - if you ask it for
...
the name of %fsr (as the comment in SparcV9RegClassInfo.h used to suggest)
you would walk off the end of the FloatCCRegName array.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13070 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-19 18:53:43 +00:00
Brian Gaeke
854db8a29a
Regularize include guards, remove some excess whitespace and fix some comments.
...
Remove the extra %fsr register from SparcV9FloatCCRegClass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13069 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-19 18:53:42 +00:00
Chris Lattner
18f16094c2
Initial checkin of a simple loop unswitching pass. It still needs work,
...
but it's a start, and seems to do it's basic job.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13068 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-19 18:07:02 +00:00
Chris Lattner
45a1cf87d4
It's not just a printer, it's actually an analysis too
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13064 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-19 03:42:32 +00:00
Chris Lattner
446b86d381
Remove code to update loop depths
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13058 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-19 03:02:09 +00:00
Chris Lattner
5864aebe92
Add #include
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13057 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-19 03:01:23 +00:00
Chris Lattner
3280f7bd55
Move isLoopInvariant to the Loop class
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13051 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-18 22:46:08 +00:00
Chris Lattner
85661d0978
Add new method
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13050 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-18 22:45:27 +00:00
Chris Lattner
59fb87d469
Correct rewriting of exit blocks after my last patch
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13048 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-18 22:27:10 +00:00
Chris Lattner
343c0cfa19
Fix computation of exit blocks
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13047 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-18 22:21:41 +00:00
Chris Lattner
5fa802fe27
Loop exit sets are no longer explicitly held, they are dynamically computed on demand.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13046 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-18 22:15:13 +00:00
Chris Lattner
f1ab4b4eac
Change the ExitBlocks list from being explicitly contained in the Loop
...
structure to being dynamically computed on demand. This makes updating
loop information MUCH easier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13045 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-18 22:14:10 +00:00
Chris Lattner
e3a55865bb
Reduce the unrolling limit
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13040 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-18 18:06:14 +00:00
Chris Lattner
cc43909bb6
If the preheader of the loop was the entry block of the function, make sure
...
that the exit block of the loop becomes the new entry block of the function.
This was causing a verifier assertion on 252.eon.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13039 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-18 17:38:42 +00:00
Chris Lattner
998f44f859
Be much more careful about how we update instructions outside of the loop
...
using instructions inside of the loop. This should fix the MishaTest failure
from last night.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13038 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-18 17:32:39 +00:00
Chris Lattner
3048bd1d3e
Implement method
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13036 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-18 06:54:48 +00:00
Chris Lattner
50ca0a195a
After unrolling our single basic block loop, fold it into the preheader and exit
...
block. The primary motivation for doing this is that we can now unroll nested loops.
This makes a pretty big difference in some cases. For example, in 183.equake,
we are now beating the native compiler with the CBE, and we are a lot closer
with LLC.
I'm now going to play around a bit with the unroll factor and see what effect
it really has.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13034 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-18 06:27:43 +00:00
Chris Lattner
9c2cc4626b
Fix a bug: this does not preserve the CFG!
...
While we're at it, add support for updating loop information correctly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13033 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-18 05:38:37 +00:00
Chris Lattner
24199db80e
Add a new method, add a check missing that caused a segfault if a loop didn't
...
have a canonical indvar
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13032 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-18 05:38:05 +00:00
Chris Lattner
83bf2880c3
Initial checkin of a simple loop unroller. This pass is extremely basic and
...
limited. Even in it's extremely simple state (it can only *fully* unroll single
basic block loops that execute a constant number of times), it already helps improve
performance a LOT on some benchmarks, particularly with the native code generators.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13028 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-18 05:20:17 +00:00
Chris Lattner
3c85eef81a
Make the tail duplication threshold accessible from the command line instead of hardcoded
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13025 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-18 00:52:43 +00:00
Chris Lattner
f57a43da9c
Fix a memory leak. We leaked the vector holding the entries in switch tables.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13023 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-17 23:49:15 +00:00
Chris Lattner
3221ad0db7
Add the ability to compute exit values for complex loop using unanalyzable
...
operations. This allows us to compile this testcase:
int main() {
int h = 1;
do h = 3 * h + 1; while (h <= 256);
printf("%d\n", h);
return 0;
}
into this:
int %main() {
entry:
call void %__main( )
%tmp.6 = call int (sbyte*, ...)* %printf( sbyte* getelementptr ([4 x sbyte]* %.str_1, long 0, long 0), int 364 ) ; <int> [#uses=0]
ret int 0
}
This testcase was taken directly from 256.bzip2, believe it or not.
This code is not as general as I would like. Next up is to refactor it
a bit to handle more cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13019 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-17 22:58:41 +00:00
Chris Lattner
20aa098ba6
If the loop executes a constant number of times, try a bit harder to replace
...
exit values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13018 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-17 18:44:09 +00:00
Chris Lattner
7980fb9007
Add the ability to compute trip counts that are only controlled by constants
...
even if the loop is using expressions that we can't compute as a closed-form.
This allows us to calculate that this function always returns 55:
int test() {
double X;
int Count = 0;
for (X = 100; X > 1; X = sqrt(X), ++Count)
/*empty*/;
return Count;
}
And allows us to compute trip counts for loops like:
int h = 1;
do h = 3 * h + 1; while (h <= 256);
(which occurs in bzip2), and for this function, which occurs after inlining
and other optimizations:
int popcount()
{
int x = 666;
int result = 0;
while (x != 0) {
result = result + (x & 0x1);
x = x >> 1;
}
return result;
}
We still cannot compute the exit values of result or h in the two loops above,
which means we cannot delete the loop, but we are getting closer. Being able to
compute a constant trip count for these two loops will allow us to unroll them
completely though.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13017 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-17 18:36:24 +00:00
Chris Lattner
4f1134e51a
Fix a HUGE pessimization on X86. The indvars pass was taking this
...
(familiar) function:
int _strlen(const char *str) {
int len = 0;
while (*str++) len++;
return len;
}
And transforming it to use a ulong induction variable, because the type of
the pointer index was left as a constant long. This is obviously very bad.
The fix is to shrink long constants in getelementptr instructions to intptr_t,
making the indvars pass insert a uint induction variable, which is much more
efficient.
Here's the before code for this function:
int %_strlen(sbyte* %str) {
entry:
%tmp.13 = load sbyte* %str ; <sbyte> [#uses=1]
%tmp.24 = seteq sbyte %tmp.13, 0 ; <bool> [#uses=1]
br bool %tmp.24, label %loopexit, label %no_exit
no_exit: ; preds = %entry, %no_exit
*** %indvar = phi uint [ %indvar.next, %no_exit ], [ 0, %entry ] ; <uint> [#uses=2]
*** %indvar = phi ulong [ %indvar.next, %no_exit ], [ 0, %entry ] ; <ulong> [#uses=2]
%indvar1 = cast ulong %indvar to uint ; <uint> [#uses=1]
%inc.02.sum = add uint %indvar1, 1 ; <uint> [#uses=1]
%inc.0.0 = getelementptr sbyte* %str, uint %inc.02.sum ; <sbyte*> [#uses=1]
%tmp.1 = load sbyte* %inc.0.0 ; <sbyte> [#uses=1]
%tmp.2 = seteq sbyte %tmp.1, 0 ; <bool> [#uses=1]
%indvar.next = add ulong %indvar, 1 ; <ulong> [#uses=1]
%indvar.next = add uint %indvar, 1 ; <uint> [#uses=1]
br bool %tmp.2, label %loopexit.loopexit, label %no_exit
loopexit.loopexit: ; preds = %no_exit
%indvar = cast uint %indvar to int ; <int> [#uses=1]
%inc.1 = add int %indvar, 1 ; <int> [#uses=1]
ret int %inc.1
loopexit: ; preds = %entry
ret int 0
}
Here's the after code:
int %_strlen(sbyte* %str) {
entry:
%inc.02 = getelementptr sbyte* %str, uint 1 ; <sbyte*> [#uses=1]
%tmp.13 = load sbyte* %str ; <sbyte> [#uses=1]
%tmp.24 = seteq sbyte %tmp.13, 0 ; <bool> [#uses=1]
br bool %tmp.24, label %loopexit, label %no_exit
no_exit: ; preds = %entry, %no_exit
*** %indvar = phi uint [ %indvar.next, %no_exit ], [ 0, %entry ] ; <uint> [#uses=3]
%indvar = cast uint %indvar to int ; <int> [#uses=1]
%inc.0.0 = getelementptr sbyte* %inc.02, uint %indvar ; <sbyte*> [#uses=1]
%inc.1 = add int %indvar, 1 ; <int> [#uses=1]
%tmp.1 = load sbyte* %inc.0.0 ; <sbyte> [#uses=1]
%tmp.2 = seteq sbyte %tmp.1, 0 ; <bool> [#uses=1]
%indvar.next = add uint %indvar, 1 ; <uint> [#uses=1]
br bool %tmp.2, label %loopexit, label %no_exit
loopexit: ; preds = %entry, %no_exit
%len.0.1 = phi int [ 0, %entry ], [ %inc.1, %no_exit ] ; <int> [#uses=1]
ret int %len.0.1
}
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13016 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-17 18:16:10 +00:00
Chris Lattner
f50af088f1
Even if there are not any induction variables in the loop, if we can compute
...
the trip count for the loop, insert one so that we can canonicalize the exit
condition.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13015 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-17 18:08:33 +00:00
Chris Lattner
f5b9eb37a9
Add support for evaluation of exp/log/log10/pow
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13011 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-16 22:35:33 +00:00
Chris Lattner
657253119e
Fix some really nasty dominance bugs that were exposed by my patch to
...
make the verifier more strict. This fixes building zlib
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13002 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-16 18:08:07 +00:00
Misha Brukman
ea51deb18a
Fix retriving parent Function.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13001 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-16 17:37:12 +00:00
Brian Gaeke
c598517c24
Include <cmath> for compatibility with gcc 3.0.x (the system compiler on
...
Debian.)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12986 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-16 15:57:32 +00:00
Misha Brukman
98eb6264d4
Assert if deleting BasicBlock before removing it from Function.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12983 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-16 15:47:21 +00:00
Chris Lattner
006118fe8c
Fix some of the strange CBE-only failures that happened last night.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12980 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-16 06:03:17 +00:00
Chris Lattner
e1f0cf179f
Make sure to check for a very bad class of errors: an instruction
...
that does not dominate all of its users, but is in the same basic block as
its users. This class of error is what caused the mysterious CBE only
failures last night.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12979 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-16 05:51:47 +00:00
Chris Lattner
bf3d2e2683
Bugpoint was not correctly capturing stderr! This caused it to "find" bugs
...
that didn't exist, missing the ones that do :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12978 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-16 05:35:58 +00:00
Chris Lattner
cd01ae5c70
Fix Inline/2004-04-15-InlineDeletesCall.ll
...
Basically we were using SimplifyCFG as a huge sledgehammer for a simple
optimization. Because simplifycfg does so many things, we can't use it
for this purpose.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12977 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-16 05:17:59 +00:00
Chris Lattner
d244057a48
Fix a bug in the previous checkin: if the exit block is not the same as
...
the back-edge block, we must check the preincremented value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12968 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-15 20:26:22 +00:00
Brian Gaeke
b75a316758
Give SparcV9CodeEmitter a head-of-file comment and a PassName.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12967 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-15 20:23:13 +00:00
Misha Brukman
7a46e4c62b
Don't use invalid HTML in a doxygen comment.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12962 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-15 15:23:45 +00:00
Chris Lattner
59fdaeeae8
Change the canonical induction variable that we insert.
...
Instead of producing code like this:
Loop:
X = phi 0, X2
...
X2 = X + 1
if (X != N-1) goto Loop
We now generate code that looks like this:
Loop:
X = phi 0, X2
...
X2 = X + 1
if (X2 != N) goto Loop
This has two big advantages:
1. The trip count of the loop is now explicit in the code, allowing
the direct implementation of Loop::getTripCount()
2. This reduces register pressure in the loop, and allows X and X2 to be
put into the same register.
As a consequence of the second point, the code we generate for loops went
from:
.LBB2: # no_exit.1
...
mov %EDI, %ESI
inc %EDI
cmp %ESI, 2
mov %ESI, %EDI
jne .LBB2 # PC rel: no_exit.1
To:
.LBB2: # no_exit.1
...
inc %ESI
cmp %ESI, 3
jne .LBB2 # PC rel: no_exit.1
... which has two fewer moves, and uses one less register.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12961 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-15 15:21:43 +00:00
Chris Lattner
92020faa2c
add some helpful methods. Rearrange #includes to proper order
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12960 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-15 15:16:02 +00:00
Chris Lattner
0a7f98c80d
Factor a bunch of classes out into a public header
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12958 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-15 15:07:24 +00:00
Chris Lattner
0aa84fdd04
Unbreak the build
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12956 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-15 14:17:43 +00:00
Chris Lattner
e9fc96e7cc
Implement a FIXME: if we're going to insert a cast, we might as well only
...
insert it once!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12955 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-14 22:01:22 +00:00
John Criswell
53b54be5fc
Remove code to adjust the iterator for llvm.readio and llvm.writeio.
...
The iterator is pointing at the next instruction which should not disappear
when doing the load/store replacement.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12954 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-14 21:27:56 +00:00
Brian Gaeke
8121fcd260
Fix typo.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12953 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-14 21:21:56 +00:00
Chris Lattner
16011e6201
This is a trivial tweak to the addrec insertion code: insert the increment
...
at the bottom of the loop instead of the top. This reduces the number of
overlapping live ranges a lot, for example, eliminating a spill in an important
loop in 183.equake with linear scan.
I still need to make the exit comparison of the loop use the post-incremented
version of this variable, but this is an easy first step.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12952 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-14 21:11:25 +00:00
Brian Gaeke
50872d5385
Add a TargetData to the PassManager regardless of the TargetMachine.
...
This should unbreak the Sparc JIT again.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12949 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-14 17:45:52 +00:00
John Criswell
71c887d688
Remove the return type check for llvm.readio. This check is done for all
...
functions and is not needed here.
Simplify the pointer type check per Chris's suggestions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12945 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-14 15:06:48 +00:00
John Criswell
17f64258cf
Added code to verify that llvm.readio's pointer argument returns something
...
that matches its return type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12944 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-14 14:49:36 +00:00
John Criswell
994a765e5c
Finish adding the llvm.readio and llvm.writeio intrinsics.
...
Sorry these didn't get in yesterday.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12942 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-14 13:46:52 +00:00
Chris Lattner
d9955aaa61
ADd a trivial instcombine: load null -> null
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12940 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-14 03:28:36 +00:00
Chris Lattner
098e945fbd
This is the real fix for Codegen/X86/2004-04-13-FPCMOV-Crash.llx which works
...
even when the "optimization" I added before is turned off. It generates this
extremely pointless code:
test:
fld QWORD PTR [%ESP + 4]
mov %AL, 0
test %AL, %AL
fcmove %ST(0), %ST(0)
ret
Good thing the optimizer will have removed this before code generation
anyway. :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12939 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-14 02:42:32 +00:00
John Criswell
e5a4c15da6
Added support for the llvm.readio and llvm.writeio intrinsics.
...
On x86, memory operations occur in-order, so these are just lowered into
volatile loads and stores.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12936 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-13 22:13:14 +00:00
Chris Lattner
82c5a9990f
Implement a small optimization, which papers over the problem in
...
X86/2004-04-13-FPCMOV-Crash.llx
A more robust fix is to follow.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12935 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-13 21:56:09 +00:00
Chris Lattner
58b7b08ad7
Add SCCP support for constant folding calls, implementing:
...
test/Regression/Transforms/SCCP/calltest.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12921 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-13 19:43:54 +00:00
Chris Lattner
25b8390bf2
Add a simple call constant propagation interface.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12919 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-13 19:28:52 +00:00
Chris Lattner
4647b7cd69
Constant propagation should remove the dead instructions
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12917 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-13 19:28:20 +00:00
Brian Gaeke
ef8e48aae0
I don't think we have to have 4 extra allocated (but unused) bytes on the stack.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12905 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-13 18:28:37 +00:00
Brian Gaeke
3d11e8a6d3
I started working on casts, but I don't have anything compilable yet.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12903 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-13 18:27:46 +00:00
Chris Lattner
87e18deabc
Emit the immediate form of in/out when possible.
...
Fix several bugs in the intrinsics:
1. Make sure to copy the input registers before the instructions that use them
2. Make sure to copy the value returned by 'in' out of EAX into the register
it is supposed to be in.
This fixes assertions when using in/out and linear scan.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12896 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-13 17:20:37 +00:00
Chris Lattner
440bbc257e
Add immediate forms of in/out. Use let to shorten lines
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12895 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-13 17:19:31 +00:00
Chris Lattner
e47f4ff9f6
Add support for new instruction type
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12894 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-13 17:18:51 +00:00
Chris Lattner
266538350a
Add support for the printImplicitDefsBefore flag
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12893 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-13 17:18:39 +00:00
Chris Lattner
4b66242c54
Fix LoopSimplify/2004-04-13-LoopSimplifyUpdateDomFrontier.ll
...
LoopSimplify was not updating dominator frontiers correctly in some cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12890 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-13 16:23:25 +00:00
Chris Lattner
1f62f82b05
Refactor code a bit to make it simpler and eliminate the goto
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12888 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-13 15:21:18 +00:00
Chris Lattner
529b28da45
This patch addresses PR35: Loop simplify should reconstruct nested loops.
...
This is fairly straight-forward, but was a real nightmare to get just
perfect. aarg. :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12884 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-13 05:05:33 +00:00
Brian Gaeke
5f0b51547c
We don't need to insert TargetData into the PassManager here.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12874 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-12 21:46:31 +00:00
Alkis Evlogimenos
6e4d0d6546
Fix bug introduced in previous commit.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12872 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-12 20:26:39 +00:00
Chris Lattner
46758a894f
Add some methods that are useful for updating loop information.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12871 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-12 20:26:17 +00:00
Alkis Evlogimenos
43b61f724e
Correctly compute spill weights
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12869 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-12 17:39:20 +00:00
Alkis Evlogimenos
e633352fd5
Print def lists a bit more compactly
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12866 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-12 15:57:58 +00:00
Chris Lattner
ce1a3a292d
Actually update the call graph as the inliner changes it. This allows us to
...
execute other CallGraphSCCPasses after the inliner without crashing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12861 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-12 05:37:29 +00:00
Chris Lattner
b81c021f14
Change the call graph class to have TWO external nodes, making call graph
...
SCC passes much more useful. In particular, this should fix the incredibly
stupid missed inlining opportunities that the inliner suffered from.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12860 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-12 05:36:32 +00:00
Chris Lattner
7512c08bfd
Hrm, operator new and new[] do not belong here. We should not CSE them! :)
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12859 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-12 05:16:42 +00:00
Chris Lattner
1708d12916
Add support for removing invoke instructions
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12858 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-12 05:15:13 +00:00
Chris Lattner
85eb157d96
Stop printing Function*
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12857 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-12 04:06:56 +00:00
Chris Lattner
d08ddd3300
Simplify code a bit, and be sure to mark the external node as potentially throwing
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12856 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-12 04:06:38 +00:00
Chris Lattner
133dbb1285
Fix issues that the local allocator has dealing with instructions that implicitly use ST(0)
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12855 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-12 03:02:48 +00:00
Chris Lattner
284b496aae
No really, fix printing for LLC. I gotta get a way for CVS to whine at me if
...
I have unsaved emacs buffers, geeze...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12854 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-12 01:52:04 +00:00
Chris Lattner
2fc83a5ba6
Correct printing for LLC and the encoding for the JIT
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12853 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-12 01:50:04 +00:00
Chris Lattner
8d2822e7f1
Use the fucomi[p] instructions to perform floating point comparisons instead
...
of the fucom[p][p] instructions. This allows us to code generate this function
bool %test(double %X, double %Y) {
%C = setlt double %Y, %X
ret bool %C
}
... into:
test:
fld QWORD PTR [%ESP + 4]
fld QWORD PTR [%ESP + 12]
fucomip %ST(1)
fstp %ST(0)
setb %AL
movsx %EAX, %AL
ret
where before we generated:
test:
fld QWORD PTR [%ESP + 4]
fld QWORD PTR [%ESP + 12]
fucompp
** fnstsw
** sahf
setb %AL
movsx %EAX, %AL
ret
The two marked instructions (which are the ones eliminated) are very bad,
because they serialize execution of the processor. These instructions are
available on the PPRO and later, but since we already use cmov's we aren't
losing any portability.
I retained the old code for the day when we decide we want to support back
to the 386.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12852 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-12 01:43:36 +00:00
Chris Lattner
c040bca4b9
Add support for the FUCOMIr instruction
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12851 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-12 01:39:15 +00:00
Chris Lattner
a1b5e160ed
Add two new instructions
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12850 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-12 01:38:55 +00:00
Chris Lattner
9938286325
Fix a bug in my load/cast folding patch.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12849 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-12 00:23:04 +00:00
Chris Lattner
13c07feb20
Adjust some comments, fix a bug in my previous patch
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12848 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-12 00:12:04 +00:00
Chris Lattner
feac3e18aa
On X86, casting an integer to floating point requires going through memory.
...
If the source of the cast is a load, we can just use the source memory location,
without having to create a temporary stack slot entry.
Before we code generated this:
double %int(int* %P) {
%V = load int* %P
%V2 = cast int %V to double
ret double %V2
}
into:
int:
sub %ESP, 4
mov %EAX, DWORD PTR [%ESP + 8]
mov %EAX, DWORD PTR [%EAX]
mov DWORD PTR [%ESP], %EAX
fild DWORD PTR [%ESP]
add %ESP, 4
ret
Now we produce this:
int:
mov %EAX, DWORD PTR [%ESP + 4]
fild DWORD PTR [%EAX]
ret
... which is nicer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12846 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-11 23:21:26 +00:00
Chris Lattner
95157f7638
Implement folding of loads into floating point operations. This implements:
...
test/Regression/CodeGen/X86/fp_load_fold.llx
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12844 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-11 22:05:45 +00:00
Chris Lattner
6621ed94cc
Unify all of the code for floating point +,-,*,/ into one function
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12842 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-11 21:23:56 +00:00
Chris Lattner
8ebf1c35a1
This implements folding of constant operands into floating point operations
...
for mul and div.
Instead of generating this:
test_divr:
fld QWORD PTR [%ESP + 4]
fld QWORD PTR [.CPItest_divr_0]
fdivrp %ST(1)
ret
We now generate this:
test_divr:
fld QWORD PTR [%ESP + 4]
fdivr QWORD PTR [.CPItest_divr_0]
ret
This code desperately needs refactoring, which will come in the next
patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12841 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-11 21:09:14 +00:00
Chris Lattner
462fa82270
Restructure the mul/div/rem handling code to follow the pattern the other
...
instructions use. This doesn't change any functionality except that long
constant expressions of these operations will now magically start working.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12840 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-11 20:56:28 +00:00
Chris Lattner
48b0c97e20
Codegen FP adds and subtracts with a constant more efficiently, generating:
...
fld QWORD PTR [%ESP + 4]
fadd QWORD PTR [.CPItest_add_0]
instead of:
fld QWORD PTR [%ESP + 4]
fld QWORD PTR [.CPItest_add_0]
faddp %ST(1)
I also intend to do this for mul & div, but it appears that I have to
refactor a bit of code before I can do so.
This is tested by: test/Regression/CodeGen/X86/fp_constant_op.llx
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12839 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-11 20:26:20 +00:00
Chris Lattner
490e86fed5
Add some new instructions
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12838 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-11 20:24:15 +00:00
Chris Lattner
4cf15e7a3b
Relax assertion to make this function work with a broader class of instructions
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12836 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-11 20:21:06 +00:00
Chris Lattner
427aeb476f
Two changes:
...
1. If an incoming argument is dead, don't load it from the stack
2. Do not code gen noop copies at all (ie, cast int -> uint), not even to
a move. This should reduce register pressure for allocators that are
unable to coallesce away these copies in some cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12835 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-11 19:21:59 +00:00
Chris Lattner
bec63d606f
operator new & operator new[] do not kill any legal memory locations.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12833 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-11 18:16:34 +00:00
Chris Lattner
65585aa3fc
Allow clients to be more efficient.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12831 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-11 16:43:07 +00:00
Chris Lattner
fbede52af4
Fix a bug in my select transformation
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12826 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-11 01:39:19 +00:00
Chris Lattner
a0ae8196a1
Add a missing break, which caused a crash in an obscure situation
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12825 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-11 01:29:30 +00:00
Chris Lattner
adb7c0de39
Update the value numbering interface.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12824 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-10 22:33:34 +00:00
Chris Lattner
d76956d444
Implement InstCombine/select.ll:test13*
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12821 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-10 22:21:27 +00:00
Chris Lattner
66331a4e33
Implement InstCombine/add.ll:test20
...
Canonicalize add of sign bit constant into a xor
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12819 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-10 22:01:55 +00:00
Chris Lattner
38e66bd9d1
Rewrite the GCSE pass to be *substantially* simpler, a bit more efficient,
...
and a bit more powerful
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12817 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-10 21:11:11 +00:00
Chris Lattner
326c0f3013
Fix spurious warning in release mode
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12816 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-10 19:15:56 +00:00
Chris Lattner
85aa7097c2
Silence a spurious warning
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12815 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-10 18:32:01 +00:00
Chris Lattner
a5f4103931
Simplify code a bit, and fix a bug that was breaking perlbmk
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12814 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-10 18:06:21 +00:00
Chris Lattner
562cb66b84
Fix a bug in my checkin last night that was breaking programs using invoke.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12813 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-10 16:53:29 +00:00
Chris Lattner
27c694bacb
Fix previous patch
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12811 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-10 07:27:48 +00:00
Chris Lattner
17177601fb
Correctly update counters
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12810 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-10 07:02:02 +00:00
Chris Lattner
b903fc5c1b
Add a couple of more functions that cannot access memory (the intrinsics) and
...
don't write to memory
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12808 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-10 06:55:27 +00:00
Chris Lattner
ede6ac60a5
Simplify code a bit, and use alias analysis to allow us to delete unused
...
call and invoke instructions that are known to not write to memory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12807 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-10 06:53:09 +00:00
Chris Lattner
e576b91948
Implement select.ll:test12*
...
This transforms code like this:
%C = or %A, %B
%D = select %cond, %C, %A
into:
%C = select %cond, %B, 0
%D = or %A, %C
Since B is often a constant, the select can often be eliminated. In any case,
this reduces the usage count of A, allowing subsequent optimizations to happen.
This xform applies when the operator is any of:
add, sub, mul, or, xor, and, shl, shr
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12800 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-09 23:46:01 +00:00
Chris Lattner
570751c2a7
Fold code like:
...
if (C)
V1 |= V2;
into:
Vx = V1 | V2;
V1 = select C, V1, Vx
when the expression can be evaluated unconditionally and is *cheap* to
execute. This limited form of if conversion is quite handy in lots of cases.
For example, it turns this testcase into straight-line code:
int in0 ; int in1 ; int in2 ; int in3 ;
int in4 ; int in5 ; int in6 ; int in7 ;
int in8 ; int in9 ; int in10; int in11;
int in12; int in13; int in14; int in15;
long output;
void mux(void) {
output =
(in0 ? 0x00000001 : 0) | (in1 ? 0x00000002 : 0) |
(in2 ? 0x00000004 : 0) | (in3 ? 0x00000008 : 0) |
(in4 ? 0x00000010 : 0) | (in5 ? 0x00000020 : 0) |
(in6 ? 0x00000040 : 0) | (in7 ? 0x00000080 : 0) |
(in8 ? 0x00000100 : 0) | (in9 ? 0x00000200 : 0) |
(in10 ? 0x00000400 : 0) | (in11 ? 0x00000800 : 0) |
(in12 ? 0x00001000 : 0) | (in13 ? 0x00002000 : 0) |
(in14 ? 0x00004000 : 0) | (in15 ? 0x00008000 : 0) ;
}
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12798 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-09 22:50:22 +00:00
John Criswell
6d804f408a
Reversed the order of the llvm.writeport() operands so that the value
...
is listed first and the address is listed second.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12795 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-09 19:09:14 +00:00
Chris Lattner
2eefe518de
Fold binary operators with a constant operand into select instructions
...
that have a constant operand. This implements
add.ll:test19, shift.ll:test15*, and others that are not tested
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12794 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-09 19:05:30 +00:00
Chris Lattner
82e14fe168
Implement select.ll:test11
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12793 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-09 18:19:44 +00:00
Alkis Evlogimenos
9a8b490735
Add definition list to each live interval.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12791 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-09 18:07:57 +00:00
John Criswell
aee0cf3fca
Changed assertions to error messages.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12787 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-09 15:10:15 +00:00
John Criswell
ca6ea0f137
Changes recommended by Chris:
...
InstSelectSimple.cpp:
Change the checks for proper I/O port address size into an exit() instead
of an assertion. Assertions aren't used in Release builds, and handling
this error should be graceful (not that this counts as graceful, but it's
more graceful).
Modified the generation of the IN/OUT instructions to have 0 arguments.
X86InstrInfo.td:
Added the OpSize attribute to the 16 bit IN and OUT instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12786 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-08 22:39:13 +00:00
Chris Lattner
f499eaca36
Implement InstCombine/cast-propagate.ll
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12784 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-08 20:39:49 +00:00
John Criswell
4ffff9e2fa
Added the llvm.readport and llvm.writeport intrinsics for x86. These do
...
I/O port instructions on x86. The specific code sequence is tailored to
the parameters and return value of the intrinsic call.
Added the ability for implicit defintions to be printed in the Instruction
Printer.
Added the ability for RawFrm instruction to print implict uses and
defintions with correct comma output. This required adjustment to some
methods so that a leading comma would or would not be printed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12782 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-08 20:31:47 +00:00
John Criswell
9570301ee8
Added the llvm.readport and llvm.writeport intrinsics.
...
The Verifier ensures that their parameters are of integral types and have
the correct sign, but it does not enforce any size restrictions because
such restrictions are platform dependent.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12781 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-08 20:27:38 +00:00
Chris Lattner
8ba725b456
Implement ScalarRepl/select_promote.ll
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12779 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-08 19:59:34 +00:00
Chris Lattner
775cbdd51a
Remove the "really gross hacks" that are there to deal with recursive functions.
...
Now we collect all of the call sites we are interested in inlining, then inline
them. This entirely avoids issues with trying to inline a call site we got by
inlining another call site. This also eliminates iterator invalidation issues.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12770 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-08 06:34:31 +00:00
Chris Lattner
0c199a7628
Implement InstCombine/select.ll:test[7-10]
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12769 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-08 04:43:23 +00:00
Brian Gaeke
8089822a8c
Don't include InstrSelectionSupport.h.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12766 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-07 20:55:32 +00:00
Brian Gaeke
1523aac530
Move ChooseRegOrImmed() prototype here, from InstrSelectionSupport.h.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12765 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-07 20:38:57 +00:00
Brian Gaeke
92976137df
Don't include InstrSelectionSupport.h.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12764 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-07 20:38:56 +00:00
Chris Lattner
cb69a4ed64
Implement test/Regression/Transforms/InstCombine/getelementptr_index.ll
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12762 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-07 18:38:20 +00:00
Brian Gaeke
58fe7695b9
Fix insertion of SelectInsts.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12760 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-07 18:31:47 +00:00
Brian Gaeke
8005ed3bd7
Don't print [%reg + 0], just print [%reg]
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12759 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-07 17:33:56 +00:00
Brian Gaeke
f3334ebbe3
First version of code to handle loads. Stub function for handling stores.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12758 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-07 17:29:37 +00:00
Brian Gaeke
562cb16381
Support loading arguments from %I0...%I5 into virtual registers in
...
function prologues, and fix an off-by-one in visitCallInst that was
putting call args into the wrong registers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12757 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-07 17:04:09 +00:00
Brian Gaeke
d54c38b2f4
It's setting up the call args right now, but on the callee side, it's
...
trying to get incoming args off the stack, instead of the %i0...%i6 regs,
which is wrong.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12756 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-07 16:41:22 +00:00
Chris Lattner
627018b4b3
Fix a bug Brian found.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12754 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-07 16:16:11 +00:00
Chris Lattner
4d0cda4d5c
This is a start on handling setcc instructions. As the comment notes, we
...
have no good way of handling this until the code generator is improved.
We should probably just emit V9 instructions in the meantime.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12745 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-07 05:04:51 +00:00
Chris Lattner
6179047661
andd subcc instructions which is used to create the 'cmp' pseudo instruction
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12744 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-07 05:04:01 +00:00
Chris Lattner
0d538bbec2
Avoid emitting an extra copy on each 32-bit operation
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12743 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-07 04:36:53 +00:00
Brian Gaeke
88ddd4a07d
Make generation of stack-slot loads and copies less ugly.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12742 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-07 04:29:14 +00:00
Brian Gaeke
fa4bb09cf0
Fix bug in printing loads.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12741 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-07 04:29:03 +00:00
Chris Lattner
4be7ca5721
Add support for shift instructions, wrap some long lines
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12740 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-07 04:27:16 +00:00
Chris Lattner
a562efce35
Fix encoding of existing shift instructions, add rr shifts
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12739 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-07 04:26:57 +00:00
Chris Lattner
22ede709f6
Add a bunch more instructions
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12737 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-07 04:06:46 +00:00
Chris Lattner
f97b31e9cf
Merge my changes with brians
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12736 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-07 04:05:49 +00:00
Brian Gaeke
0f51cc1759
Add in some things I forgot, which Chris helpfully reminded me of...
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12735 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-07 04:05:12 +00:00
Brian Gaeke
59e04e4889
Add support for the "Y" register, used by MUL & DIV.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12734 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-07 04:01:11 +00:00
Brian Gaeke
e88c9dc860
Add UDIV, SDIV, and a few variants of WR.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12733 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-07 04:01:00 +00:00
Brian Gaeke
2d4fa8faac
Preliminary support for getting 64-bit integer constants into registers.
...
Preliminary support for division. It's gross because you have to initialize
the "Y" register, which is the top 32 bits of the thing you're dividing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12732 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-07 04:00:49 +00:00
Brian Gaeke
ff8282604a
Prune unnecessary #includes
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12731 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-06 23:25:07 +00:00
Brian Gaeke
20117102c2
Simple delay slot filler pass.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12730 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-06 23:21:45 +00:00
Brian Gaeke
86a8790826
Add references to delay slot filler pass.
...
Fill in addPassesToJITCompile method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12729 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-06 23:21:24 +00:00
Brian Gaeke
3a8ad62d4f
First attempt at handling frame index elimination.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12728 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-06 22:10:22 +00:00
Brian Gaeke
1c38175d6b
First attempt at special-casing printing of [%reg + offset] for
...
ld/st instructions - doesn't seem to work yet, but I think it's
just a typo or something somewhere.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12727 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-06 22:10:11 +00:00
Brian Gaeke
856e4fc59e
Delete reference to "the Mach-O Runtime ABI".
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12726 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-06 22:09:59 +00:00
Brian Gaeke
ea8494bb89
Deal with call return values.
...
Don't put NOPs in delay slots at all. We'll have a fix-up pass later.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12725 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-06 22:09:23 +00:00
Jakub Staszak
8ac0009979
file based off InstSelectSimple.cpp, slowly being replaced by generated code from the really simple X86 instruction selector tablegen backend
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12715 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-06 19:35:17 +00:00
Jakub Staszak
0a8fd30c1b
Tablgen files for really simple instruction selector
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12714 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-06 19:34:00 +00:00
Chris Lattner
7b92de1e7d
Fix PR313: [x86] JIT miscompiles unsigned short to floating point
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12711 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-06 19:29:36 +00:00
Chris Lattner
43ab3a8f45
Fix incorrect encoding of some ADC and SBB instuctions
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12710 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-06 19:20:32 +00:00
Chris Lattner
48c937e5c9
Fix a minor bug in previous checking
...
Enable folding of long seteq/setne comparisons into branches and select instructions
Implement unfolded long relational comparisons against a constants a bit more efficiently
Folding comparisons changes code that looks like this:
mov %EAX, DWORD PTR [%ESP + 4]
mov %EDX, DWORD PTR [%ESP + 8]
mov %ECX, %EAX
or %ECX, %EDX
sete %CL
test %CL, %CL
je .LBB2 # PC rel: F
into code that looks like this:
mov %EAX, DWORD PTR [%ESP + 4]
mov %EDX, DWORD PTR [%ESP + 8]
mov %ECX, %EAX
or %ECX, %EDX
jne .LBB2 # PC rel: F
This speeds up 186.crafty by 6% with llc-ls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12702 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-06 17:34:50 +00:00
Chris Lattner
e80e637793
Improve codegen of long == and != comparisons against constants. Before,
...
comparing a long against zero got us this:
sub %ESP, 8
mov DWORD PTR [%ESP + 4], %ESI
mov DWORD PTR [%ESP], %EDI
mov %EAX, DWORD PTR [%ESP + 12]
mov %EDX, DWORD PTR [%ESP + 16]
mov %ECX, 0
mov %ESI, 0
mov %EDI, %EAX
xor %EDI, %ECX
mov %ECX, %EDX
xor %ECX, %ESI
or %EDI, %ECX
sete %CL
test %CL, %CL
je .LBB2 # PC rel: F
Now it gets us this:
mov %EAX, DWORD PTR [%ESP + 4]
mov %EDX, DWORD PTR [%ESP + 8]
mov %ECX, %EAX
or %ECX, %EDX
sete %CL
test %CL, %CL
je .LBB2 # PC rel: F
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12696 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-06 16:02:27 +00:00
Chris Lattner
6ab06d5d19
Handle various other important cases of multiplying a long constant immediate. For
...
example, multiplying X*(1 + (1LL << 32)) now produces:
test:
mov %ECX, DWORD PTR [%ESP + 4]
mov %EDX, DWORD PTR [%ESP + 8]
mov %EAX, %ECX
add %EDX, %ECX
ret
[[[Note to Alkis: why isn't linear scan generating this code?? This might be a
problem with your intervals being too conservative:
test:
mov %EAX, DWORD PTR [%ESP + 4]
mov %EDX, DWORD PTR [%ESP + 8]
add %EDX, %EAX
ret
end note]]]
Whereas GCC produces this:
T:
sub %esp, 12
mov %edx, DWORD PTR [%esp+16]
mov DWORD PTR [%esp+8], %edi
mov %ecx, DWORD PTR [%esp+20]
xor %edi, %edi
mov DWORD PTR [%esp], %ebx
mov %ebx, %edi
mov %eax, %edx
mov DWORD PTR [%esp+4], %esi
add %ebx, %edx
mov %edi, DWORD PTR [%esp+8]
lea %edx, [%ecx+%ebx]
mov %esi, DWORD PTR [%esp+4]
mov %ebx, DWORD PTR [%esp]
add %esp, 12
ret
I'm not sure example what GCC is smoking here, but it looks like it has just
confused itself with a bunch of stack slots or something. The intel compiler
is better, but still not good:
T:
movl 4(%esp), %edx #2.11
movl 8(%esp), %eax #2.11
lea (%eax,%edx), %ecx #3.12
movl $1, %eax #3.12
mull %edx #3.12
addl %ecx, %edx #3.12
ret #3.12
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12693 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-06 04:55:43 +00:00
Chris Lattner
028adc422d
Efficiently handle a long multiplication by a constant. For this testcase:
...
long %test(long %X) {
%Y = mul long %X, 123
ret long %Y
}
we used to generate:
test:
sub %ESP, 12
mov DWORD PTR [%ESP + 8], %ESI
mov DWORD PTR [%ESP + 4], %EDI
mov DWORD PTR [%ESP], %EBX
mov %ECX, DWORD PTR [%ESP + 16]
mov %ESI, DWORD PTR [%ESP + 20]
mov %EDI, 123
mov %EBX, 0
mov %EAX, %ECX
mul %EDI
imul %ESI, %EDI
add %ESI, %EDX
imul %ECX, %EBX
add %ESI, %ECX
mov %EDX, %ESI
mov %EBX, DWORD PTR [%ESP]
mov %EDI, DWORD PTR [%ESP + 4]
mov %ESI, DWORD PTR [%ESP + 8]
add %ESP, 12
ret
Now we emit:
test:
mov %EAX, DWORD PTR [%ESP + 4]
mov %ECX, DWORD PTR [%ESP + 8]
mov %EDX, 123
mul %EDX
imul %ECX, %ECX, 123
add %ECX, %EDX
mov %EDX, %ECX
ret
Which, incidently, is substantially nicer than what GCC manages:
T:
sub %esp, 8
mov %eax, 123
mov DWORD PTR [%esp], %ebx
mov %ebx, DWORD PTR [%esp+16]
mov DWORD PTR [%esp+4], %esi
mov %esi, DWORD PTR [%esp+12]
imul %ecx, %ebx, 123
mov %ebx, DWORD PTR [%esp]
mul %esi
mov %esi, DWORD PTR [%esp+4]
add %esp, 8
lea %edx, [%ecx+%edx]
ret
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12692 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-06 04:29:36 +00:00
Chris Lattner
722070e0ba
Improve code generation of long shifts by 32.
...
On this testcase:
long %test(long %X) {
%Y = shr long %X, ubyte 32
ret long %Y
}
instead of:
t:
mov %EAX, DWORD PTR [%ESP + 4]
mov %EAX, DWORD PTR [%ESP + 8]
sar %EAX, 0
mov %EDX, 0
ret
we now emit:
test:
mov %EAX, DWORD PTR [%ESP + 4]
mov %EAX, DWORD PTR [%ESP + 8]
mov %EDX, 0
ret
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12688 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-06 03:42:38 +00:00
Chris Lattner
0652167bea
Bugfixes: inc/dec don't set the carry flag!
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12687 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-06 03:36:57 +00:00
Chris Lattner
92900a65a3
Improve code for passing constant longs as arguments to function calls.
...
For example, on this instruction:
call void %test(long 1234)
Instead of this:
mov %EAX, 1234
mov %ECX, 0
mov DWORD PTR [%ESP], %EAX
mov DWORD PTR [%ESP + 4], %ECX
call test
We now emit this:
mov DWORD PTR [%ESP], 1234
mov DWORD PTR [%ESP + 4], 0
call test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12686 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-06 03:23:00 +00:00
Chris Lattner
33f7fa317b
Emit more efficient 64-bit operations when the RHS is a constant, and one
...
of the words of the constant is zeros. For example:
Y = and long X, 1234
now generates:
Yl = and Xl, 1234
Yh = 0
instead of:
Yl = and Xl, 1234
Yh = and Xh, 0
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12685 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-06 03:15:53 +00:00
Chris Lattner
7ba92306db
Fix typeo
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12684 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-06 02:13:25 +00:00
Chris Lattner
ab1d0e0963
Add support for simple immediate handling to long instruction selection.
...
This allows us to handle code like 'add long %X, 123456789012' more efficiently.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12683 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-06 02:11:49 +00:00
Chris Lattner
ee98389808
The sbb instructions really ARE sbb's, not adc's
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12682 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-06 02:02:11 +00:00
Chris Lattner
edd5e4957a
Implement negation of longs efficiently. For this testcase:
...
long %test(long %X) {
%Y = sub long 0, %X
ret long %Y
}
We used to generate:
test:
sub %ESP, 4
mov DWORD PTR [%ESP], %ESI
mov %ECX, DWORD PTR [%ESP + 8]
mov %ESI, DWORD PTR [%ESP + 12]
mov %EAX, 0
mov %EDX, 0
sub %EAX, %ECX
sbb %EDX, %ESI
mov %ESI, DWORD PTR [%ESP]
add %ESP, 4
ret
Now we generate:
test:
mov %EAX, DWORD PTR [%ESP + 4]
mov %EDX, DWORD PTR [%ESP + 8]
neg %EAX
adc %EDX, 0
neg %EDX
ret
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12681 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-06 01:48:06 +00:00
Chris Lattner
502e36c3c9
Minor tweak to avoid an extra reg-reg copy that the register allocator has to eliminate
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12680 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-06 01:25:33 +00:00
Chris Lattner
29bf0623e5
Two changes:
...
* In promote32, if we can just promote a constant value, do so instead of
promoting a constant dynamically.
* In visitReturn inst, actually USE the promote32 argument that takes a
Value*
The end result of this is that we now generate this:
test:
mov %EAX, 0
ret
instead of...
test:
mov %AX, 0
movzx %EAX, %AX
ret
for:
ushort %test() {
ret ushort 0
}
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12679 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-06 01:21:00 +00:00
Chris Lattner
8505c867b1
lli no longer takes the -quiet option!
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12674 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-05 20:28:41 +00:00
Chris Lattner
6e40e1d15c
Do not mangle intrinsics in any way!
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12673 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-05 20:17:53 +00:00
Chris Lattner
ea9e005ce6
Sparc don't got not "sqrtl", bum bum bum
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12670 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-05 19:05:15 +00:00
Misha Brukman
bb2aff1e18
Kill warnings during an optimized compile where assert() disappears.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12669 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-05 19:00:46 +00:00
Chris Lattner
ddd947f21a
Fix PR312 and IndVarsSimplify/2004-04-05-InvokeCastCrash.llx
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12668 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-05 18:46:55 +00:00
Chris Lattner
548f47efb0
Fix a bug in yesterdays checkins which broke siod. siod is a great testcase! :)
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12659 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-05 16:02:41 +00:00
Chris Lattner
15a76c0b35
Fix InstCombine/2004-04-04-InstCombineReplaceAllUsesWith.ll
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12658 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-05 02:10:19 +00:00
Chris Lattner
28977af72a
Support getelementptr instructions which use uint's to index into structure
...
types and can have arbitrary 32- and 64-bit integer types indexing into
sequential types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12653 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-05 01:30:19 +00:00
Chris Lattner
830b6f9868
Support getelementptr instructions which use uint's to index into structure
...
types and can have arbitrary 32- and 64-bit integer types indexing into
sequential types.
Auto-upgrade .ll files that use ubytes to index into structures to use uint's.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12652 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-05 01:30:04 +00:00
Chris Lattner
5fa428fda9
Implement support for a new LLVM 1.3 bytecode format, which uses uint's
...
to index into structure types and allows arbitrary 32- and 64-bit integer
types to index into sequential types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12651 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-05 01:27:26 +00:00
Chris Lattner
d144f42a5a
Add ConstantExpr::get(Sign|Zero)Extend methods
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12648 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-04 23:20:30 +00:00
Chris Lattner
97220b7338
In the perhaps not-to-distant future, we might support gep instructions that
...
have non-long indices for sequential types. In order to avoid trying to figure
out how the v9 backend works, we'll just hack it in the preselection pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12647 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-04 20:44:05 +00:00
Chris Lattner
702a8a070f
Adjust to new interface
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12646 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-04 19:47:06 +00:00
Chris Lattner
c6b0fb39cb
Adjust to new gep_type_iterator prototypes.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12644 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-04 17:30:06 +00:00
Chris Lattner
9dd8770609
Remove a bunch of cruft that was used to be backwards compatible with the last
...
prerelease format for LLVM bytecode files. Now we only are compatible with
LLVM 1.0+.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12643 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-03 23:43:42 +00:00
Chris Lattner
5da80974c0
Implement test/Regression/Transforms/GCSE/undefined_load.ll
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12641 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-03 00:45:16 +00:00
Chris Lattner
e34c0b48a0
Add a break in the default case
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12639 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-03 00:43:03 +00:00
Brian Gaeke
8507ecb36d
Add autoconf support for isStandardOutAConsole ().
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12638 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-02 21:26:04 +00:00
Chris Lattner
9687845800
Remove obsolete files
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12633 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-02 20:56:24 +00:00
Brian Gaeke
6c5526e56e
Add support for many of the MRegisterInfo callbacks.
...
Eliminating call-frame pseudo instrs and frame indices are still stubs.
Flesh out the emitPrologue method based on better ABI knowledge.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12632 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-02 20:53:37 +00:00
Brian Gaeke
8542e08d15
Add load, store, and NOP instructions.
...
Fix up comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12631 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-02 20:53:37 +00:00
Brian Gaeke
a778ca555a
Add support for printing pc-relative displacements of functions (as used in
...
the CALL instruction).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12630 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-02 20:53:35 +00:00
Brian Gaeke
f7e44ef8d5
Add support for call instructions (0-ary only for now).
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12629 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-02 20:53:33 +00:00
Chris Lattner
d18d9dcd28
Comment out debugging printouts
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12623 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-02 20:26:46 +00:00
Chris Lattner
40bf8b48cd
Rewrite the indvars pass to use the ScalarEvolution analysis.
...
This also implements some new features for the indvars pass, including
linear function test replacement, exit value substitution, and it works with
a much more general class of induction variables and loops.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12620 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-02 20:24:31 +00:00
Chris Lattner
53e677abad
Add a new analysis
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12619 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-02 20:23:17 +00:00
Chris Lattner
7aa773bc07
Fix the obvious bug in my previous checkin
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12618 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-02 18:15:10 +00:00
Chris Lattner
147af6b75f
Implement Transforms/SimplifyCFG/return-merge.ll
...
This actually causes us to turn code like:
return C ? A : B;
into a select instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12617 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-02 18:13:43 +00:00
Alkis Evlogimenos
bee8a094af
Clean up code a bit.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12615 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-02 18:11:32 +00:00
Brian Gaeke
79ee87b1bb
Only strip symbols if emitting bytecode to the assembly file.
...
Move lowerselect pass to come after preselection. Move machine
code construction and stack slots pass to come right before instruction
selection. This is to help fix perlbmk.
Update comments.
Make the sequence of passes in addPassesToJITCompile look more like
the sequence of passes in addPassesToEmitAssembly, including support
for -print-machineinstrs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12614 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-02 17:52:40 +00:00
Brian Gaeke
142e22a5f4
Add support for constant select expressions. Clarify the assertion failure msg.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12613 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-02 17:52:29 +00:00
Alkis Evlogimenos
1a66731da8
Fix type in comments
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12611 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-02 16:02:50 +00:00
Alkis Evlogimenos
13ce339442
Fix type in instruction builder instantiation
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12610 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-02 15:51:03 +00:00
Chris Lattner
fdc38c4ad3
Make the verifier API more complete and useful.
...
Patch contributed by Reid Spencer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12609 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-02 15:45:08 +00:00
Alkis Evlogimenos
8b28b6d187
Add more ADC and SBB variants
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12607 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-02 07:11:10 +00:00
Chris Lattner
b234d460b2
Add new function, autoconf support required tho
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12600 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-02 05:04:03 +00:00
Chris Lattner
c68bace452
Fix PR310 and TailDup/2004-04-01-DemoteRegToStack.llx
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12597 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-01 20:28:45 +00:00
Chris Lattner
4edf6c043e
Remove some assertions that are now bogus with the last patch I put in
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12595 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-01 19:21:46 +00:00
Chris Lattner
4f303bd4a5
Fix PR306: Loop simplify incorrectly updates dominator information
...
Testcase: LoopSimplify/2004-04-01-IncorrectDomUpdate.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12592 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-01 19:06:07 +00:00
Chris Lattner
6683dbf32e
Add support for select constant expressions to the CBE, fixing SIOD
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12589 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-01 05:28:26 +00:00
Chris Lattner
0526f01fec
Simplify code by using the more powerful BuildMI forms.
...
Implement a small optimization. In test/Regression/CodeGen/X86/select.ll,
we now generate this for foldSel3:
foldSel3:
mov %AL, BYTE PTR [%ESP + 4]
fld DWORD PTR [%ESP + 8]
fld DWORD PTR [%ESP + 12]
mov %EAX, DWORD PTR [%ESP + 16]
mov %ECX, DWORD PTR [%ESP + 20]
cmp %EAX, %ECX
fxch %ST(1)
fcmovae %ST(0), %ST(1)
*** fstp %ST(1)
ret
Instead of:
foldSel3:
mov %AL, BYTE PTR [%ESP + 4]
fld DWORD PTR [%ESP + 8]
fld DWORD PTR [%ESP + 12]
mov %EAX, DWORD PTR [%ESP + 16]
mov %ECX, DWORD PTR [%ESP + 20]
cmp %EAX, %ECX
fxch %ST(1)
fcmovae %ST(0), %ST(1)
*** fxch %ST(1)
*** fstp %ST(0)
ret
In practice, this only effects code size: performance should be basically
unaffected.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12588 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-01 04:06:09 +00:00
Chris Lattner
f1ac50ec53
Wrap at 80 cols
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12587 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-01 04:03:27 +00:00
Chris Lattner
68626c2b30
Generate slightly smaller code, "test R, R" instead of "cmp R, 0"
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12579 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-31 22:22:36 +00:00
Chris Lattner
08bde1870a
The X86 backend no longer needs the select lowering pass.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12578 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-31 22:03:46 +00:00
Chris Lattner
352eb48f8e
Codegen FP select instructions into X86 conditional moves. Annoyingly enough
...
the X86 does not support a full set of fp cmove instructions, so we can't always
fold the condition into the select. :( Yuck.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12577 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-31 22:03:35 +00:00
Chris Lattner
c1bab32bc5
Add support for floating point conditional move instructions
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12576 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-31 22:02:36 +00:00
Chris Lattner
30b2f72e7c
Add support for FP cmoves
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12575 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-31 22:02:21 +00:00
Chris Lattner
1c54a85447
Add FP conditional move instructions, which annoyingly have special properties
...
that require the asmwriter to be extended (printing implicit uses before the
explicit operands)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12574 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-31 22:02:13 +00:00
Chris Lattner
0e28eca4bc
Add warning
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12573 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-31 22:00:30 +00:00
Chris Lattner
b4186e0ccd
MBB::remove should not modify the iterator passed in
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12572 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-31 21:59:59 +00:00
Chris Lattner
4f6410f5cb
MachineBasicBlock::remove should not modify the iterator passed in
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12571 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-31 21:59:29 +00:00
Brian Gaeke
368c5da198
Factor out getStaticStackSize from InsertPrologCode(), so that I can more
...
easily steal it for a separate use in the reoptimizer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12568 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-31 20:58:37 +00:00
Brian Gaeke
60d6e54c72
Use the true, decoded name of the archive member in getObjectType.
...
In ReadArchiveBuffer, make sure that MemberName is set in the case where
getObjectType would want to return SVR4LongFilename.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12567 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-31 19:51:00 +00:00
Chris Lattner
91ef460285
Avoid TRUE and FALSE which apparently conflict with some macros on OSX
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12566 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-31 03:49:47 +00:00
Chris Lattner
1438102576
Fix linking of constant expr casts due to type resolution changes. With
...
this and the other patches 253.perlbmk links again.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12565 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-31 02:58:28 +00:00
Chris Lattner
4b2f08a3a9
Add support for constant expr casts
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12564 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-31 02:56:11 +00:00
Chris Lattner
1e490ba4cd
Add support for reading constantexpr select instructions
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12563 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-31 02:53:59 +00:00
Chris Lattner
92e84229e1
Fix a latent bug in select constantexpr handling that was broke 253.perlbmk
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12562 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-30 22:51:03 +00:00
Alkis Evlogimenos
a8db01ac83
Correctly update LiveVariables when an instruction changes
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12561 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-30 22:44:39 +00:00
Chris Lattner
307ecbaddb
Fold comparisons into select instructions, making much better code and
...
using our broad selection of movcc instructions. :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12560 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-30 22:39:09 +00:00
Chris Lattner
87d3bb5dfa
Implement spill code folding for all of the conditional move instructions
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12554 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-30 21:29:47 +00:00
Chris Lattner
12d96a0b4d
Add direct support for integer select instructions, though we still don't support
...
folding compares into the select yet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12553 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-30 21:22:00 +00:00
Chris Lattner
bc280abd46
Fix bug: Assembler/2004-03-30-UnclosedFunctionCrash.llx
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12551 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-30 20:58:25 +00:00
Chris Lattner
a5cdab7101
Fix some serious bugs in the cmov descriptions, which didn't cause a problem because
...
we never generated them
Make indentation a bit more consistent
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12549 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-30 20:18:02 +00:00
Brian Gaeke
87fa610ee0
Start cleaning up this pass so that I can debug it.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12548 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-30 19:53:46 +00:00
Chris Lattner
552112f2f8
Now that all the code generators support the select instruction, and the instcombine
...
pass can eliminate many nasty cases of them, start generating them in the optimizers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12545 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-30 19:44:05 +00:00
Chris Lattner
c32b30a429
Implement select.ll:test[3-6]
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12544 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-30 19:37:13 +00:00
Chris Lattner
6f2ab04e91
Fix a fairly major performance problem. If a PHI node had a constant as
...
an incoming value from a block, the selector would evaluate the constant
at the TOP of the block instead of at the end of the block. This made the
live range for the constant span the entire block, increasing register
pressure needlessly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12542 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-30 19:10:12 +00:00
Chris Lattner
5abd61f6d9
Add the select lowering pass to get initial support for select instructions
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12541 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-30 18:41:59 +00:00
Chris Lattner
18bdbc3dda
Add a simple select instruction lowering pass
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12540 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-30 18:41:10 +00:00
Chris Lattner
fc33d30446
Add some new methods
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12539 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-30 00:20:08 +00:00
Brian Gaeke
eb8863db90
Don't warn about a null live range if the Value is a ConstantIntegral.
...
Otherwise, if you're in debugging mode, you get warnings for (apparently)
every immediate constant in the function during reg. allocation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12538 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-29 21:58:41 +00:00
Brian Gaeke
47b716483e
Change how the beginnings and ends of MachineFunctions are printed. Get
...
rid of the funny cast.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12537 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-29 21:58:31 +00:00
Chris Lattner
db81395452
Adjust to new itf
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12534 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-29 20:42:49 +00:00
Chris Lattner
d25e3ecb3c
Handle -0.0 correctly
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12530 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-29 19:51:24 +00:00
Chris Lattner
4dcb5401e4
Add a bunch of methods that should have been added a long time ago.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12526 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-29 02:37:53 +00:00
Chris Lattner
944cfafe76
Add another check
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12525 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-29 00:29:36 +00:00
Chris Lattner
e83593b2d3
Fix an assertion
...
Contributed by Reid Spencer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12524 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-29 00:17:20 +00:00
Chris Lattner
11cad517a1
Make error message a bit nicer.
...
Contributed by Reid Spencer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12523 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-29 00:16:01 +00:00
Chris Lattner
e3651f00e8
Add two methods which have been needed for a long time: Type::get(Un)signedVersion
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12522 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-26 21:43:22 +00:00
Chris Lattner
4df1b8aa26
X % -1 == X % 1 == 0
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12520 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-26 16:11:24 +00:00
Chris Lattner
ebd985cb87
Two changes:
...
#1 is to unconditionally strip constantpointerrefs out of
instruction operands where they are absolutely pointless and inhibit
optimization. GRRR!
#2 is to implement InstCombine/getelementptr_const.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12519 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-25 22:59:29 +00:00
Chris Lattner
698c4a4bbb
Minor efficiency improvement, finegrainify namespacification
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12517 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-25 22:56:03 +00:00
Chris Lattner
e151259288
Hrm, we were leaking ~1M of garbage that valgrind never told us about because
...
it was "reachable". Cute.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12515 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-19 23:34:33 +00:00
Chris Lattner
7c881dffc9
Teach the optimizer to delete zero sized alloca's (but not mallocs!)
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12507 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-19 06:08:10 +00:00
Chris Lattner
6b835360f1
Fix PR299: [Sparc] Code generator asserts on alloc of zero size type
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12504 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-19 04:21:43 +00:00
Chris Lattner
ab18020cbd
Malloc doesn't kill a load. This patch need not go into 1.2 though.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12500 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-18 17:01:26 +00:00
Chris Lattner
85c84e759e
Fix a really nasty bug that was breaking ijpeg in LLC mode. We were incorrectly
...
folding load instructions into other instructions across free instruction
boundaries. Perhaps this will also fix the other strange failures?
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12494 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-18 06:29:54 +00:00
Chris Lattner
aa7ab53b99
Fix bug: CodeExtractor/2004-03-17-MissedLiveIns.ll
...
With this fix we now successfully extract all 149 loops from 256.bzip2 without
crashing or miscompiling the program!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12493 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-18 05:56:32 +00:00
Chris Lattner
f6e43bc796
Add statistics to the loop extractor. The loop extractor has successfully
...
extracted all 63 loops for Olden/bh without crashing and without
miscompiling the program!!!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12491 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-18 05:46:10 +00:00
Chris Lattner
fdded9f95a
Fix problem with PHI nodes having multiple predecessors from different
...
exit nodes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12490 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-18 05:43:18 +00:00
Chris Lattner
d07f899691
Fix CodeExtractor/2004-03-17-UpdatePHIsOutsideRegion.ll
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12489 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-18 05:38:31 +00:00
Chris Lattner
5cc8ca6420
Seriously simplify and correct the PHI node handling code.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12487 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-18 05:28:49 +00:00
Chris Lattner
04229c192b
Fix CodeExtractor/2004-03-17-OutputMismatch.ll
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12486 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-18 04:12:05 +00:00
Chris Lattner
b5c1dbf503
Fix several bugs in the extractor:
...
1. Names were not put on the new arguments created (ok, this just helps sanity :)
2. Fix outgoing pointer values
3. Do not insert stores for values that had not been computed
4. Fix some wierd problems with the outset calculation
This fixes CodeExtractor/2004-03-14-DominanceProblem.ll, making the extractor
work on at least one simple case!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12484 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-18 03:49:40 +00:00
Chris Lattner
369287bab5
The code extractor needs dominator info. Provide it
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12483 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-18 03:48:06 +00:00
Chris Lattner
33e197b777
Prune #includes, moving the module interface to the front. Note that this
...
exposed the fact that the header was not self-contained. There is a reason
we do things :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12481 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-18 03:15:29 +00:00
Chris Lattner
4781bc7142
Fix a HORRIBLY NASTY bug that caused siod to stop working last night.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12479 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-17 23:22:04 +00:00
Chris Lattner
7acd1ccb8a
Fix compilation of mesa, which I broke earlier today
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12465 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-17 02:02:47 +00:00
Chris Lattner
e911979650
Be more accurate
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12464 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-17 01:59:27 +00:00
Alkis Evlogimenos
eee91172fb
Make the set of fixed (preallocated) intervals be a fixed superset of
...
unhandled + handled. So unhandled is now including all fixed intervals
and fixed intervals never changes when processing a function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12462 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-17 00:48:59 +00:00
Chris Lattner
50eafbc828
Fix bug in previous checkin
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12458 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-16 23:36:49 +00:00
Chris Lattner
24ad00db5a
Okay, so there is no reasonable way for tail duplication to update SSA form,
...
as it is making effectively arbitrary modifications to the CFG and we don't
have a domset/domfrontier implementations that can handle the dynamic updates.
Instead of having a bunch of code that doesn't actually work in practice,
just demote any potentially tricky values to the stack (causing the problem
to go away entirely). Later invocations of mem2reg will rebuild SSA for us.
This fixes all of the major performance regressions with tail duplication
from LLVM 1.1. For example, this loop:
---
int popcount(int x) {
int result = 0;
while (x != 0) {
result = result + (x & 0x1);
x = x >> 1;
}
return result;
}
---
Used to be compiled into:
int %popcount(int %X) {
entry:
br label %loopentry
loopentry: ; preds = %entry, %no_exit
%x.0 = phi int [ %X, %entry ], [ %tmp.9, %no_exit ] ; <int> [#uses=3]
%result.1.0 = phi int [ 0, %entry ], [ %tmp.6, %no_exit ] ; <int> [#uses=2]
%tmp.1 = seteq int %x.0, 0 ; <bool> [#uses=1]
br bool %tmp.1, label %loopexit, label %no_exit
no_exit: ; preds = %loopentry
%tmp.4 = and int %x.0, 1 ; <int> [#uses=1]
%tmp.6 = add int %tmp.4, %result.1.0 ; <int> [#uses=1]
%tmp.9 = shr int %x.0, ubyte 1 ; <int> [#uses=1]
br label %loopentry
loopexit: ; preds = %loopentry
ret int %result.1.0
}
And is now compiled into:
int %popcount(int %X) {
entry:
br label %no_exit
no_exit: ; preds = %entry, %no_exit
%x.0.0 = phi int [ %X, %entry ], [ %tmp.9, %no_exit ] ; <int> [#uses=2]
%result.1.0.0 = phi int [ 0, %entry ], [ %tmp.6, %no_exit ] ; <int> [#uses=1]
%tmp.4 = and int %x.0.0, 1 ; <int> [#uses=1]
%tmp.6 = add int %tmp.4, %result.1.0.0 ; <int> [#uses=2]
%tmp.9 = shr int %x.0.0, ubyte 1 ; <int> [#uses=2]
%tmp.1 = seteq int %tmp.9, 0 ; <bool> [#uses=1]
br bool %tmp.1, label %loopexit, label %no_exit
loopexit: ; preds = %no_exit
ret int %tmp.6
}
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12457 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-16 23:29:09 +00:00
Chris Lattner
c1a0623e86
This code was both incredibly complex and incredibly broken. Fix it.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12456 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-16 23:23:11 +00:00
Brian Gaeke
54cc3c2135
The .type directive on Solaris uses the # character instead of @.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12454 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-16 22:52:04 +00:00
Brian Gaeke
6d339f9000
Fix bug in zero-extending of shorts.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12453 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-16 22:45:42 +00:00
Brian Gaeke
032f80fbf1
Add UMULrr and SMULrr instructions.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12452 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-16 22:37:13 +00:00
Brian Gaeke
79db7405f7
Use ! for comment char; it works in both Solaris as and GAS.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12451 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-16 22:37:12 +00:00
Brian Gaeke
f57e364f65
Make getClass more robust by adding cLong.
...
Add handling for Mul instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12450 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-16 22:37:11 +00:00
Chris Lattner
91408eba18
Punt if we see gigantic PHI nodes. This improves a huge interpreter loop
...
testcase from 32.5s in -raise to take .3s
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12443 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-16 19:52:53 +00:00
Chris Lattner
a2f652d420
Do not try to optimize PHI nodes with incredibly high degree. This reduces SCCP
...
time from 615s to 1.49s on a large testcase that has a gigantic switch statement
that all of the blocks in the function go to (an intepreter).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12442 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-16 19:49:59 +00:00
Chris Lattner
4bebf08d15
Do not copy gigantic switch instructions
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12441 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-16 19:45:22 +00:00
Chris Lattner
7d1bd336ab
Fix PR296: [execution engines] Unhandled cast constant expression
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12435 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-16 08:38:56 +00:00
Chris Lattner
85ebd541fa
Fix a regression from this patch:
...
http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20040308/013095.html
Basically, this patch only updated the immediate dominatees of the header node
to tell them that the preheader also dominated them. In practice, ALL
dominatees of the header node are also dominated by the preheader.
This fixes: LoopSimplify/2004-03-15-IncorrectDomUpdate.
and PR293
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12434 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-16 06:00:15 +00:00
Chris Lattner
002be76733
Add some missing functions. Make sure to handle calls together in case the
...
client has another VN implementation that can VN calls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12427 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-16 03:41:35 +00:00
Chris Lattner
6ae9eb1566
Fix PR294
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12425 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-16 01:45:55 +00:00
Alkis Evlogimenos
63dd4ff809
Add LAHF instruction
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12424 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-15 17:20:14 +00:00
Chris Lattner
6dd196f762
Restore old inlining heuristic. As the comment indicates, this is a nasty
...
horrible hack.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12423 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-15 06:38:14 +00:00
Chris Lattner
fcead4f426
Ok, the assertion was bogus. Calls that do not read/write memory should not
...
have an alias set, just like adds and subtracts don't.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12422 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-15 06:28:07 +00:00
Chris Lattner
df209fcc7e
This assertion is bogus now that calls do not necessarily read/write memory
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12421 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-15 06:24:15 +00:00
Chris Lattner
46234fd97f
Add counters for the number of calls elimianted
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12420 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-15 05:46:59 +00:00
Chris Lattner
5a6e947f1d
Implement CSE of call instructions in the most trivial case. This implements
...
GCSE/call_cse.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12419 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-15 05:44:59 +00:00
Chris Lattner
bbcc147220
Fix a minor bug, implementing GCSE/call_pure_function.ll
...
Also, add some stuff I missed before.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12417 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-15 04:18:28 +00:00
Chris Lattner
118dd0ce3d
Implement LICM of calls in simple cases. This is sufficient to move around
...
sin/cos/strlen calls and stuff. This implements:
LICM/call_sink_pure_function.ll
LICM/call_sink_const_function.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12415 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-15 04:11:30 +00:00
Chris Lattner
5b5f7c11d0
Don't be COMPLETELY pessimistic in the face of function calls
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12413 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-15 04:08:36 +00:00
Chris Lattner
992860c44e
Deinline some virtual methods, provide better mod/ref answers through the
...
use of the boolean queries
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12410 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-15 04:07:29 +00:00
Chris Lattner
b79d79297d
Pass through the boolean queries
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12409 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-15 04:06:46 +00:00
Chris Lattner
4244bb5bbd
Teach basicaa about some stdc functions.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12408 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-15 03:36:49 +00:00
Chris Lattner
15d443b566
Mostly cosmetic improvements. Do fix the bug where a global value was considered an input.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12406 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-15 01:26:44 +00:00
Chris Lattner
0de632bfae
Assert that input blocks meet the invariants we expect
...
Simplify the input/output finder. All elements of a basic block are
instructions. Any used arguments are also inputs. An instruction can only
be used by another instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12405 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-15 01:18:23 +00:00
Chris Lattner
5156c39d64
Fix several bugs in the loop extractor. In particular, subloops were never
...
extracted, and a function that contained a single top-level loop never had
the loop extracted, regardless of how much non-loop code there was.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12403 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-15 00:02:02 +00:00
Chris Lattner
65826bf435
No correctness fixes here, just minor qoi fixes:
...
* Don't insert a branch to the switch instruction after the call, just
make it a single block.
* Insert the new alloca instructions in the entry block of the original
function instead of having them execute dynamically
* Don't make the default edge of the switch instruction go back to the switch.
The loop extractor shouldn't create new loops!
* Give meaningful names to the alloca slots and the reload instructions
* Some minor code simplifications
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12402 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-14 23:43:24 +00:00
Chris Lattner
12f390e9c0
Simplify code a bit, and fix bug CodeExtractor/2004-03-14-NoSwitchSupport.ll
...
This also implements a two minor improvements:
* Don't insert live-out stores IN the region, insert them on the code path
that exits the region
* If the region is exited to the same block from multiple paths, share the
switch statement entry, live-out store code, and the basic block.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12401 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-14 23:05:49 +00:00
Chris Lattner
0e06674287
Simplify the code a bit by making the collection of basic blocks to extract
...
a member of the class. While we're at it, turn the collection into a set
instead of a vector to improve efficiency and make queries simpler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12400 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-14 22:34:55 +00:00
Alkis Evlogimenos
a1a7148c4d
Another API change to MRegisterInfo::foldMemoryOperand. Instead of a
...
MachineBasicBlock::iterator take a MachineInstr*.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12392 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-14 20:14:27 +00:00
Chris Lattner
41bc0b069c
Split into two passes. Now there is the general loop extractor, usable on
...
the command line, and the single loop extractor, usable by bugpoint
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12390 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-14 20:01:36 +00:00
Alkis Evlogimenos
39354c99a1
Change MRegisterInfo::foldMemoryOperand to return the folded
...
instruction to make the API more flexible.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12386 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-14 07:19:51 +00:00
Chris Lattner
97836fad2c
Passes don't print stuff!
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12385 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-14 04:17:53 +00:00
Chris Lattner
bf9eaddfb0
Do not create empty basic blocks when the lowerswitch pass expects blocks to
...
be non-empty! This fixes LowerSwitch/2004-03-13-SwitchIsDefaultCrash.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12384 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-14 04:14:31 +00:00
Chris Lattner
bb41156c0c
Minor random cleanups
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12382 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-14 04:01:47 +00:00
Chris Lattner
16d0eb0468
FunctionPass's should not define their own 'run' method.
...
Require 'simplified' loops, not just raw natural loops. This fixes
CodeExtractor/2004-03-13-LoopExtractorCrash.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12381 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-14 04:01:06 +00:00