Duncan Sands
830037ab2d
Revert this part of r45073 until the verifier is
...
changed not to reject invoke of inline asm.
llvm-svn: 45077
2007-12-16 21:01:21 +00:00
Chris Lattner
5e2b033d30
don't violate C TBAA rules, use FloatToBits instead.
...
llvm-svn: 45076
2007-12-16 20:41:33 +00:00
Chris Lattner
f04ce286e2
fix a questionable cast, thanks to Mike Stump for pointing this out.
...
llvm-svn: 45075
2007-12-16 20:26:54 +00:00
Chris Lattner
c6fd78dec1
Fix the JIT encoding of cmp*ss, which aborts with this assertion currently:
...
X86CodeEmitter.cpp:378: failed assertion `0 && "Immediate size not set!"'
I *think* this is right, but Evan, please verify. It also looks like
CMPSDrr and maybe others are missing this info. Evan, plz investigate.
llvm-svn: 45074
2007-12-16 20:12:41 +00:00
Duncan Sands
bf62f62058
Make instcombine promote inline asm calls to 'nounwind'
...
calls. Remove special casing of inline asm from the
inliner. There is a potential problem: the verifier
rejects invokes of inline asm (not sure why). If an
asm call is not marked "nounwind" in some .ll, and
instcombine is not run, but the inliner is run, then
an illegal module will be created. This is bad but
I'm not sure what the best approach is. I'm tempted
to remove the check in the verifier...
llvm-svn: 45073
2007-12-16 15:51:49 +00:00
Bill Wendling
cc0088ff41
Remove spurious warnings from GCC:
...
warning: suggest a space before ';' or explicit braces around empty
body in 'for' statement
Patch by Mike Stump (modified slightly by yours truly).
llvm-svn: 45071
2007-12-16 09:16:12 +00:00
Owen Anderson
708d9d117b
Break local interferences in StrongPHIElimination. One step closer...
...
llvm-svn: 45070
2007-12-16 05:44:27 +00:00
Owen Anderson
3e37ec0942
A few more comments.
...
llvm-svn: 45069
2007-12-16 04:07:23 +00:00
Duncan Sands
15b126c3f2
These are more correctly called signaling NaNs.
...
llvm-svn: 45059
2007-12-15 17:37:40 +00:00
Evan Cheng
1d95b669b6
Make better use of instructions that clear high bits; fix various 2-wide shuffle bugs.
...
llvm-svn: 45058
2007-12-15 03:00:47 +00:00
Scott Michel
307f334014
Start committing working test cases for CellSPU.
...
llvm-svn: 45050
2007-12-15 00:38:50 +00:00
Evan Cheng
55e450d6eb
Actually, MOVPQIto64mr is a dup of MOVPQI2QImr, MOV64toPQIrm is a dup of MOVQI2PQIrm.
...
llvm-svn: 45041
2007-12-14 20:08:14 +00:00
Evan Cheng
0a36fa6625
Fix (mem) <-> low 64-bits of xmm bugs pointed out by David Greene. Mac OS X Leopard assembler recognizes movq.
...
llvm-svn: 45040
2007-12-14 19:54:07 +00:00
Duncan Sands
091a505971
Teach the interpreter to read and write memory in the
...
endianness of the target not of the host. Done by the
simple expedient of reversing bytes for primitive types
if the host and target endianness don't match. This is
correct for integer and pointer types. I don't know if
it is correct for floating point types.
llvm-svn: 45039
2007-12-14 19:38:31 +00:00
Dale Johannesen
1e083ec1f6
x86-32 long doubles are 4-byte aligned on the stack
...
for parameter passing (only for that, on Darwin).
llvm-svn: 45038
2007-12-14 19:25:34 +00:00
Evan Cheng
42f27a28a4
Fix bsf / bsr jit encoding.
...
llvm-svn: 45037
2007-12-14 18:49:43 +00:00
Evan Cheng
375141a82d
Oops. Forgot these.
...
llvm-svn: 45036
2007-12-14 18:25:34 +00:00
Dan Gohman
80af3e255d
Add explicit keywords, and fix a minor typo that they uncovered.
...
llvm-svn: 45034
2007-12-14 15:41:34 +00:00
Dan Gohman
0efc49e9b8
Fix Intel asm syntax for the bsr and bsf instructions.
...
llvm-svn: 45030
2007-12-14 15:10:00 +00:00
Evan Cheng
6909ff8c4b
Fix ctlz and cttz. llvm definition requires them to return number of bits in of the src type when value is zero.
...
llvm-svn: 45029
2007-12-14 08:30:15 +00:00
Evan Cheng
713b398a35
Bug fix. Must also match ResNo when matching an operand with a user.
...
llvm-svn: 45028
2007-12-14 08:25:15 +00:00
Anders Carlsson
900a684ae7
All MMX shift instructions took a <2 x i32> vector as the shift amount parameter. Change this to be <1 x i64> instead, which matches the assembler instruction.
...
llvm-svn: 45027
2007-12-14 06:38:54 +00:00
Evan Cheng
51cf86ded0
Implement ctlz and cttz with bsr and bsf.
...
llvm-svn: 45024
2007-12-14 02:13:44 +00:00
Bill Wendling
c8c611e88f
Add flags to indicate that there are "never" side effects or that there "may be"
...
side effects for machine instructions.
llvm-svn: 45022
2007-12-14 01:48:59 +00:00
Wojciech Matyjewicz
d76f256282
Make these loops follow GetGEPOperands() behavior.
...
Let: %q = GEP %p, X, ...
If %p is a GEP, we can chase baseptr further, only if X==0.
llvm-svn: 44999
2007-12-13 16:22:58 +00:00
Evan Cheng
4acb4eb95e
Fix typo.
...
llvm-svn: 44997
2007-12-13 07:50:36 +00:00
Owen Anderson
22aee19b7e
Add register pairs to the list to check for local interferences.
...
llvm-svn: 44987
2007-12-13 05:53:03 +00:00
Owen Anderson
78b8141ce7
Remove ugly and horrible code. It's not necessary for correctness, and can be added back later if it causes code quality issues.
...
llvm-svn: 44986
2007-12-13 05:43:37 +00:00
Evan Cheng
a152909956
Be extra careful with extension use optimation. Now turned on by default.
...
llvm-svn: 44981
2007-12-13 03:32:53 +00:00
Evan Cheng
343929c773
Fold some and + shift in x86 addressing mode.
...
llvm-svn: 44970
2007-12-13 00:43:27 +00:00
Chris Lattner
295507d238
Fix for edge profiling, patch by 'Marc' for PR1857
...
llvm-svn: 44965
2007-12-13 00:04:46 +00:00
Evan Cheng
64a1febf9a
Implicit def instructions, e.g. X86::IMPLICIT_DEF_GR32, are always re-materializable and they should not be spilled.
...
llvm-svn: 44960
2007-12-12 23:12:09 +00:00
Duncan Sands
47526c4a42
Remove host endianness info from TargetData and
...
put it in a new header System/Host.h instead.
Instead of getting the endianness from configure,
calculate it directly.
llvm-svn: 44959
2007-12-12 23:03:45 +00:00
Dan Gohman
0075ea1f5f
Allow vector integer constants to be created with
...
SelectionDAG::getConstant, in the same way as vector floating-point
constants. This allows the legalize expansion code for @llvm.ctpop and
friends to be usable with vector types.
llvm-svn: 44954
2007-12-12 22:21:26 +00:00
Duncan Sands
998cd21867
Revert r44626, which turned off the use of readonly
...
and readnone for functions with bodies because it
broke llvm-gcc-4.2 bootstrap. It turns out that,
because of LLVM's array_ref hack, gcc was computing
pure/const attributes wrong (now fixed by turning
off the gcc ipa-pure-const pass).
llvm-svn: 44937
2007-12-12 16:01:40 +00:00
Wojciech Matyjewicz
8bb1d9e67c
1. "Upgrage" comments.
...
2. Using zero-extended value of Scale and unsigned division is safe provided
that Scale doesn't have the sign bit set.
Previously these 2 instructions:
%p = bitcast [100 x {i8,i8,i8}]* %x to i8*
%q = getelementptr i8* %p, i32 -4
were combined into:
%q = getelementptr [100 x { i8, i8, i8 }]* %x, i32 0,
i32 1431655764, i32 0
what was incorrect.
llvm-svn: 44936
2007-12-12 15:21:32 +00:00
Christopher Lamb
8187d5cde7
Regenerate.
...
llvm-svn: 44934
2007-12-12 08:45:45 +00:00
Christopher Lamb
6d12d7c0fe
Implement part of review feedback for address spaces.
...
llvm-svn: 44933
2007-12-12 08:44:39 +00:00
Evan Cheng
ad3e7f3286
Use shuffles to implement insert_vector_elt for i32, i64, f32, and f64.
...
llvm-svn: 44929
2007-12-12 07:55:34 +00:00
Evan Cheng
d36d69fe92
Lower a build_vector with all constants into a constpool load unless it can be done with a move to low part.
...
llvm-svn: 44921
2007-12-12 06:45:40 +00:00
Zhou Sheng
cba8d83b9a
Add a guard to cxxabi header as other platform may
...
not support it.
llvm-svn: 44914
2007-12-12 06:16:47 +00:00
Zhou Sheng
089df5d640
Fixed PR1629.
...
Make lli interpreter correctly call external functions sin()/cos(),
__cxa_guard_acquire() and __cxa_guard_release().
llvm-svn: 44910
2007-12-12 04:55:43 +00:00
Chris Lattner
77ca8bde9d
Fix a bug in my previous patch, thanks to Jay Foad for
...
pointing this out and correcting the patch!
llvm-svn: 44907
2007-12-12 03:56:54 +00:00
Evan Cheng
bb418c4551
Don't muck with phi nodes; bug fixes.
...
llvm-svn: 44905
2007-12-12 02:53:41 +00:00
Scott Michel
81b4099173
Correct typo for Linux: s/esp/%rsp/
...
llvm-svn: 44904
2007-12-12 02:38:28 +00:00
Owen Anderson
70df68f12d
Forgot to remove a register from the PHI-union after I'd determined that it
...
interfered with other registers. Seems like that might be a good thing to do. :-)
llvm-svn: 44902
2007-12-12 01:25:08 +00:00
Gordon Henriksen
3f070cf3b9
Add (very basic) bindings for ModuleProvider.
...
llvm-svn: 44899
2007-12-12 01:04:30 +00:00
Evan Cheng
d6ecb2e58d
Bug fix. Only safe to perform extension uses optimization if the source of extension is also defined in the same BB as the extension.
...
llvm-svn: 44896
2007-12-12 00:51:06 +00:00
Daniel Berlin
fcce408d12
Changes from Curtis Dunham implementing lazy cycle detection algorithm.
...
Changes from me implementing different way of representing points-to anything.
Changes from me that improve slightly on LCD.
llvm-svn: 44895
2007-12-12 00:37:04 +00:00
Evan Cheng
283f581d51
If deleting a reload instruction due to reuse (value is available in register R and reload is targeting R), make sure to invalidate the kill information of the last kill.
...
llvm-svn: 44894
2007-12-11 23:36:57 +00:00
Bill Wendling
20a11adc5e
Need to grow the indexed map. Added debug statements.
...
llvm-svn: 44892
2007-12-11 23:27:51 +00:00
Bill Wendling
c92c27f928
Simplify slightly.
...
llvm-svn: 44881
2007-12-11 22:22:22 +00:00
Owen Anderson
fc359fc18b
More progress on StrongPHIElimination. Now we actually USE the DomForest!
...
llvm-svn: 44877
2007-12-11 20:12:11 +00:00
Bill Wendling
9f0bcd67cf
Blark! How in the world did this work without this?!
...
llvm-svn: 44874
2007-12-11 19:40:06 +00:00
Bill Wendling
30281897da
- Update the virtual reg to machine instruction map when hoisting.
...
- Fix subtle bug when creating initially creating this map.
llvm-svn: 44873
2007-12-11 19:17:04 +00:00
Bill Wendling
9f02f24469
Checking for "zero operands" during the "CanHoistInst()" method isn't necessary
...
because those with side effects will be caught by other checks in here.
Also, simplify the check for a BB in a sub loop.
llvm-svn: 44871
2007-12-11 18:45:11 +00:00
Nate Begeman
e9067c13ec
Allow the JIT to encode MMX instructions
...
llvm-svn: 44869
2007-12-11 18:06:14 +00:00
Duncan Sands
9251a8a97f
Fix compilation.
...
llvm-svn: 44864
2007-12-11 12:20:47 +00:00
Christopher Lamb
71a996a387
Regenerate.
...
llvm-svn: 44859
2007-12-11 09:02:08 +00:00
Christopher Lamb
7368604860
Implement address space attribute for LLVM pointer types. Address spaces are
...
regions of memory that have a target specific relationship, as described in the
Embedded C Technical Report.
This also implements the 2007-12-11-AddressSpaces test,
which demonstrates how address space attributes can be used in LLVM IR.
In addition, this patch changes the bitcode signature for stores (in a backwards
compatible manner), such that the pointer type, rather than the pointee type, is
encoded. This permits type information in the pointer (e.g. address space) to be
preserved for stores.
LangRef updates are forthcoming.
llvm-svn: 44858
2007-12-11 08:59:05 +00:00
Chris Lattner
a8b1b4b5d2
Teach VMCore to constant fold shufflevectors with constant operands.
...
This allows us to compile:
#include <emmintrin.h>
typedef __m128i VSInt16;
typedef short vSInt16 __attribute__ ((__vector_size__ (16)));
VSInt16 t3() {
return (VSInt16)((vSInt16)_mm_set1_epi16(6518));
}
into:
_t3:
movaps LCPI1_0, %xmm0
ret
instead of:
_t3:
movl $6518, %eax
movd %eax, %xmm0
pextrw $0, %xmm0, %eax
xorps %xmm0, %xmm0
pinsrw $0, %eax, %xmm0
punpcklwd %xmm0, %xmm0
pshufd $0, %xmm0, %xmm0
ret
llvm-svn: 44856
2007-12-11 07:49:37 +00:00
Chris Lattner
568d56425b
Implement constant folding if vector<->vector bitcasts where the number
...
of source/dest elements changes. This implements
test/Transforms/InstCombine/bitcast-vector-fold.ll
llvm-svn: 44855
2007-12-11 07:29:44 +00:00
Reid Spencer
3a83a29e21
Don't have APInt.cpp depend upon DerivedTypes.h. This helps with splitting the
...
Support libraries separately into their own module.
llvm-svn: 44852
2007-12-11 06:53:58 +00:00
Chris Lattner
b265924121
significantly simplify some code, no functionality change.
...
llvm-svn: 44850
2007-12-11 06:07:39 +00:00
Chris Lattner
3822e8ee5a
refactor some code, no functionality change.
...
llvm-svn: 44849
2007-12-11 05:55:02 +00:00
Evan Cheng
45c08c8337
Switch over to MachineLoopInfo.
...
llvm-svn: 44838
2007-12-11 02:09:15 +00:00
Evan Cheng
b5ceb5ae06
Pretty print shuffle mask operand.
...
llvm-svn: 44837
2007-12-11 02:08:35 +00:00
Evan Cheng
f6c2838f36
- Improved v8i16 shuffle lowering. It now uses pshuflw and pshufhw as much as
...
possible before resorting to pextrw and pinsrw.
- Better codegen for v4i32 shuffles masquerading as v8i16 or v16i8 shuffles.
- Improves (i16 extract_vector_element 0) codegen by recognizing
(i32 extract_vector_element 0) does not require a pextrw.
llvm-svn: 44836
2007-12-11 01:46:18 +00:00
Nate Begeman
8b194d1718
x86 doesn't actually want to custom lower v3i32
...
llvm-svn: 44835
2007-12-11 01:41:33 +00:00
Gordon Henriksen
c6f9e0beef
CollectorMetadata and Collector are rejiggered to get along with
...
per-function collector model. Collector is now the factory for
CollectorMetadata, so the latter may be subclassed.
llvm-svn: 44827
2007-12-11 00:30:17 +00:00
Chris Lattner
f7c53191c0
Move TargetData::hostIsLittleEndian out of line, which means we
...
don't have to #include config.h in it. #including config.h breaks
other projects that have their own autoconf stuff and try to #include
the llvm headers. One obscure example is llvm-gcc.
llvm-svn: 44825
2007-12-11 00:28:59 +00:00
Gordon Henriksen
aff6e2bba2
Adding Ocaml bindings for the bitreader as requested by Sarah
...
Thompson. Usage should be something like this:
open Llvm
open Llvm_bitreader
match read_bitcode_file fn with
| Bitreader_failure msg ->
prerr_endline msg
| Bitreader_success m ->
...;
dispose_module m
Compile with: ocamlc llvm.cma llvm_bitreader.cma
ocamlopt llvm.cmxa llvm_bitreader.cmxa
llvm-svn: 44824
2007-12-11 00:20:48 +00:00
Anton Korobeynikov
005fe34c3b
Hey, English is not my native language :)
...
llvm-svn: 44820
2007-12-10 23:10:20 +00:00
Anton Korobeynikov
b003fb0ed7
Clarify the need of CFI() stuff
...
llvm-svn: 44819
2007-12-10 23:08:35 +00:00
Anton Korobeynikov
fd74645812
Provide convenient way to disable CFI stuff for old/broken assemblers.
...
Use it for Darwin.
llvm-svn: 44818
2007-12-10 23:04:38 +00:00
Chris Lattner
5ca42cd342
Fix PR1850 by removing an unsafe transformation from VMCore/ConstantFold.cpp.
...
Reimplement the xform in Analysis/ConstantFolding.cpp where we can use
targetdata to validate that it is safe. While I'm in there, fix some const
correctness issues and generalize the interface to the "operand folder".
llvm-svn: 44817
2007-12-10 22:53:04 +00:00
Chris Lattner
b511799808
Disable cfi directives for now, darwin does't support them.
...
These should probably be something like:
CFI(".cfi_def_cfa_offset 16\n")
where CFI is defined to a noop on darwin and other platforms
that don't support those directives.
llvm-svn: 44803
2007-12-10 19:10:18 +00:00
Duncan Sands
b7ac459292
Make PruneEH update the nounwind/noreturn attributes
...
on functions as it calculates them.
llvm-svn: 44802
2007-12-10 19:09:40 +00:00
Duncan Sands
1279851352
Fix PR1836: in the interpreter, read and write apints
...
using the minimum possible number of bytes. For little
endian targets run on little endian machines, apints are
stored in memory from LSB to MSB as before. For big endian
targets on big endian machines they are stored from MSB to
LSB which wasn't always the case before (if the target and
host endianness doesn't match values are stored according
to the host's endianness). Doing this requires knowing the
endianness of the host, which is determined when configuring -
thanks go to Anton for this. Only having access to little
endian machines I was unable to properly test the big endian
part, which is also the most complicated...
llvm-svn: 44796
2007-12-10 17:43:13 +00:00
Anton Korobeynikov
cd497afc30
And finally annotate X86-64 version of callback.
...
All bad stuff from SSE version is implicitely inherited :)
llvm-svn: 44794
2007-12-10 15:27:07 +00:00
Anton Korobeynikov
49e2962ad3
Provide annotation for SSE version of callback. It's even more
...
broken, because doesn't mark xmm regs properly
llvm-svn: 44793
2007-12-10 15:13:55 +00:00
Anton Korobeynikov
0e4780cfe2
Annotate JIT callback function with call frame infromation.
...
This will allow us (theoretically) to unwind through JITer.
The code wasn't verified, so I'm pretty sure offsets are wrong :)
llvm-svn: 44792
2007-12-10 14:54:42 +00:00
Duncan Sands
948343f861
It looks like this has been broken for some time -
...
get it to compile.
llvm-svn: 44791
2007-12-10 14:43:10 +00:00
Owen Anderson
4bd6d18e18
A little more progress on StrongPHIElimination, now that I have a better sense of
...
how the CodeGen machinery works.
llvm-svn: 44786
2007-12-10 08:07:09 +00:00
Christopher Lamb
5c577eb543
Improve branch folding by recgonizing that explict successor relationships impact the value of fall-through choices.
...
llvm-svn: 44785
2007-12-10 07:24:06 +00:00
Gordon Henriksen
aadbdd1a62
Delete the CollectorNamePool if it should become empty.
...
llvm-svn: 44775
2007-12-10 03:35:18 +00:00
Gordon Henriksen
5d201e0bcc
Adding a collector name attribute to Function in the IR. These
...
methods are new to Function:
bool hasCollector() const;
const std::string &getCollector() const;
void setCollector(const std::string &);
void clearCollector();
The assembly representation is as such:
define void @f() gc "shadow-stack" { ...
The implementation uses an on-the-side table to map Functions to
collector names, such that there is no overhead. A StringPool is
further used to unique collector names, which are extremely
likely to be unique per process.
llvm-svn: 44769
2007-12-10 03:18:06 +00:00
Gordon Henriksen
8430f1ff9a
Reverting dtor devirtualization patch.
...
_sabre_: it has a major problem: by the time ~Value is run, all of the "parts" of the derived classes have been destroyed
_sabre_: the vtable lives to fight another day
llvm-svn: 44760
2007-12-10 02:14:30 +00:00
Chris Lattner
11bc69b3c8
fix some warnings.
...
llvm-svn: 44756
2007-12-10 01:51:22 +00:00
Chris Lattner
3d939a50a5
Fix a big problem in the recent dtor refactoring work, now it passes 2007-11-19-InlineAsm.ll
...
llvm-svn: 44755
2007-12-10 01:48:29 +00:00
Gordon Henriksen
a18a78e6e5
Devirtualizing Value destructor (PR889). Patch by Pawel Kunio!
...
llvm-svn: 44747
2007-12-09 22:46:10 +00:00
Chris Lattner
ac2bfb78d9
Duncan points out that the subtraction is unneeded since hte code
...
knows the vector is not pow2
llvm-svn: 44740
2007-12-09 17:56:34 +00:00
Chris Lattner
95f9743c43
Fix PR1782, patch by Wojtek Matyjewicz!
...
llvm-svn: 44733
2007-12-09 07:35:13 +00:00
Chris Lattner
84241dd771
Add support for splitting the operand of a return instruction.
...
llvm-svn: 44728
2007-12-09 00:06:19 +00:00
Bill Wendling
8d8d9a2f5e
Reverting 44702. It wasn't correct to rename them.
...
llvm-svn: 44727
2007-12-08 23:58:46 +00:00
Chris Lattner
164d423f91
add many new cases to SplitResult. SplitResult now handles all the cases that LegalizeDAG does.
...
llvm-svn: 44726
2007-12-08 23:58:27 +00:00
Chris Lattner
6db5e91e16
Implement splitting support for store, allowing us to compile:
...
%f8 = type <8 x float>
define void @test_f8(%f8* %P, %f8* %Q, %f8* %S) {
%p = load %f8* %P ; <%f8> [#uses=1]
%q = load %f8* %Q ; <%f8> [#uses=1]
%R = add %f8 %p, %q ; <%f8> [#uses=1]
store %f8 %R, %f8* %S
ret void
}
into:
_test_f8:
movaps 16(%rdi), %xmm0
addps 16(%rsi), %xmm0
movaps (%rdi), %xmm1
addps (%rsi), %xmm1
movaps %xmm0, 16(%rdx)
movaps %xmm1, (%rdx)
ret
llvm-svn: 44725
2007-12-08 23:24:26 +00:00
Chris Lattner
b073361c3e
implement vector splitting of load, undef, and binops.
...
llvm-svn: 44724
2007-12-08 23:08:49 +00:00
Chris Lattner
8942654140
implement some methods.
...
llvm-svn: 44723
2007-12-08 22:40:18 +00:00
Chris Lattner
cd7fc69c7c
add scaffolding for splitting of vectors.
...
llvm-svn: 44722
2007-12-08 22:37:41 +00:00