Evan Cheng [Wed, 10 May 2006 22:30:41 +0000 (22:30 +0000)]
If the live interval legnth is essentially zero, i.e. in every live range
the use follows def immediately, it doesn't make sense to spill it and
hope it will be easier to allocate for this LI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28217
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Wed, 10 May 2006 19:53:05 +0000 (19:53 +0000)]
Update test case
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28216
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 10 May 2006 19:00:36 +0000 (19:00 +0000)]
Two changes:
1. Implement InstCombine/deadcode.ll by not adding instructions in unreachable
blocks (due to constants in conditional branches/switches) to the worklist.
This causes them to be deleted before instcombine starts up, leading to
better optimization.
2. In the prepass over instructions, do trivial constprop/dce as we go. This
has the effect of improving the effectiveness of #1. In addition, it
*significantly* speeds up instcombine on test cases with large amounts of
constant folding code (for example, that produced by code specialization
or partial evaluation). In one example, it speeds up instcombine from
0.0589s to 0.0224s with a release build (a 2.6x speedup).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28215
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 10 May 2006 18:56:04 +0000 (18:56 +0000)]
New testcase, check that dead code doesn't pessimize instcombine
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28214
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 10 May 2006 06:38:32 +0000 (06:38 +0000)]
Fix the PowerPC JIT-only failure on UnitTests/Vector/sumarray-dbl, which is
really a bad codegen bug that LLC happens to get lucky with. I must chat with
Nate for the proper fix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28213
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Wed, 10 May 2006 06:16:44 +0000 (06:16 +0000)]
Templatify RegReductionPriorityQueue
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28212
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 10 May 2006 04:38:35 +0000 (04:38 +0000)]
Add alloca/malloc ctors that don't take array sizes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28211
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 10 May 2006 04:32:43 +0000 (04:32 +0000)]
Add an assertion for a common error
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28210
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Wed, 10 May 2006 02:47:57 +0000 (02:47 +0000)]
Watch out for the following case:
1. Use expects a chain output.
2. Node is expanded into multiple target ops.
3. One of the inner node produces a chain, the outer most one doesn't.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28209
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Wed, 10 May 2006 00:05:46 +0000 (00:05 +0000)]
Fix a load folding bug. It is exposed by a multi- resulting instructions
def : Pat<> pattern.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28208
91177308-0d34-0410-b5e6-
96231b3b80d8
Nate Begeman [Tue, 9 May 2006 18:20:51 +0000 (18:20 +0000)]
Fix PR773
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28207
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 9 May 2006 17:29:17 +0000 (17:29 +0000)]
This method doesn't need to be virtual, thanks to Reid for pointing this out.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28206
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 9 May 2006 16:41:59 +0000 (16:41 +0000)]
Fix a regression in my patch from last night that broke the llvmgcc4 build on
ppc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28205
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 9 May 2006 16:15:00 +0000 (16:15 +0000)]
Indent .data/.text in the .s file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28204
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Tue, 9 May 2006 07:20:24 +0000 (07:20 +0000)]
Another instruction scheduling test case
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28203
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Tue, 9 May 2006 07:13:34 +0000 (07:13 +0000)]
Add pseudo dependency to force a def&use operand to be scheduled last (unless
the distance between the def and another use is much longer). This is under
option control for now "-sched-lower-defnuse".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28201
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Tue, 9 May 2006 06:55:15 +0000 (06:55 +0000)]
Debugging info
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28200
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Tue, 9 May 2006 06:54:05 +0000 (06:54 +0000)]
Remove a completed entry.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28199
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Tue, 9 May 2006 06:48:12 +0000 (06:48 +0000)]
Test case for PR770
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28198
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Tue, 9 May 2006 06:37:48 +0000 (06:37 +0000)]
PR 770 - permit coallescing of registers in subset register classes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28197
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Tue, 9 May 2006 06:35:30 +0000 (06:35 +0000)]
Added sub- register classes information.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28196
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Tue, 9 May 2006 06:34:26 +0000 (06:34 +0000)]
Add sub-register class information.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28195
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 9 May 2006 05:33:48 +0000 (05:33 +0000)]
Implement MASM sections correctly, without a "has masm sections flag" and a bunch of special case code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28194
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 9 May 2006 05:33:28 +0000 (05:33 +0000)]
Implement MASM sections correctly, without a "has masm sections flag" and a
bunch of special case code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28193
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 9 May 2006 05:24:50 +0000 (05:24 +0000)]
Oh yeah, there are two of these now, unify both.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28192
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 9 May 2006 05:23:12 +0000 (05:23 +0000)]
Setting SwitchToSectionDirective properly in the MASM backend permits a bunch
of code to be unified.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28191
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 9 May 2006 05:21:47 +0000 (05:21 +0000)]
MASM doesn't have one of these.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28190
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 9 May 2006 05:19:59 +0000 (05:19 +0000)]
Don't prefix section directives with a tab. Doing so causes blank lines to
be emitted to the .s file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28189
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 9 May 2006 05:15:58 +0000 (05:15 +0000)]
Make the masm codepath work like the normal code path.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28188
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 9 May 2006 05:15:24 +0000 (05:15 +0000)]
Preserve prior behavior
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28187
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 9 May 2006 05:13:34 +0000 (05:13 +0000)]
The MASM asmprinter has been fixed, these hacks are no longer needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28186
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 9 May 2006 05:12:53 +0000 (05:12 +0000)]
Fix the MASM asmprinter's lies. It does not want to emit code to .text/.data
it wants it emitted to _text/_data.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28185
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 9 May 2006 04:59:56 +0000 (04:59 +0000)]
Split SwitchSection into SwitchTo{Text|Data}Section methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28184
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 9 May 2006 04:59:30 +0000 (04:59 +0000)]
Split SwitchSection into the SwitchTo{Text|Data}Section functions, to better
support assemblers that distinguish the two.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28183
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 9 May 2006 04:58:46 +0000 (04:58 +0000)]
Some notes and thoughts to myself
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28182
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 9 May 2006 04:13:41 +0000 (04:13 +0000)]
Patch to make some xforms preserve each other. Patch contributed by
Domagoj Babic!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28181
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Spencer [Tue, 9 May 2006 00:31:01 +0000 (00:31 +0000)]
Use the -dumpversion option to llvm-gcc which gives us just the version #
and is unlikely to change in future releases. This also simplifies the
parsing of the full and major llvm-gcc version numbers in the script.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28180
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 8 May 2006 22:00:52 +0000 (22:00 +0000)]
Move some methods out of line so that MutexGuard.h isn't needed in a public header.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28179
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 8 May 2006 22:00:26 +0000 (22:00 +0000)]
Move methods out of line so that MutexGuard.h isn't required in the header.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28178
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 8 May 2006 21:39:45 +0000 (21:39 +0000)]
Another bad case I noticed
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28177
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 8 May 2006 21:24:21 +0000 (21:24 +0000)]
add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28176
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 8 May 2006 21:18:59 +0000 (21:18 +0000)]
Make the case I just checked in stronger. Now we compile this:
short test2(short X, short x) {
int Y = (short)(X+x);
return Y >> 1;
}
to:
_test2:
add r2, r3, r4
extsh r2, r2
srawi r3, r2, 1
blr
instead of:
_test2:
add r2, r3, r4
extsh r2, r2
srwi r2, r2, 1
extsh r3, r2
blr
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28175
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 8 May 2006 20:59:41 +0000 (20:59 +0000)]
Implement and_sext.ll:test3, generating:
_test4:
srawi r3, r3, 16
blr
instead of:
_test4:
srwi r2, r3, 16
extsh r3, r2
blr
for:
short test4(unsigned X) {
return (X >> 16);
}
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28174
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 8 May 2006 20:58:58 +0000 (20:58 +0000)]
new testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28173
91177308-0d34-0410-b5e6-
96231b3b80d8
Nate Begeman [Mon, 8 May 2006 20:54:02 +0000 (20:54 +0000)]
Yet more readme updating
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28172
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 8 May 2006 20:51:54 +0000 (20:51 +0000)]
Compile this:
short test4(unsigned X) {
return (X >> 16);
}
to:
_test4:
movl 4(%esp), %eax
sarl $16, %eax
ret
instead of:
_test4:
movl $-65536, %eax
andl 4(%esp), %eax
sarl $16, %eax
ret
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28171
91177308-0d34-0410-b5e6-
96231b3b80d8
Nate Begeman [Mon, 8 May 2006 20:08:28 +0000 (20:08 +0000)]
New note about something bad happening in target independent optimizers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28170
91177308-0d34-0410-b5e6-
96231b3b80d8
Nate Begeman [Mon, 8 May 2006 19:09:24 +0000 (19:09 +0000)]
Proving once again that I am not as smart as the compiler
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28169
91177308-0d34-0410-b5e6-
96231b3b80d8
Nate Begeman [Mon, 8 May 2006 17:38:32 +0000 (17:38 +0000)]
Fold more shifts into inserts, and update the README
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28168
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 8 May 2006 17:29:49 +0000 (17:29 +0000)]
Fold shifts with undef operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28167
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 8 May 2006 17:22:53 +0000 (17:22 +0000)]
When tracking demanded bits, if any bits from the sext of an SRA are demanded,
then so is the input sign bit. This fixes mediabench/g721 on X86.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28166
91177308-0d34-0410-b5e6-
96231b3b80d8
Nate Begeman [Mon, 8 May 2006 16:51:36 +0000 (16:51 +0000)]
Make emission of jump tables a bit less conservative; they are now required
to be only 31.25% dense, rather than 75% dense.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28165
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Mon, 8 May 2006 08:01:26 +0000 (08:01 +0000)]
Fixing truncate. Previously we were emitting truncate from r16 to r8 as
movw. That is we promote the destination operand to r16. So
%CH = TRUNC_R16_R8 %BP
is emitted as
movw %bp, %cx.
This is incorrect. If %cl is live, it would be clobbered.
Ideally we want to do the opposite, that is emitted it as
movb ??, %ch
But this is not possible since %bp does not have a r8 sub-register.
We are now defining a new register class R16_ which is a subclass of R16
containing only those 16-bit registers that have r8 sub-registers (i.e.
AX - DX). We isel the truncate to two instructions, a MOV16to16_ to copy the
value to the R16_ class, followed by a TRUNC_R16_R8.
Due to bug 770, the register colaescer is not going to coalesce between R16 and
R16_. That will be fixed later so we can eliminate the MOV16to16_. Right now, it
can only be eliminated if we are lucky that source and destination registers are
the same.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28164
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 8 May 2006 05:59:36 +0000 (05:59 +0000)]
Move the definition of value_use_iterator::getOperandNo to User.h where the
definition of the User class is available, this fixes the build with some
compiler versions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28163
91177308-0d34-0410-b5e6-
96231b3b80d8
Nate Begeman [Mon, 8 May 2006 02:52:38 +0000 (02:52 +0000)]
Update some stuff now that the new rlwimi code has gone in
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28162
91177308-0d34-0410-b5e6-
96231b3b80d8
Nate Begeman [Mon, 8 May 2006 01:35:01 +0000 (01:35 +0000)]
Fix PR772
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28161
91177308-0d34-0410-b5e6-
96231b3b80d8
Nate Begeman [Mon, 8 May 2006 01:33:11 +0000 (01:33 +0000)]
Remove unncessary include
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28160
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 7 May 2006 18:16:31 +0000 (18:16 +0000)]
This test passes now, remove xfail marker
Change test to be a positive test instead of a negative test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28159
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Sun, 7 May 2006 10:10:20 +0000 (10:10 +0000)]
Typo's
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28158
91177308-0d34-0410-b5e6-
96231b3b80d8
Jeff Cohen [Sun, 7 May 2006 02:51:51 +0000 (02:51 +0000)]
Unlike Unix, Windows won't let a file be implicitly replaced via renaming without explicit permission.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28157
91177308-0d34-0410-b5e6-
96231b3b80d8
Nate Begeman [Sun, 7 May 2006 00:23:38 +0000 (00:23 +0000)]
New rlwimi implementation, which is superior to the old one. There are
still a couple missed optimizations, but we now generate all the possible
rlwimis for multiple inserts into the same bitfield. More regression tests
to come.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28156
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 6 May 2006 23:48:13 +0000 (23:48 +0000)]
Use ComputeMaskedBits to determine # sign bits as a fallback. This allows us
to handle all kinds of stuff, including silly things like:
sextinreg(setcc,i16) -> setcc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28155
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 6 May 2006 23:40:29 +0000 (23:40 +0000)]
Add some more sign propagation cases
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28154
91177308-0d34-0410-b5e6-
96231b3b80d8
Jeff Cohen [Sat, 6 May 2006 23:25:53 +0000 (23:25 +0000)]
Apply bug fix supplied by Greg Pettyjohn for a bug he found: '<invalid>' is not a legal path on Windows.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28153
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 6 May 2006 23:06:26 +0000 (23:06 +0000)]
Simplify some code, add a couple minor missed folds
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28152
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 6 May 2006 23:05:41 +0000 (23:05 +0000)]
constant fold sign_extend_inreg
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28151
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 6 May 2006 22:43:44 +0000 (22:43 +0000)]
remove cases handled elsewhere
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28150
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 6 May 2006 22:39:59 +0000 (22:39 +0000)]
Add some more simple sign bit propagation cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28149
91177308-0d34-0410-b5e6-
96231b3b80d8
Jeff Cohen [Sat, 6 May 2006 21:27:14 +0000 (21:27 +0000)]
Fix some loose ends in MASM support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28148
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 6 May 2006 18:15:50 +0000 (18:15 +0000)]
new testcase we handle right now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28147
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 6 May 2006 09:30:03 +0000 (09:30 +0000)]
Use the new TargetLowering::ComputeNumSignBits method to eliminate
sign_extend_inreg operations. Though ComputeNumSignBits is still rudimentary,
this is enough to compile this:
short test(short X, short x) {
int Y = X+x;
return (Y >> 1);
}
short test2(short X, short x) {
int Y = (short)(X+x);
return Y >> 1;
}
into:
_test:
add r2, r3, r4
srawi r3, r2, 1
blr
_test2:
add r2, r3, r4
extsh r2, r2
srawi r3, r2, 1
blr
instead of:
_test:
add r2, r3, r4
srawi r2, r2, 1
extsh r3, r2
blr
_test2:
add r2, r3, r4
extsh r2, r2
srawi r2, r2, 1
extsh r3, r2
blr
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28146
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 6 May 2006 09:27:13 +0000 (09:27 +0000)]
Add some really really simple code for computing sign-bit propagation.
This will certainly be enhanced in the future.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28145
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 6 May 2006 09:26:22 +0000 (09:26 +0000)]
Add some new methods for computing sign bit information.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28144
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 6 May 2006 09:10:37 +0000 (09:10 +0000)]
When inserting casts, be careful of where we put them. We cannot insert
a cast immediately before a PHI node.
This fixes Regression/CodeGen/Generic/2006-05-06-GEP-Cast-Sink-Crash.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28143
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 6 May 2006 09:09:47 +0000 (09:09 +0000)]
new testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28142
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 6 May 2006 09:00:16 +0000 (09:00 +0000)]
Move some code around.
Make the "fold (and (cast A), (cast B)) -> (cast (and A, B))" transformation
only apply when both casts really will cause code to be generated. If one or
both doesn't, then this xform doesn't remove a cast.
This fixes Transforms/InstCombine/2006-05-06-Infloop.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28141
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 6 May 2006 08:58:06 +0000 (08:58 +0000)]
new testcase from ghostscript that inf looped instcombine
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28140
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 6 May 2006 00:29:37 +0000 (00:29 +0000)]
Teach the X86 backend about non-i32 inline asm register classes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28139
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 6 May 2006 00:11:52 +0000 (00:11 +0000)]
Fold (trunc (srl x, c)) -> (srl (trunc x), c)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28138
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 5 May 2006 22:56:26 +0000 (22:56 +0000)]
Fold trunc(any_ext). This gives stuff like:
27,28c27
< movzwl %di, %edi
< movl %edi, %ebx
---
> movw %di, %bx
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28137
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 5 May 2006 22:53:17 +0000 (22:53 +0000)]
Shrink shifts when possible.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28136
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 5 May 2006 22:32:12 +0000 (22:32 +0000)]
Implement ComputeMaskedBits/SimplifyDemandedBits for ISD::TRUNCATE
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28135
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 5 May 2006 21:50:04 +0000 (21:50 +0000)]
Print a grouping around inline asm blocks so that we can tell when we are
using them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28134
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 5 May 2006 21:48:50 +0000 (21:48 +0000)]
Print *some* grouping around inline asm blocks so we know where they are.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28133
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 5 May 2006 21:47:05 +0000 (21:47 +0000)]
Indent multiline asm strings more nicely
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28132
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 5 May 2006 21:35:18 +0000 (21:35 +0000)]
Teach the code generator to use cvtss2sd as extload f32 -> f64
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28131
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 5 May 2006 21:34:35 +0000 (21:34 +0000)]
Fold (fpext (load x)) -> (extload x)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28130
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 5 May 2006 21:17:49 +0000 (21:17 +0000)]
More aggressively sink GEP offsets into loops. For example, before we
generated:
movl 8(%esp), %eax
movl %eax, %edx
addl $4316, %edx
cmpb $1, %cl
ja LBB1_2 #cond_false
LBB1_1: #cond_true
movl L_QuantizationTables720$non_lazy_ptr, %ecx
movl %ecx, (%edx)
movl L_QNOtoQuantTableShift720$non_lazy_ptr, %edx
movl %edx, 4460(%eax)
ret
...
Now we generate:
movl 8(%esp), %eax
cmpb $1, %cl
ja LBB1_2 #cond_false
LBB1_1: #cond_true
movl L_QuantizationTables720$non_lazy_ptr, %ecx
movl %ecx, 4316(%eax)
movl L_QNOtoQuantTableShift720$non_lazy_ptr, %ecx
movl %ecx, 4460(%eax)
ret
... which uses one fewer register.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28129
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 5 May 2006 20:51:30 +0000 (20:51 +0000)]
Fix an infinite loop compiling oggenc last night.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28128
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Fri, 5 May 2006 08:23:07 +0000 (08:23 +0000)]
Need extload patterns after Chris' DAG combiner changes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28127
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 5 May 2006 06:39:07 +0000 (06:39 +0000)]
Implement InstCombine/cast.ll:test29
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28126
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 5 May 2006 06:38:40 +0000 (06:38 +0000)]
New testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28125
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 5 May 2006 06:32:04 +0000 (06:32 +0000)]
Fold some common code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28124
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 5 May 2006 06:31:05 +0000 (06:31 +0000)]
Implement:
// fold (and (sext x), (sext y)) -> (sext (and x, y))
// fold (or (sext x), (sext y)) -> (sext (or x, y))
// fold (xor (sext x), (sext y)) -> (sext (xor x, y))
// fold (and (aext x), (aext y)) -> (aext (and x, y))
// fold (or (aext x), (aext y)) -> (aext (or x, y))
// fold (xor (aext x), (aext y)) -> (aext (xor x, y))
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28123
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 5 May 2006 06:10:43 +0000 (06:10 +0000)]
Pull and through and/or/xor. This compiles some bitfield code to:
mov EAX, DWORD PTR [ESP + 4]
mov ECX, DWORD PTR [EAX]
mov EDX, ECX
add EDX, EDX
or EDX, ECX
and EDX, -
2147483648
and ECX,
2147483647
or EDX, ECX
mov DWORD PTR [EAX], EDX
ret
instead of:
sub ESP, 4
mov DWORD PTR [ESP], ESI
mov EAX, DWORD PTR [ESP + 8]
mov ECX, DWORD PTR [EAX]
mov EDX, ECX
add EDX, EDX
mov ESI, ECX
and ESI, -
2147483648
and EDX, -
2147483648
or EDX, ESI
and ECX,
2147483647
or EDX, ECX
mov DWORD PTR [EAX], EDX
mov ESI, DWORD PTR [ESP]
add ESP, 4
ret
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28122
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 5 May 2006 05:58:59 +0000 (05:58 +0000)]
Implement a variety of simplifications for ANY_EXTEND.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28121
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 5 May 2006 05:51:50 +0000 (05:51 +0000)]
Factor some code, add these transformations:
// fold (and (trunc x), (trunc y)) -> (trunc (and x, y))
// fold (or (trunc x), (trunc y)) -> (trunc (or x, y))
// fold (xor (trunc x), (trunc y)) -> (trunc (xor x, y))
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28120
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Fri, 5 May 2006 05:40:20 +0000 (05:40 +0000)]
Better implementation of truncate. ISel matches it to a pseudo instruction
that gets emitted as movl (for r32 to i16, i8) or a movw (for r16 to i8). And
if the destination gets allocated a subregister of the source operand, then
the instruction will not be emitted at all.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28119
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 5 May 2006 05:36:15 +0000 (05:36 +0000)]
New note, Nate, please check to see if I'm full of it :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28118
91177308-0d34-0410-b5e6-
96231b3b80d8
Jeff Cohen [Fri, 5 May 2006 01:47:05 +0000 (01:47 +0000)]
Fix VC++ compilation error.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28117
91177308-0d34-0410-b5e6-
96231b3b80d8