Bill Wendling
3244a7dc35
Removed unneeded <iostream> #include.
...
llvm-svn: 31810
2006-11-17 07:10:51 +00:00
Chris Lattner
cc4df7e0ab
If an indvar with a variable stride is used by the exit condition, go ahead
...
and handle it like constant stride vars. This fixes some bad codegen in
variable stride cases. For example, it compiles this:
void foo(int k, int i) {
for (k=i+i; k <= 8192; k+=i)
flags2[k] = 0;
}
to:
LBB1_1: #bb.preheader
movl %eax, %ecx
addl %ecx, %ecx
movl L_flags2$non_lazy_ptr, %edx
LBB1_2: #bb
movb $0, (%edx,%ecx)
addl %eax, %ecx
cmpl $8192, %ecx
jle LBB1_2 #bb
LBB1_5: #return
ret
or (if the array is local and we are in dynamic-nonpic or static mode):
LBB3_2: #bb
movb $0, _flags2(%ecx)
addl %eax, %ecx
cmpl $8192, %ecx
jle LBB3_2 #bb
and:
lis r2, ha16(L_flags2$non_lazy_ptr)
lwz r2, lo16(L_flags2$non_lazy_ptr)(r2)
slwi r3, r4, 1
LBB1_2: ;bb
li r5, 0
add r6, r4, r3
stbx r5, r2, r3
cmpwi cr0, r6, 8192
bgt cr0, LBB1_5 ;return
instead of:
leal (%eax,%eax,2), %ecx
movl %eax, %edx
addl %edx, %edx
addl L_flags2$non_lazy_ptr, %edx
xorl %esi, %esi
LBB1_2: #bb
movb $0, (%edx,%esi)
movl %eax, %edi
addl %esi, %edi
addl %ecx, %esi
cmpl $8192, %esi
jg LBB1_5 #return
and:
lis r2, ha16(L_flags2$non_lazy_ptr)
lwz r2, lo16(L_flags2$non_lazy_ptr)(r2)
mulli r3, r4, 3
slwi r5, r4, 1
li r6, 0
add r2, r2, r5
LBB1_2: ;bb
li r5, 0
add r7, r3, r6
stbx r5, r2, r6
add r6, r4, r6
cmpwi cr0, r7, 8192
ble cr0, LBB1_2 ;bb
This speeds up Benchmarks/Shootout/sieve from 8.533s to 6.464s and
implements LoopStrengthReduce/var_stride_used_by_compare.ll
llvm-svn: 31809
2006-11-17 06:17:33 +00:00
Bill Wendling
dbea653b5d
More removal of std::cerr and DEBUG, replacing with DOUT instead.
...
llvm-svn: 31806
2006-11-17 02:09:07 +00:00
Chris Lattner
81683aa08b
implement a todo: change a map into a vector
...
llvm-svn: 31805
2006-11-17 01:52:23 +00:00
Bill Wendling
0ae0a45ebe
Replace std::cerr uses of the "DEBUG" macro with "DOUT" instead. Removes
...
a #include of iostream.
llvm-svn: 31800
2006-11-17 00:50:36 +00:00
Chris Lattner
e4e113818f
fix typo
...
llvm-svn: 31799
2006-11-17 00:49:36 +00:00
Bill Wendling
748f1ae70b
Added "DOUT" macro. This is used as a replacement for the std::cerr
...
stream. It centralizes the use of std::cerr so that static c'tor/d'tors
aren't scattered around all over the place. The way to use it is like this:
DOUT << "This is a status line: " << Var << "\n";
If "-debug" is specified, it will print. Otherwise, it'll not print. If
NDEBUG is defined, the DOUT does nothing.
llvm-svn: 31798
2006-11-17 00:49:12 +00:00
Chris Lattner
237ee79d06
implicit_def_vrrc doesn't generate code.
...
llvm-svn: 31797
2006-11-16 23:49:52 +00:00
Evan Cheng
fc1b3d8bc8
Correct instructions for moving data between GR64 and SSE registers; also correct load i64 / store i64 from v2i64.
...
llvm-svn: 31795
2006-11-16 23:33:25 +00:00
Evan Cheng
a838021d2c
Fix a potential bug: MOVPDI2DI, etc. are not copy instructions.
...
llvm-svn: 31794
2006-11-16 23:22:26 +00:00
Jim Laskey
8aac7dc0ee
This is a general clean up of the PowerPC ABI. Address several problems and
...
bugs including making sure that the TOS links back to the previous frame,
that the maximum call frame size is not included twice when using frame
pointers, no longer growing the frame on calls, double storing of SP and
a cleaner/faster dynamic alloca.
llvm-svn: 31792
2006-11-16 22:43:37 +00:00
Chris Lattner
5dcf43138d
fix a regression that I introduced. stdu should scale the offset by 4
...
before printing it.
llvm-svn: 31791
2006-11-16 21:45:30 +00:00
Evan Cheng
c653e70b2d
Align stubs on 4 byte boundary. This fixes 447.dealII.
...
llvm-svn: 31790
2006-11-16 20:13:34 +00:00
Bill Wendling
49d6a1169f
*** empty log message ***
...
llvm-svn: 31789
2006-11-16 20:11:33 +00:00
Evan Cheng
2503d332cd
Allow target to specify alignment for function stub.
...
llvm-svn: 31788
2006-11-16 20:04:54 +00:00
Evan Cheng
263c558c13
Match MachineCodeEmitter changes.
...
llvm-svn: 31787
2006-11-16 20:04:04 +00:00
Chris Lattner
41280ae60d
add a statistic
...
llvm-svn: 31785
2006-11-16 18:13:49 +00:00
Bill Wendling
bcd11344e9
Don't recompute getNumOperands for each iteration.
...
llvm-svn: 31783
2006-11-16 07:35:18 +00:00
Bill Wendling
985d7e09ec
Added a new method "CreateNewLiveInterval" which, given a list of
...
LiveRanges, creates a new LiveInterval from them. The LiveRanges should
have existed already in another LiveInterval, but removed.
llvm-svn: 31780
2006-11-16 02:41:50 +00:00
Chris Lattner
283e7306c1
fix broken encoding
...
llvm-svn: 31778
2006-11-16 01:01:28 +00:00
Chris Lattner
0d40275b0e
enable the branch folding pass for the JIT.
...
llvm-svn: 31777
2006-11-16 01:00:07 +00:00
Chris Lattner
99d9dd8d07
add ppc64 r+i stores with update.
...
llvm-svn: 31776
2006-11-16 00:57:19 +00:00
Chris Lattner
4edb6f09fe
add patterns for ppc32 preinc stores. ppc64 next.
...
llvm-svn: 31775
2006-11-16 00:41:37 +00:00
Chris Lattner
c4b9cff1f9
switch these back to the 'bad old way'
...
llvm-svn: 31774
2006-11-16 00:33:34 +00:00
Evan Cheng
43ba439abd
Fix an incorrectly inverted condition.
...
llvm-svn: 31773
2006-11-16 00:08:20 +00:00
Chris Lattner
f505815dad
Fix ppc64 epilog bug.
...
llvm-svn: 31771
2006-11-15 23:35:30 +00:00
Chris Lattner
bd95b9d4ae
Stop using isTwoAddress, switching to operand constraints instead.
...
Tell the codegen emitter that specific operands are not to be encoded, fixing
JIT regressions w.r.t. pre-inc loads and stores (e.g. lwzu, which we generate
even when general preinc loads are not enabled).
llvm-svn: 31770
2006-11-15 23:24:18 +00:00
Chris Lattner
1158705ea7
add a new field needed by the code emitter generator.
...
llvm-svn: 31768
2006-11-15 22:55:04 +00:00
Evan Cheng
2a92afa25d
Properly transfer kill / dead info.
...
llvm-svn: 31765
2006-11-15 20:58:11 +00:00
Evan Cheng
1b3bde1c1b
Kill / dead info has been moved to MI's.
...
llvm-svn: 31764
2006-11-15 20:56:39 +00:00
Evan Cheng
4625504fa4
commuteInstruction should propagate kill / dead info.
...
llvm-svn: 31763
2006-11-15 20:56:03 +00:00
Evan Cheng
3ba3e10448
Match live variable changes.
...
llvm-svn: 31762
2006-11-15 20:55:15 +00:00
Evan Cheng
cf45b9fa95
Minor updates.
...
llvm-svn: 31761
2006-11-15 20:54:29 +00:00
Evan Cheng
7b19d271c4
A register def can be partially dead when the whole register has use(s) but a subreg does not.
...
llvm-svn: 31760
2006-11-15 20:54:11 +00:00
Evan Cheng
d79427b22c
Do away with kill / dead maps. Move kill / dead info onto MI's.
...
llvm-svn: 31759
2006-11-15 20:51:59 +00:00
Chris Lattner
9bc55a6c38
fix ldu/stu jit encoding. Swith 64-bit preinc load instrs to use memri
...
addrmodes.
llvm-svn: 31757
2006-11-15 19:55:13 +00:00
Devang Patel
6060a1e3dc
Add run(Function &F) support in FunctionPassManager_New
...
llvm-svn: 31756
2006-11-15 19:39:54 +00:00
Chris Lattner
ccbbe940eb
Simplify IntrinsicLowering and clarify that it is only for use by the
...
CBE and interpreter.
llvm-svn: 31755
2006-11-15 18:00:10 +00:00
Chris Lattner
1453db28c3
Remove unneeded forward decls
...
llvm-svn: 31754
2006-11-15 17:53:13 +00:00
Chris Lattner
286bb6e482
remove dead #include
...
llvm-svn: 31753
2006-11-15 17:51:15 +00:00
Chris Lattner
2f520b36ba
Fix the PPC regressions last night
...
llvm-svn: 31752
2006-11-15 17:40:51 +00:00
Chris Lattner
0a2d29b345
Fix a gcc 4.2 warning.
...
llvm-svn: 31751
2006-11-15 04:53:24 +00:00
Chris Lattner
6d5a509e34
Switch loads over to use memri as the operand instead of a reg/imm operand
...
pair for cleanliness. Add instructions for PPC32 preinc-stores with commented
out patterns. More improvement is needed to enable the patterns, but we're
getting close.
llvm-svn: 31749
2006-11-15 02:43:19 +00:00
Devang Patel
c252225cec
Tidy up marking of last analysis user pass.
...
llvm-svn: 31746
2006-11-15 01:48:14 +00:00
Devang Patel
343e099f5d
Add doInitialization and doFinalization support in FunctionManager_New.
...
llvm-svn: 31745
2006-11-15 01:27:05 +00:00
Devang Patel
55ee589fb9
Do not derive CommonPassManagerImpl from Pass.
...
Now BasicBlockPassManager_New is a FunctionPass,
FunctionPassManager_New is a ModulePass
llvm-svn: 31744
2006-11-15 01:11:27 +00:00
Devang Patel
4f5849544b
Copy initializeAnalysisImpl() implementation from PassManagerT.
...
Update LastUser to recursively walk required transitive set.
llvm-svn: 31741
2006-11-14 21:49:36 +00:00
Evan Cheng
7c9b3c7ea3
Revert. This wasn't meant to be checked in.
...
llvm-svn: 31737
2006-11-14 19:20:33 +00:00
Chris Lattner
55c68f61a7
group load and store instructions together. No functionality change.
...
llvm-svn: 31736
2006-11-14 19:19:53 +00:00
Chris Lattner
6c55120e31
Fix predicates for unindexed stores so they don't accidentally match indexed
...
stores.
llvm-svn: 31735
2006-11-14 19:13:39 +00:00