Rafael Espindola
eb5d0cb4f4
GCC uses a different encoding of pointers in the FDE when using
...
-fno-dwarf2-cfi-asm. Implement the same behavior.
llvm-svn: 130637
2011-05-01 04:49:54 +00:00
Rafael Espindola
21023ae86c
I forgot these files in the previous commit.
...
llvm-svn: 130635
2011-05-01 04:19:24 +00:00
Rafael Espindola
2f2c3bf31f
Simplify the handling of pcrel relocations on ELF. Now we do the right thing
...
for all symbol differences and can drop the old EmitPCRelSymbolValue
method.
This also make getExprForFDESymbol on ELF equal to the one on MachO, and it
can be made non-virtual.
llvm-svn: 130634
2011-05-01 03:50:49 +00:00
Oscar Fuentes
37e20483df
Update instructions: LLVM.cmake is now LLVMConfig.cmake
...
llvm-svn: 130631
2011-05-01 02:12:20 +00:00
Rafael Espindola
886aa563be
Revert the previous patch while I figure out how to make llvm-gcc
...
less agressive about disabling cfi on linux :-(
llvm-svn: 130626
2011-04-30 23:03:44 +00:00
Jakob Stoklund Olesen
534c3dfcc1
X86AsmPrinter doesn't know how to handle the X86II::MO_GOT_ABSOLUTE_ADDRESS flag
...
after folding ADD32ri to ADD32mi, so don't do that.
This only happens when the greedy register allocator gets itself in trouble and
spills %vreg9 here:
16L %vreg9<def> = MOVPC32r 0, %ESP<imp-use>; GR32:%vreg9
48L %vreg9<def> = ADD32ri %vreg9, <es:_GLOBAL_OFFSET_TABLE_>[TF=1], %EFLAGS<imp-def,dead>; GR32:%vreg9
That should never happen, the live range should be split instead.
llvm-svn: 130625
2011-04-30 23:00:05 +00:00
Rafael Espindola
9455887b10
Enable CFI on OS X.
...
Currently the output should be almost identical to the one produced by CodeGen
to make the transition easier.
The only two differences I know of are:
* Some files get an extra advance loc of size 0. This will be fixed when
relaxations are enabled.
* The optimization of declaring an EH symbol as an external variable is not
implemented. This is a subset of adding the nounwind attribute, so we if really
this at -O0 we should probably do it at the IL level.
llvm-svn: 130623
2011-04-30 22:29:54 +00:00
Jakob Stoklund Olesen
ffe1dbc840
When a physreg is live-in and live through a basic block, make sure its live
...
range covers the entire block.
The live range can't be terminated at a random instruction.
llvm-svn: 130619
2011-04-30 19:12:33 +00:00
Benjamin Kramer
e4853baa4b
InstCombine: Turn (zext A) udiv (zext B) into (zext (A udiv B)). Same for urem or constant B.
...
This obviously helps a lot if the division would be turned into a libcall
(think i64 udiv on i386), but div is also one of the few remaining instructions
on modern CPUs that become more expensive when the bitwidth gets bigger.
This also helps register pressure on i386 when dividing chars, divb needs
two 8-bit parts of a 16 bit register as input where divl uses two registers.
int foo(unsigned char a) { return a/10; }
int bar(unsigned char a, unsigned char b) { return a/b; }
compiles into (x86_64)
_foo:
imull $205, %edi, %eax
shrl $11, %eax
ret
_bar:
movzbl %dil, %eax
divb %sil, %al
movzbl %al, %eax
ret
llvm-svn: 130615
2011-04-30 18:16:07 +00:00
Benjamin Kramer
5459f78745
Use SimplifyDemandedBits on div instructions.
...
This folds away silly stuff like (a&255)/1000 -> 0.
llvm-svn: 130614
2011-04-30 18:16:00 +00:00
Benjamin Kramer
eeda6d1bb5
FileCheckize.
...
llvm-svn: 130613
2011-04-30 18:15:53 +00:00
Rafael Espindola
dfbd3e7412
Implement MCAsmStreamer::EmitEHSymAttributes. Doing this in the asm streamer
...
is a bit ugly, but doing it on the base MCStreamer would be redundant
with the object streamer which does it using SD.
llvm-svn: 130611
2011-04-30 16:34:57 +00:00
Rafael Espindola
969f9f552c
Handle PrivateExtern eh symbols.
...
llvm-svn: 130609
2011-04-30 16:22:46 +00:00
Jakob Stoklund Olesen
c140b5ac84
Allow folded spills in test.
...
llvm-svn: 130599
2011-04-30 08:00:50 +00:00
Jakob Stoklund Olesen
4ec9e1c33a
Avoid using stale entries form the sibling value map.
...
This could happen when trying to use a value that had been eliminated after dead
code elimination and folding loads.
llvm-svn: 130597
2011-04-30 06:42:21 +00:00
Jakob Stoklund Olesen
8c578bf1cf
Use hysteresis for local live range splitting as well.
...
llvm-svn: 130596
2011-04-30 05:07:46 +00:00
NAKAMURA Takumi
f485b6e3a8
runtime/libprofile/PathProfiling.c: Don't use // comment in C source.
...
llvm-svn: 130589
2011-04-30 03:53:56 +00:00
Rafael Espindola
7901d3790e
Add all the plumbing needed for MC to expand cfi to the old tables in
...
the final assembly. It is the same technique used when targeting
assemblers that don't support .loc.
llvm-svn: 130587
2011-04-30 03:44:37 +00:00
Rafael Espindola
17e6a392af
Implement MCAsmStreamer::EmitDwarfAdvanceFrameAddr.
...
llvm-svn: 130585
2011-04-30 03:21:04 +00:00
Jakob Stoklund Olesen
720ec44d13
Update comment.
...
llvm-svn: 130582
2011-04-30 03:13:08 +00:00
Jakob Stoklund Olesen
a397ddfd59
Use a greedy algorithm for allocating registers.
...
llvm-svn: 130568
2011-04-30 01:37:54 +00:00
Jakob Stoklund Olesen
2db84c62f6
Weekly fix of register allocation dependent unit tests.
...
llvm-svn: 130567
2011-04-30 01:37:52 +00:00
Bill Wendling
0a7857b4fa
Print out the 'nontemporal' info on a store.
...
llvm-svn: 130562
2011-04-29 23:45:22 +00:00
Eli Friedman
919bf1ca71
Make FastEmit_ri_ try a bit harder to succeed for supported operations; FastEmit_i can fail for non-Thumb2 ARM. Makes ARMSimplifyAddress work correctly, and reduces the number of fast-isel bailouts on non-Thumb ARM.
...
llvm-svn: 130560
2011-04-29 23:34:52 +00:00
Eric Christopher
ad02f6c78a
80-col.
...
llvm-svn: 130558
2011-04-29 23:12:01 +00:00
Eli Friedman
996092fea3
Zap a couple now-unused functions.
...
llvm-svn: 130557
2011-04-29 22:56:48 +00:00
Eli Friedman
1940912660
Switch to ImmLeaf (which can be used by FastISel) for a few more common ARM/Thumb2 patterns.
...
llvm-svn: 130552
2011-04-29 22:48:03 +00:00
Devang Patel
60fb94e8bf
Assing line number info to new PHIs created by SSA updater.
...
llvm-svn: 130551
2011-04-29 22:28:59 +00:00
Eric Christopher
5415816eb4
Add FastEmitInst_ii for the arm fast isel generator. It doesn't use it, but
...
if it ever did it needs the def machinery.
llvm-svn: 130549
2011-04-29 22:07:50 +00:00
Eli Friedman
0667319d62
Filter out pattterns from the FastISel emitter which it doesn't actually know how to handle. No significant functionality change at the moment, but it's necessary for some changes I'm planning.
...
llvm-svn: 130547
2011-04-29 21:58:31 +00:00
Eric Christopher
a6fb14395f
Some cleanup and optimize fallthrough more.
...
llvm-svn: 130546
2011-04-29 21:56:31 +00:00
Rafael Espindola
13b74fd203
Avoid some uses of .uleb128. This is a small speedup and more importantly
...
lets this code be used when producing assembly code for old assemblers without
uleb support.
llvm-svn: 130544
2011-04-29 21:50:57 +00:00
Rafael Espindola
c4e90a84c4
Implement MCAsmStreamer::EmitCFIDefCfa.
...
llvm-svn: 130543
2011-04-29 21:41:06 +00:00
Devang Patel
2257af290f
Print new instructions without DebugLoc.
...
llvm-svn: 130542
2011-04-29 21:36:04 +00:00
Eli Friedman
8f66e9361d
Fix run-line, again. :(
...
llvm-svn: 130540
2011-04-29 21:33:03 +00:00
Eli Friedman
7d05eaa3f4
Re-committing r130454, which does not in fact break anything.
...
Fix a rather obscure crash caused by ARM fast-isel generating code which redefines a register.
rdar://problem/9338332 .
llvm-svn: 130539
2011-04-29 21:22:56 +00:00
Devang Patel
1c0642d509
Preserve line number information.
...
llvm-svn: 130536
2011-04-29 20:38:55 +00:00
Eric Christopher
ba0cef1b0b
Add trunc->branch support, this won't help with clang's i8->i1 truncations
...
for bools, but is a start.
llvm-svn: 130534
2011-04-29 20:02:39 +00:00
Daniel Dunbar
64d3760882
win32: Include DataTypes.h instead of stdint.h to try and fix a Win32 build
...
issue.
llvm-svn: 130530
2011-04-29 18:58:57 +00:00
Daniel Dunbar
33083542c4
Cleanup some DOS newlines.
...
llvm-svn: 130529
2011-04-29 18:58:55 +00:00
Peter Collingbourne
d78bf257ad
SimplifyCFG: Expose phi node folding cost threshold as command line parameter
...
llvm-svn: 130528
2011-04-29 18:47:38 +00:00
Peter Collingbourne
0994e869f9
SimplifyCFG: Add CostRemaining parameter to DominatesMergePoint
...
llvm-svn: 130527
2011-04-29 18:47:31 +00:00
Peter Collingbourne
06646aa091
SimplifyCFG: Add Trunc, ZExt and SExt to the list of cheap instructions for phi node folding
...
llvm-svn: 130526
2011-04-29 18:47:25 +00:00
Daniel Dunbar
9a87852114
MCAsmLayout: Add support for computing the symbol offset of variables. Not
...
currently used, because variables don't get reported as being "defined".
llvm-svn: 130524
2011-04-29 18:20:20 +00:00
Daniel Dunbar
1488659798
MC: Change variable symbols to be recognized as defined, by assigning their sections based on FindAssociatedSection().
...
llvm-svn: 130523
2011-04-29 18:20:17 +00:00
Daniel Dunbar
32545135b1
MC/Mach-O: Update getSymbolAddress() to support evaluation of variables.
...
llvm-svn: 130522
2011-04-29 18:13:42 +00:00
Daniel Dunbar
f419ec6362
MC/Mach-O: Allow emission of relocations for variables in some more cases.
...
llvm-svn: 130520
2011-04-29 18:10:47 +00:00
Daniel Dunbar
6178302330
MC/Mach-O: Find section ordinal's by looking at the symbol, instead of assuming they are present in a fragment.
...
llvm-svn: 130519
2011-04-29 18:07:43 +00:00
Devang Patel
acce3eb6b2
Hoist MCLineEntry construction AsmPrinter so that anyone who derives from AsmPrinter can have line number entries.
...
PR 9810
llvm-svn: 130518
2011-04-29 18:00:54 +00:00
Daniel Dunbar
c52dfd4349
MCExpr: Add FindAssociatedSection, which attempts to mirror the 'as' semantics
...
that associate sections with expressions.
llvm-svn: 130517
2011-04-29 18:00:03 +00:00