1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
Commit Graph

71865 Commits

Author SHA1 Message Date
Duncan Sands
750a066af1 Move some rem transforms out of instcombine and into instsimplify.
This automagically provides a transform noticed by my super-optimizer
as occurring quite often: "rem x, (select cond, x, 1)" -> 0.

llvm-svn: 130694
2011-05-02 16:27:02 +00:00
Rafael Espindola
339ecf7100 Add 130690 back.
llvm-svn: 130693
2011-05-02 15:58:16 +00:00
Rafael Espindola
8ef7012675 Only produce the eh_frame section if we have at least one personality function.
llvm-svn: 130692
2011-05-02 15:49:52 +00:00
Rafael Espindola
b5ce7c77ac Revert while I debug the tests that use march but not mtriple.
llvm-svn: 130691
2011-05-02 15:42:31 +00:00
Rafael Espindola
80af9a69e8 Move ppc OS X to cfi too. I am building it on an old ppc mini, but it will take some time.
llvm-svn: 130690
2011-05-02 15:00:52 +00:00
Chandler Carruth
c83eb00361 Remove an unused variable in NDEBUG (found with -Wunused-variable).
llvm-svn: 130688
2011-05-02 05:49:01 +00:00
Jakob Stoklund Olesen
281067b1b8 Minimize the slot indexes spanned by register ranges created when splitting.
When an interfering live range ends at a dead slot index between two
instructions, make sure that the inserted copy instruction gets a slot index
after the dead ones. This makes it possible to avoid the interference.

Ideally, there shouldn't be interference ending at a deleted instruction, but
physical register coalescing can sometimes do that to sub-registers.

This fixes PR9823.

llvm-svn: 130687
2011-05-02 05:29:58 +00:00
Jakob Stoklund Olesen
e0ec7ed462 Add a SlotIndexes::insertMachineInstrInMaps to insert the instruction after any null indexes.
This makes a difference if a live interval is referring to a deleted
instruction. It can be important to insert an instruction before or after a
deleted instruction to avoid interference.

llvm-svn: 130686
2011-05-02 05:29:56 +00:00
Nick Lewycky
9b28874ca6 In option typo correction, consider -foo=VALUE flags as two distinct parts. The
comments claimed it did this, but the LHS value was actually an unused variable.

The new system considers only the '-foo' part when comparing it for typos
against flags that have values, but still look at the whole string for flags
that don't. That way, we'll still correct '-inst=combine' to '-instcombine'.

llvm-svn: 130685
2011-05-02 05:24:47 +00:00
Nick Lewycky
c16a030741 Remove dead variable pointed out by GCC 4.6 warnings, and reflow this a little
to scope a variable more tightly per llvm coding style. No functional change.

llvm-svn: 130684
2011-05-02 05:05:29 +00:00
Chris Lattner
c04013dd48 enhance memcpyopt to obey -fno-builtin and friends. This addresses a
problem reported on cfe-dev.

llvm-svn: 130661
2011-05-01 18:27:11 +00:00
Rafael Espindola
d49e7769a7 Add r130623 back now that ELF has been fixed to work with -fno-dwarf2-cfi-asm.
llvm-svn: 130658
2011-05-01 15:44:13 +00:00
NAKAMURA Takumi
3788ada5db Windows/DynamicLibrary.inc: Clean up ELM_Callback. We may check the decl instead of the versions of individual libraries.
autoconf: Add checking ELM_Callback decl for mingw32 and mingw-w64.
cmake/config-ix.cmake: Add checking ELM_Callback decl for win32.

llvm-svn: 130657
2011-05-01 13:29:49 +00:00
Chandler Carruth
0d71210c33 Remove an unused variable from this function introduced in r130637,
likely a result of copy/paste.

llvm-svn: 130640
2011-05-01 06:14:10 +00:00
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