Andrew Lenharth
3543e3b3a9
2 fixes:
...
1: Legalize operand in UINT_TO_FP expanision
2: SRA x, const i8 was not promoting the constant to shift amount type.
llvm-svn: 22337
2005-07-05 19:52:39 +00:00
Chris Lattner
f8faaa8a39
Fit to 80 columns
...
llvm-svn: 22336
2005-07-05 17:50:16 +00:00
Chris Lattner
23a1b681d0
Fix PowerPC varargs
...
llvm-svn: 22335
2005-07-05 17:48:31 +00:00
Andrew Lenharth
d2db55ec81
check the correct VT
...
llvm-svn: 22332
2005-07-04 20:07:21 +00:00
Andrew Lenharth
6a674b7805
fix loading address of fp symbols
...
llvm-svn: 22331
2005-07-03 20:06:13 +00:00
Chris Lattner
93a2576078
Percolate the call up to the right superclass
...
llvm-svn: 22330
2005-07-03 17:34:39 +00:00
Andrew Lenharth
c9903eb2cc
I really didn't think this was necessary. But, Legalize wasn't running again
...
and legalizing the extload. Strange. Should fix most alpha regressions.
llvm-svn: 22329
2005-07-02 20:58:53 +00:00
Nate Begeman
12d2961fd2
The statistic needs to be in the correct namespace.
...
llvm-svn: 22327
2005-07-01 23:56:38 +00:00
Chris Lattner
6a865d5a22
Varargs is apparently currently broken on PPC. This hacks it so that it
...
is at least overloading the right virtual methods. The implementations
are currently wrong though. This fixes Ptrdist/bc, but not other programs
(e.g. siod).
llvm-svn: 22326
2005-07-01 23:11:56 +00:00
Chris Lattner
b299933fc7
Refactor X86AsmPrinter.cpp into multiple files. Patch contributed
...
by Aaron Gray, cleaned up by me.
llvm-svn: 22324
2005-07-01 22:44:09 +00:00
Andrew Lenharth
b1de98d654
simplify call code, remove pseudo ops for div and rem, track more loads and stores
...
llvm-svn: 22323
2005-07-01 19:14:02 +00:00
Andrew Lenharth
f2c8cd0c36
simplify call code, remove pseudo ops for div and rem, track more loads and stores
...
llvm-svn: 22322
2005-07-01 19:12:13 +00:00
Chris Lattner
c2438fe76f
remove some debugging code
...
llvm-svn: 22321
2005-07-01 06:40:58 +00:00
Andrew Lenharth
b8c48ce74e
oops
...
llvm-svn: 22320
2005-06-30 19:32:57 +00:00
Andrew Lenharth
04aa18bd2a
FP EXTLOAD is not support on all archs, expand to LOAD and FP_EXTEND
...
llvm-svn: 22319
2005-06-30 19:22:37 +00:00
Chris Lattner
02fe175f3d
Fix PR590 and Transforms/Mem2Reg/2005-06-30-ReadBeforeWrite.ll.
...
The optimization for locally used allocas was not safe for allocas that
were read before they were written. This change disables that optimization
in that case.
llvm-svn: 22318
2005-06-30 07:29:44 +00:00
Nate Begeman
31e3028bac
Make the x86 asm printer darwin-aware. This mostly entails doing the same
...
thing as cygwin most of the time, and printing our alignments in log2
rather than number of bytes.
llvm-svn: 22316
2005-06-30 00:53:20 +00:00
Andrew Lenharth
898efb338a
restore old srcValueNode behavior and try to to work around it
...
llvm-svn: 22315
2005-06-29 18:54:02 +00:00
John Criswell
a6620d4a6e
Doh! Forgot to LLVMify the style.
...
llvm-svn: 22312
2005-06-29 15:57:50 +00:00
Andrew Lenharth
edccb834bb
tracking the instructions causing loads and stores provides more information than just the pointer being loaded or stored
...
llvm-svn: 22311
2005-06-29 15:57:19 +00:00
John Criswell
1bafe064da
Basic fix for PR#591; don't convert an fprintf() to an fwrite() if there
...
is a mismatch in their character type pointers (i.e. fprintf() prints an
array of ubytes while fwrite() takes an array of sbytes).
We can probably do better than this (such as casting the ubyte to an
sbyte).
llvm-svn: 22310
2005-06-29 15:03:18 +00:00
Andrew Lenharth
781dd8e05f
thinko
...
llvm-svn: 22309
2005-06-29 13:35:05 +00:00
Andrew Lenharth
6b4dbd7cd5
unify SelectExpr and SelectFP
...
llvm-svn: 22308
2005-06-29 12:49:51 +00:00
Andrew Lenharth
88491475e2
fix most regressions
...
llvm-svn: 22307
2005-06-29 12:23:34 +00:00
Andrew Lenharth
172871ba0f
support more relocations for stores also
...
llvm-svn: 22306
2005-06-29 00:39:17 +00:00
Andrew Lenharth
41d08a0bbe
Get rid of all symbolic loads. I now do gernate all relocations sequences
...
rather than relying on the assembler. Only a few more pseudo instructions
left. Also merge load code paths.
llvm-svn: 22305
2005-06-29 00:31:08 +00:00
Andrew Lenharth
d1dbc8ab27
some call work
...
llvm-svn: 22303
2005-06-27 23:59:51 +00:00
Andrew Lenharth
d534c5cb2a
Adapt the code for handling uint -> fp conversion for the 32 bit case to
...
handling it in the 64 bit case. The two code paths should probably be merged.
llvm-svn: 22302
2005-06-27 23:28:32 +00:00
Andrew Lenharth
cc12cd8c5a
So, it turns out I forgot that one valid way of restoring GP after a call
...
is to use RA, which assumes the called function uses RA for the register
holding the return address when it issues a ret.
llvm-svn: 22301
2005-06-27 23:24:11 +00:00
Nate Begeman
032a94775d
Initial set of .td file changes necessary to get scalar fp in xmm registers
...
working. The instruction selector changes will hopefully be coming later
this week once they are debugged. This is necessary to support the darwin
x86 FP model, and is recommended by intel as the replacement for x87. As
a bonus, the register allocator knows how to deal with these registers
across basic blocks, unliky the FP stackifier. This leads to significantly
better codegen in several cases.
llvm-svn: 22300
2005-06-27 21:20:31 +00:00
Andrew Lenharth
34630b5ab0
get rid of another pseudo op
...
llvm-svn: 22299
2005-06-27 21:11:40 +00:00
Andrew Lenharth
b80c19b01a
generate address of constant pool entries
...
llvm-svn: 22298
2005-06-27 21:02:56 +00:00
Andrew Lenharth
6e30e970ed
Misha happification patch
...
llvm-svn: 22297
2005-06-27 17:39:17 +00:00
Andrew Lenharth
a3f70592a7
Reduce use of pseudo ops
...
Namely, output the rellocation flags explicitly when loading constants.
Added benifit: save a load when loading from the constant pool.
llvm-svn: 22296
2005-06-27 17:15:36 +00:00
Andrew Lenharth
573514894c
missed a load
...
llvm-svn: 22295
2005-06-27 16:40:26 +00:00
Andrew Lenharth
ac3ecf5338
make constant pool labels local
...
llvm-svn: 22294
2005-06-27 16:29:54 +00:00
Andrew Lenharth
f50cb3fad2
who said we had to use the return address in the return address register. Might save a move in many cases
...
llvm-svn: 22293
2005-06-27 15:36:48 +00:00
Chris Lattner
cd6b5c5011
Add support to the X86 backend for emitting ELF files. To use this, we
...
currently use: llc t.bc --filetype=obj
This will produce a t.o file which is dumpable with readelf. Currently
the file produced is empty, but the scaffolding to do more is now in place.
llvm-svn: 22292
2005-06-27 06:30:12 +00:00
Chris Lattner
8be1980730
iniital checkin of ELFWriter implementation
...
For now, the elf writer is only capable of emitting an empty elf file, with
a section table and a section table string table. This will be enhanced
in the future :)
llvm-svn: 22291
2005-06-27 06:29:00 +00:00
Andrew Lenharth
9dc5d846ee
depend more on legalize putting constants on the RHS
...
llvm-svn: 22289
2005-06-26 23:01:11 +00:00
Andrew Lenharth
91bc570aac
With setOperationAction(ISD::UINT_TO_FP, MVT::i64, Expand), Legalize
...
should be able to handle this case. The code is there, so let's see
if it works.
llvm-svn: 22288
2005-06-26 22:23:06 +00:00
Chris Lattner
06282f51cf
Refactor the addPassesToEmitAssembly interface into a addPassesToEmitFile
...
interface.
llvm-svn: 22282
2005-06-25 02:48:37 +00:00
Chris Lattner
6f3c7b46ee
Fix grammar
...
llvm-svn: 22279
2005-06-24 18:00:40 +00:00
Chris Lattner
eb08628106
add a debug type
...
llvm-svn: 22277
2005-06-24 16:00:46 +00:00
Andrew Lenharth
17f46306d6
remove a pseudo instruction, make ret always right, and fix vararg chains
...
llvm-svn: 22276
2005-06-23 23:42:05 +00:00
Andrew Lenharth
51d9d1b763
finally, Working varargs
...
llvm-svn: 22275
2005-06-23 16:48:51 +00:00
Andrew Lenharth
eda77c60a0
more complete Lowering for vacopy and vaarg
...
llvm-svn: 22274
2005-06-22 23:04:28 +00:00
Andrew Lenharth
4fd2bde906
If we support structs as va_list, we must pass pointers to them to va_copy
...
See last commit for LangRef, this implements it on all targets.
llvm-svn: 22273
2005-06-22 21:04:42 +00:00
Andrew Lenharth
e54b651806
Make it easier to find alpha stuff in doxygen, and fixup labeling
...
of memory instructions in the assembly, to allow later linking
of traces with LLVM Value*s.
llvm-svn: 22271
2005-06-22 17:19:45 +00:00
John Criswell
00c8485c77
Fixed indentation.
...
llvm-svn: 22270
2005-06-20 19:59:22 +00:00
Andrew Lenharth
ce6f907ffe
because some functions just use va_start and pass things to vfprintf
...
llvm-svn: 22269
2005-06-20 15:41:37 +00:00
Andrew Lenharth
4e1c8055ea
the correct fix was to fix AliasAnalysis.getModRefInfo
...
llvm-svn: 22268
2005-06-20 15:25:22 +00:00
Andrew Lenharth
262b657737
prevent GCSE from forwarding stores to loads around vaarg. This is uggly, and I am trying to fix the AliasInfo, as it should catch the problem instead.
...
llvm-svn: 22266
2005-06-20 15:02:05 +00:00
Andrew Lenharth
08ff634c2b
prevent va_arg from being hoisted from a loop
...
llvm-svn: 22265
2005-06-20 13:36:33 +00:00
Andrew Lenharth
cdaaa66e7d
prevent DCE of vaarg intrinsics. This should take care of most regressions
...
llvm-svn: 22263
2005-06-19 14:41:20 +00:00
Andrew Lenharth
231216b573
va_end fix
...
llvm-svn: 22262
2005-06-19 14:04:55 +00:00
Andrew Lenharth
4a1dc74471
so this doesn't crash when run. It is hard to tell if things are right enough to work correctly with all the TmpInstructions running around
...
llvm-svn: 22261
2005-06-19 05:45:00 +00:00
Andrew Lenharth
6bbe9d92c6
add a check for the mixing of vaarg and vanext with va_arg
...
llvm-svn: 22260
2005-06-19 03:53:56 +00:00
Andrew Lenharth
5750531305
OK, at least get rid of old stuff, and mark what needs to be fixed for V9
...
llvm-svn: 22255
2005-06-18 18:46:40 +00:00
Andrew Lenharth
a9214fec08
core changes for varargs
...
llvm-svn: 22254
2005-06-18 18:34:52 +00:00
Reid Spencer
a6012f9023
Fix a problem with the strcmp optimization checking the wrong string and
...
not casting to the correct type.
llvm-svn: 22250
2005-06-18 17:46:28 +00:00
Reid Spencer
678c9a3b00
Clean up some uninitialized variables and missing return statements that
...
GCC 4.0.0 compiler (sometimes incorrectly) warns about under release build.
llvm-svn: 22249
2005-06-18 17:37:34 +00:00
Andrew Lenharth
0bb2dab54a
A start at a Sparc V8 Pattern ISel. Anyone want to implement the calling
...
convention? ;)
llvm-svn: 22247
2005-06-17 16:52:12 +00:00
Chris Lattner
70914ca850
silence incredibly braindead GCC 4 warning
...
llvm-svn: 22246
2005-06-17 13:44:07 +00:00
Chris Lattner
dce633f2dd
silence a bogus warning
...
llvm-svn: 22245
2005-06-17 13:23:32 +00:00
Tanya Lattner
2114488760
Removed IIIi specific changes. This should be fixed to add floating point deps for the IIi.
...
llvm-svn: 22243
2005-06-17 04:21:09 +00:00
Tanya Lattner
c6760c1661
Special dep graph for SMS for superblocks.
...
llvm-svn: 22242
2005-06-17 04:16:14 +00:00
Tanya Lattner
7b1d09e9b2
Special versions of the dep graph and scheduled for SMS for superblocks.
...
llvm-svn: 22241
2005-06-17 04:15:43 +00:00
Tanya Lattner
6d38454b14
Added statistic to count number of spills.
...
llvm-svn: 22240
2005-06-17 04:01:34 +00:00
Tanya Lattner
3d6e51fdac
Numerous bug fixes and the completed modschedSB algorithm (minor bugs still exist for course).
...
llvm-svn: 22239
2005-06-17 04:00:57 +00:00
Tanya Lattner
df10cee694
Added SMS for superblocks as an option (experimental)
...
llvm-svn: 22238
2005-06-17 04:00:22 +00:00
Chris Lattner
11bbeace0c
This is not true: (X != 13 | X < 15) -> X < 15
...
It is actually always true. This fixes PR586 and
Transforms/InstCombine/2005-06-16-SetCCOrSetCCMiscompile.ll
llvm-svn: 22236
2005-06-17 03:59:17 +00:00
Chris Lattner
01a5794292
Don't crash when dealing with INTMIN. This fixes PR585 and
...
Transforms/InstCombine/2005-06-16-RangeCrash.ll
llvm-svn: 22234
2005-06-17 02:05:55 +00:00
Chris Lattner
8c76d5c957
Don't crash on: X = phi (X, X).
...
This fixes PR584 and Transforms/SimplifyCFG/2005-06-16-PHICrash.ll
llvm-svn: 22232
2005-06-17 01:45:53 +00:00
Chris Lattner
226f919ead
avoid constructing out of range shift amounts.
...
llvm-svn: 22230
2005-06-17 01:29:28 +00:00
Nate Begeman
ed49a51836
Fix bug 537 test 2, which checks to make sure that we fold A+(B-A) -> B for
...
integer types. Add a couple checks to not perform these kinds of transform
on floating point values.
llvm-svn: 22228
2005-06-16 07:06:03 +00:00
Chris Lattner
f95b989825
Fix PR583 and testcase Transforms/InstCombine/2005-06-15-DivSelectCrash.ll
...
llvm-svn: 22227
2005-06-16 04:55:52 +00:00
Chris Lattner
4af04a8d54
Fix PR571, removing code that does just the WRONG thing :)
...
llvm-svn: 22225
2005-06-16 03:00:08 +00:00
Chris Lattner
b99bf21182
Fix a bug in my previous patch. Do not get the shift amount type (which
...
is always ubyte, get the type being shifted). This unbreaks espresso
llvm-svn: 22224
2005-06-16 01:52:07 +00:00
Chris Lattner
4cff3f786f
Fix PR575, patch provided by John Mellor-Crummey. Thanks!
...
llvm-svn: 22223
2005-06-15 22:49:30 +00:00
Chris Lattner
f1369e9532
Fix PR582. The rewriter can move casts around, which invalidated the
...
BB iterator. This fixes Transforms/IndVarsSimplify/2005-06-15-InstMoveCrash.ll
llvm-svn: 22221
2005-06-15 21:29:31 +00:00
Chris Lattner
369ba5da69
Do not promote globals only used by main to locals if there are constantexprs
...
or other uses hanging off of them.
llvm-svn: 22219
2005-06-15 21:11:48 +00:00
Chris Lattner
d553048155
Fix PR577 and testcase InstCombine/2005-06-15-ShiftSetCCCrash.ll.
...
Do not perform undefined out of range shifts.
llvm-svn: 22217
2005-06-15 20:53:31 +00:00
Reid Spencer
3a30fa7ec0
Put the hack back in that removes features, causes regressions to fail, but
...
allows test programs to succeed. Actual fix for this is forthcoming.
llvm-svn: 22213
2005-06-15 18:25:30 +00:00
Nate Begeman
12cd2d8d99
Commit fix for generating conditional branch pseudo instructions that
...
avoids dereferencing the end() iterator when selecting the fallthrough
block. This requires an ilist change.
llvm-svn: 22212
2005-06-15 18:22:43 +00:00
Nate Begeman
9bb1be2eec
Commit a small improvement that is already in the x86 and ia64 backends to
...
not generate unnecessary register copies. This improves compile time by
2-5% depending on the test.
llvm-svn: 22210
2005-06-14 03:55:23 +00:00
Reid Spencer
202eb6ff93
Unbreak several InstCombine regression checks introduced by a hack to
...
fix the bzip2 test. A better hack is needed.
llvm-svn: 22209
2005-06-13 06:41:26 +00:00
Nate Begeman
a2f68cf0f9
When compiled with GCC 4.0, a latent bug was exposed where both SparcV9
...
and the target independant register allocator were both using a class named
'LiveRange'. This lead to the target independant code calling code in the
SparcV9 backend, which crashed. Fixed by renaming SparcV9's LiveRange to
V9LiveRange.
llvm-svn: 22208
2005-06-12 23:52:58 +00:00
Nate Begeman
f516b866e5
Fix a memory smasher caught by Mac OS X's debug malloc library. We were
...
incorrectly using an iterator after it was invalid.
llvm-svn: 22207
2005-06-12 23:50:33 +00:00
Chris Lattner
9d3c2260d0
Fix a 64-bit problem, passing (int)0 through ... instead of (void*)0
...
llvm-svn: 22206
2005-06-09 03:32:54 +00:00
Chris Lattner
092a738e18
Fix a problem on 64-bit targets where we passed (int)0 through ... instead of
...
(void*)0.
llvm-svn: 22205
2005-06-09 02:59:00 +00:00
Andrew Lenharth
ec1d1444bd
fix BranchCC with a setCC with an arg of 0
...
llvm-svn: 22203
2005-06-08 18:02:21 +00:00
Reid Spencer
a88b91d681
For PR572:
...
Undefine the PPC symbol which is defined by Linux/PPC (erroneously) so it
doesn't pollute the user namespace and clash with our namespace declarations.
llvm-svn: 22202
2005-06-08 17:44:48 +00:00
Nate Begeman
47cd13d42a
Handle some more real world cases of rlwimi. These don't come up that
...
regularly in "normal" code, but for things like software graphics, they
make a big difference.
For the following code:
unsigned short Trans16Bit(unsigned srcA,unsigned srcB,unsigned alpha)
{
unsigned tmpA,tmpB,mixed;
tmpA = ((srcA & 0x03E0) << 15) | (srcA & 0x7C1F);
tmpB = ((srcB & 0x03E0) << 15) | (srcB & 0x7C1F);
mixed = (tmpA * alpha) + (tmpB * (32 - alpha));
return ((mixed >> 5) & 0x7C1F) | ((mixed >> 20) & 0x03E0);
}
We now generate:
_Trans16Bit:
.LBB_Trans16Bit_0: ; entry
andi. r2, r4, 31775
rlwimi r2, r4, 15, 7, 11
subfic r4, r5, 32
mullw r2, r2, r4
andi. r4, r3, 31775
rlwimi r4, r3, 15, 7, 11
mullw r3, r4, r5
add r2, r2, r3
srwi r3, r2, 5
andi. r3, r3, 31775
rlwimi r3, r2, 12, 22, 26
blr
Instead of:
_Trans16Bit:
.LBB_Trans16Bit_0: ; entry
slwi r2, r4, 15
rlwinm r2, r2, 0, 7, 11
andi. r4, r4, 31775
or r2, r2, r4
subfic r4, r5, 32
mullw r2, r2, r4
slwi r4, r3, 15
rlwinm r4, r4, 0, 7, 11
andi. r3, r3, 31775
or r3, r4, r3
mullw r3, r3, r5
add r2, r2, r3
srwi r3, r2, 5
andi. r3, r3, 31775
srwi r2, r2, 20
rlwimi r3, r2, 0, 22, 26
blr
llvm-svn: 22201
2005-06-08 04:14:27 +00:00
Nate Begeman
023a21ea32
Fix lli linking on Mac OS X 10.4.1 for Intel.
...
llvm-svn: 22200
2005-06-08 01:02:38 +00:00
Andrew Lenharth
e6b85af482
Remove code for conversion from old style va_args. Preparing the way for
...
returning to the old style :)
llvm-svn: 22199
2005-06-08 00:49:08 +00:00
Misha Brukman
49f75fc763
Fix spelling of `correlate'
...
llvm-svn: 22196
2005-06-06 19:08:04 +00:00
Andrew Lenharth
03f6e6dbb6
allow marking of loads and stores in the instruction stream with enough information to reconstruct the Value* if it existed
...
llvm-svn: 22195
2005-06-06 19:03:55 +00:00
Andrew Lenharth
7ae4989a1f
hide basic block labels. The utility of these for debuging is long since passed
...
llvm-svn: 22194
2005-06-06 19:03:09 +00:00
Misha Brukman
c1841dd82f
* Replace block of commented-out lines with #if 0
...
* Remove warning "control reaches end of non-void function"
llvm-svn: 22193
2005-06-06 17:39:46 +00:00