- Jun 14, 2008
-
-
Evan Cheng authored
Teach the spiller to commute instructions in order to fold a reload. This hits 410 times on 444.namd and 122 times on 252.eon. llvm-svn: 52266
-
- Jun 13, 2008
-
-
Duncan Sands authored
wrong for volatile loads and stores. In fact this is almost all of them! There are three types of problems: (1) it is wrong to change the width of a volatile memory access. These may be used to do memory mapped i/o, in which case a load can have an effect even if the result is not used. Consider loading an i32 but only using the lower 8 bits. It is wrong to change this into a load of an i8, because you are no longer tickling the other three bytes. It is also unwise to make a load/store wider. For example, changing an i16 load into an i32 load is wrong no matter how aligned things are, since the fact of loading an additional 2 bytes can have i/o side-effects. (2) it is wrong to change the number of volatile load/stores: they may be counted by the hardware. (3) it is wrong to change a volatile load/store that requires one memory access into one that requires several. For example on x86-32, you can store a double in one processor operation, but to store an i64 requires two (two i32 stores). In a multi-threaded program you may want to bitcast an i64 to a double and store as a double because that will occur atomically, and be indivisible to other threads. So it would be wrong to convert the store-of-double into a store of an i64, because this will become two i32 stores - no longer atomic. My policy here is to say that the number of processor operations for an illegal operation is undefined. So it is alright to change a store of an i64 (requires at least two stores; but could be validly lowered to memcpy for example) into a store of double (one processor op). In short, if the new store is legal and has the same size then I say that the transform is ok. It would also be possible to say that transforms are always ok if before they were illegal, whether after they are illegal or not, but that's more awkward to do and I doubt it buys us anything much. However this exposed an interesting thing - on x86-32 a store of i64 is considered legal! That is because operations are marked legal by default, regardless of whether the type is legal or not. In some ways this is clever: before type legalization this means that operations on illegal types are considered legal; after type legalization there are no illegal types so now operations are only legal if they really are. But I consider this to be too cunning for mere mortals. Better to do things explicitly by testing AfterLegalize. So I have changed things so that operations with illegal types are considered illegal - indeed they can never map to a machine operation. However this means that the DAG combiner is more conservative because before it was "accidentally" performing transforms where the type was illegal because the operation was nonetheless marked legal. So in a few such places I added a check on AfterLegalize, which I suppose was actually just forgotten before. This causes the DAG combiner to do slightly more than it used to, which resulted in the X86 backend blowing up because it got a slightly surprising node it wasn't expecting, so I tweaked it. llvm-svn: 52254
-
- Jun 11, 2008
-
-
Duncan Sands authored
maps can be deleted. This happens when RAUW replaces a node N with another equivalent node E, deleting the first node. Solve this by adding (N, E) to ReplacedNodes, which is already used to remap nodes to replacements. This means that deleted nodes are being allowed in maps, which can be delicate: the memory may be reused for a new node which might get confused with the old deleted node pointer hanging around in the maps, so detect this and flush out maps if it occurs (ExpungeNode). The expunging operation is expensive, however it never occurs during a llvm-gcc bootstrap or anywhere in the nightly testsuite. It occurs three times in "make check": Alpha/illegal-element-type.ll, PowerPC/illegal-element-type.ll and X86/mmx-shift.ll. If expunging proves to be too expensive then there are other more complicated ways of solving the problem. In the normal case this patch adds the overhead of a few more map lookups, which is hopefully negligable. llvm-svn: 52214
-
- Jun 10, 2008
-
-
Dan Gohman authored
value, which is something that apparently isn't used much. llvm-svn: 52158
-
- Jun 09, 2008
-
-
Dan Gohman authored
llvm-svn: 52156
-
Duncan Sands authored
change for non-funky-sized integers. llvm-svn: 52151
-
Dan Gohman authored
llvm-svn: 52150
-
Duncan Sands authored
of integer types. Fix the isMask APInt method to actually work (hopefully) rather than crashing because it adds apints of different bitwidths. It looks like isShiftedMask is also broken, but I'm leaving that one to the APInt people (it is not used anywhere). llvm-svn: 52142
-
- Jun 08, 2008
-
-
Duncan Sands authored
of apint codegen failure is the DAG combiner doing the wrong thing because it was comparing MVT's using < rather than comparing the number of bits. Removing the < method makes this mistake impossible to commit. Instead, add helper methods for comparing bits and use them. llvm-svn: 52098
-
- Jun 07, 2008
-
-
Dan Gohman authored
stores of aggregate values. llvm-svn: 52069
-
Owen Anderson authored
no visible functionality change, but enables a future patch where node creation will update the CFG if it decides to create an unconditional rather than a conditional branch. llvm-svn: 52067
-
- Jun 06, 2008
-
-
Evan Cheng authored
llvm-svn: 52057
-
Duncan Sands authored
llvm-svn: 52045
-
Duncan Sands authored
and better control the abstraction. Rename the type to MVT. To update out-of-tree patches, the main thing to do is to rename MVT::ValueType to MVT, and rewrite expressions like MVT::getSizeInBits(VT) in the form VT.getSizeInBits(). Use VT.getSimpleVT() to extract a MVT::SimpleValueType for use in switch statements (you will get an assert failure if VT is an extended value type - these shouldn't exist after type legalization). This results in a small speedup of codegen and no new testsuite failures (x86-64 linux). llvm-svn: 52044
-
Evan Cheng authored
llvm-svn: 52040
-
- Jun 05, 2008
-
-
Owen Anderson authored
llvm-svn: 52016
-
Owen Anderson authored
llvm-svn: 52013
-
Owen Anderson authored
llvm-svn: 52012
-
Evan Cheng authored
Fix a memcpy lowering bug. Even though the memcpy alignment is smaller than the desired alignment, the frame destination alignment may still be larger than the desired alignment. Don't change its alignment to something smaller. llvm-svn: 51970
-
- Jun 04, 2008
-
-
Evan Cheng authored
llvm-svn: 51953
-
Owen Anderson authored
Correctly construct live intervals for the copies we inserted into the predecessors of a block containing a PHI. llvm-svn: 51950
-
Evan Cheng authored
llvm-svn: 51949
-
Evan Cheng authored
llvm-svn: 51934
-
Evan Cheng authored
llvm-svn: 51933
-
Evan Cheng authored
llvm-svn: 51932
-
Evan Cheng authored
llvm-svn: 51931
-
Duncan Sands authored
are the same as in unpacked structs, only field positions differ. This only matters for structs containing x86 long double or an apint; it may cause backwards compatibility problems if someone has bitcode containing a packed struct with a field of one of those types. The issue is that only 10 bytes are needed to hold an x86 long double: the store size is 10 bytes, but the ABI size is 12 or 16 bytes (linux/ darwin) which comes from rounding the store size up by the alignment. Because it seemed silly not to pack an x86 long double into 10 bytes in a packed struct, this is what was done. I now think this was a mistake. Reserving the ABI size for an x86 long double field even in a packed struct makes things more uniform: the ABI size is now always used when reserving space for a type. This means that developers are less likely to make mistakes. It also makes life easier for the CBE which otherwise could not represent all LLVM packed structs (PR2402). Front-end people might need to adjust the way they create LLVM structs - see following change to llvm-gcc. llvm-svn: 51928
-
Owen Anderson authored
llvm-svn: 51922
-
- Jun 03, 2008
-
-
Scott Michel authored
llvm-svn: 51917
-
Scott Michel authored
llvm-svn: 51904
-
Bruno Cardoso Lopes authored
the solution commited is different from the previous patch to avoid int and unsigned comparison llvm-svn: 51899
-
Evan Cheng authored
llvm-svn: 51898
-
Scott Michel authored
llvm-svn: 51897
-
Dan Gohman authored
for dagcombine to do this. llvm-svn: 51886
-
Scott Michel authored
constant shows up in the assembly language output. Helps with debugging without a HP calculator having to be handy. llvm-svn: 51885
-
Scott Michel authored
issue is operand promotion for setcc/select... but looks like the fundamental stuff is implemented for CellSPU. llvm-svn: 51884
-
- Jun 02, 2008
-
-
Owen Anderson authored
llvm-svn: 51876
-
- May 31, 2008
-
-
Dan Gohman authored
llvm-svn: 51807
-
Evan Cheng authored
llvm-svn: 51793
-
Owen Anderson authored
llvm-svn: 51790
-