Evan Cheng
a35aed567a
Revert part of 70929 that has to do with determining whether a SIB byte is needed. It causes a lot of x86_64 JIT failures.
...
llvm-svn: 70986
2009-05-05 18:18:57 +00:00
David Greene
44f9d7a8f0
Allow multiclass def names to contain "#NAME"" where TableGen replaces
...
#NAME# with the name of the defm instantiating the multiclass. This is
useful for AVX instruction naming where a "V" prefix is standard
throughout the ISA. For example:
multiclass SSE_AVX_Inst<...> {
def SS : Instr<...>;
def SD : Instr<...>;
def PS : Instr<...>;
def PD : Instr<...>;
def V#NAME#SS : Instr<...>;
def V#NAME#SD : Instr<...>;
def V#NAME#PS : Instr<...>;
def V#NAME#PD : Instr<...>;
}
defm ADD : SSE_AVX_Inst<...>;
Results in
ADDSS
ADDSD
ADDPS
ADDPD
VADDSS
VADDSD
VADDPS
VADDPD
llvm-svn: 70979
2009-05-05 16:28:25 +00:00
Mikhail Glushenkov
d953cd9401
Fix incorrect code generation with ENV.
...
See PR4157 for details. Patch by Martin Nowack!
llvm-svn: 70973
2009-05-05 12:34:34 +00:00
Chris Lattner
929b644b0f
Do not require variable debug info nodes to have a compile unit.
...
For implicit decls like "self" and "_cmd" in ObjC, these decls
should not have a location.
llvm-svn: 70964
2009-05-05 04:55:56 +00:00
Evan Cheng
6fc03634db
Do not substitute if the new register isn't in the register class of the operand being updated.
...
llvm-svn: 70953
2009-05-05 00:46:16 +00:00
Evan Cheng
1ff2727c95
Move getInstrOperandRegClass from the scheduler to TargetInstrInfo.
...
llvm-svn: 70950
2009-05-05 00:30:09 +00:00
Evan Cheng
dbfb102523
Do forward and backward substitution to eliminate loads and stores when possible.
...
llvm-svn: 70937
2009-05-04 23:13:13 +00:00
Evan Cheng
09bd0b1bd2
Default llc / lli optimization to "Default", which corresponds to -O1 / -O2.
...
llvm-svn: 70934
2009-05-04 23:05:19 +00:00
Evan Cheng
c298ccb998
- Avoid the longer SIB encoding on x86_64 when it's not needed.
...
- Synchronize instruction length computation code in X86InstrInfo with code in X86CodeEmitter.cpp
Patch by Zoltan Varga.
llvm-svn: 70929
2009-05-04 22:49:16 +00:00
Dan Gohman
48f8222293
Re-apply 70645, converting ScalarEvolution to use
...
CallbackVH, with fixes. allUsesReplacedWith need to
walk the def-use chains and invalidate all users of a
value that is replaced. SCEVs of users need to be
recalcualted even if the new value is equivalent. Also,
make forgetLoopPHIs walk def-use chains, since any
SCEV that depends on a PHI should be recalculated when
more information about that PHI becomes available.
llvm-svn: 70927
2009-05-04 22:30:44 +00:00
Dan Gohman
fc2a8d1eb0
Fix an 80-column violation.
...
llvm-svn: 70925
2009-05-04 22:23:18 +00:00
Dan Gohman
4b56fab92b
Fix doxygen comment syntax.
...
llvm-svn: 70924
2009-05-04 22:20:30 +00:00
Chris Lattner
354b12259f
Make DBG_STOPPOINT nodes, and therefore DBG_LABEL labels, get a DebugLoc, so that it
...
shows up in -print-machineinstrs. This doesn't appear to affect anything, but it was
weird for some DBG_LABELs to have DebugLocs but not all of them.
llvm-svn: 70921
2009-05-04 22:10:05 +00:00
Dan Gohman
a30370bc33
Constify a bunch of SCEV-using code.
...
llvm-svn: 70919
2009-05-04 22:02:23 +00:00
Dan Gohman
bb525f7e02
X86FastISel doesn't support the -tailcallopt ABI.
...
llvm-svn: 70902
2009-05-04 19:50:33 +00:00
Argyrios Kyrtzidis
71fb950b73
Restore a comment.
...
llvm-svn: 70900
2009-05-04 19:23:45 +00:00
Anton Korobeynikov
2d1e7321f6
Fix code emission for conditional branches.
...
Patch by Collin Winter!
llvm-svn: 70898
2009-05-04 19:10:38 +00:00
Bill Wendling
357e03cede
Use %llvmgcc instead of llvm-gcc.
...
llvm-svn: 70886
2009-05-04 18:00:27 +00:00
Dan Gohman
3f02595048
Use true instead of 1 for a boolean value. And fix a copy+pasto
...
in a comment.
llvm-svn: 70882
2009-05-04 17:25:21 +00:00
Dan Gohman
630f4e1eb3
Trim unnecessary #includes.
...
llvm-svn: 70880
2009-05-04 17:11:06 +00:00
Dan Gohman
cfd6941cf9
Quotes are used for including llvm headers, rather than angles.
...
llvm-svn: 70879
2009-05-04 17:09:51 +00:00
Duncan Sands
50c70336b0
Teach capture tracking that readonly functions can
...
only capture their arguments by returning them or
throwing an exception or not based on the argument
value. Patch essentially by Frits van Bommel.
llvm-svn: 70876
2009-05-04 16:50:29 +00:00
Duncan Sands
b88227ef4c
Check that pure/const functions are marked nounwind.
...
llvm-svn: 70875
2009-05-04 16:47:11 +00:00
Chris Lattner
fa552d728d
fix some problems spotted by Duncan and Nicolas Geoffray
...
llvm-svn: 70872
2009-05-04 16:29:24 +00:00
Argyrios Kyrtzidis
9ae29b2d8f
-Remove the DwarfWriter::RecordSourceLine calls from the instruction selectors.
...
-Depend on DebugLocs for source line info.
(Comes with Regression-Be-Gone(tm))
llvm-svn: 70871
2009-05-04 16:23:49 +00:00
Duncan Sands
d84881ec53
Testcase for PR3967.
...
llvm-svn: 70856
2009-05-04 12:54:02 +00:00
Anton Korobeynikov
0a0cc2d7b7
Workaround libstdc++ bug when crosscompiling to mingw.
...
Patch by Jay Foad!
llvm-svn: 70849
2009-05-04 10:25:30 +00:00
Anton Korobeynikov
dad5871f84
It turns out that this version of gcc is broken (cygwin is well-known in shipping
...
of broken/buggy/snapshot-based compilers)
llvm-svn: 70848
2009-05-04 10:24:46 +00:00
Evan Cheng
3f77805642
Make sure to color with only allocatable registers for the specific register class.
...
llvm-svn: 70821
2009-05-04 03:30:11 +00:00
Chris Lattner
d579cb1167
* Sink 4 duplicates of edge threading validity checks and DOUT prints into
...
ThreadEdge directly. This shares the code, but is just a refactoring.
* Make JumpThreading compute the set of loop headers and avoid threading
across them. This prevents jump threading from forming irreducible
loops (goodness) but also prevents it from threading in other cases that
are beneficial (see the comment above FindFunctionBackedges).
llvm-svn: 70820
2009-05-04 02:28:08 +00:00
Chris Lattner
351134ba93
Factor loop backedge finding out of CodeGenPrepare into a new
...
FindFunctionBackedges function.
llvm-svn: 70819
2009-05-04 02:25:58 +00:00
Chris Lattner
0fc8a35fb8
add a range insertion method to SmallSet.
...
llvm-svn: 70817
2009-05-04 02:19:15 +00:00
Evan Cheng
4b6072bcb8
The stack slots which share the same stack slot after coloring can, but do not have to, use the same register. In fact, they each may have different register class requirements.
...
llvm-svn: 70815
2009-05-04 00:24:50 +00:00
Argyrios Kyrtzidis
79be34012f
Revert r70803 for now, it causes a regression.
...
llvm-svn: 70811
2009-05-03 23:27:19 +00:00
Argyrios Kyrtzidis
ba49fef34a
Remove an, apparently, leftover MachineModuleInfo::RecordSourceLine declaration.
...
llvm-svn: 70804
2009-05-03 22:11:08 +00:00
Argyrios Kyrtzidis
ce7196b903
-Remove the DwarfWriter::RecordSourceLine calls from the instruction selectors.
...
-Depend on DebugLocs for source line info.
llvm-svn: 70803
2009-05-03 22:03:35 +00:00
Evan Cheng
1de5cf548e
Typo.
...
llvm-svn: 70792
2009-05-03 19:10:11 +00:00
Chris Lattner
680ae74885
Remove obsolete wording, the only exception a readnone function can throw
...
is the empty set. :) Thanks to Fritz for pointing this out.
llvm-svn: 70790
2009-05-03 19:06:00 +00:00
Chris Lattner
f031421afe
be very explicit that readnone/readonly functions can't
...
throw exceptions.
llvm-svn: 70788
2009-05-03 18:49:37 +00:00
Evan Cheng
210fc62a91
In some rare cases, the register allocator can spill registers but end up not utilizing registers at all. The fundamental problem is linearscan's backtracking can end up freeing more than one allocated registers. However, reloads and restores might be folded into uses / defs and freed registers might not be used at all.
...
VirtRegMap keeps track of allocations so it knows what's not used. As a horrible hack, the stack coloring can color spill slots with *free* registers. That is, it replace reload and spills with copies from and to the free register. It unfold instructions that load and store the spill slot and replace them with register using variants.
Not yet enabled. This is part 1. More coming.
llvm-svn: 70787
2009-05-03 18:32:42 +00:00
Anton Korobeynikov
4ff60e0cc2
Handle implicit zext in a better way. Shamelessly stolen from x86 backend.
...
Thanks for Dan Gohman for suggestion!
llvm-svn: 70782
2009-05-03 15:50:18 +00:00
Anton Korobeynikov
9173b49435
Regenerate
...
llvm-svn: 70772
2009-05-03 13:42:23 +00:00
Anton Korobeynikov
2745bc92fa
Fix typo
...
llvm-svn: 70770
2009-05-03 13:19:57 +00:00
Anton Korobeynikov
1324f810d7
Update due to mainline API change
...
llvm-svn: 70769
2009-05-03 13:19:42 +00:00
Anton Korobeynikov
d089ef1003
Add TODO list :)
...
llvm-svn: 70768
2009-05-03 13:19:24 +00:00
Anton Korobeynikov
47fcd72e24
Make handling of conditional stuff much more straightforward
...
llvm-svn: 70767
2009-05-03 13:19:09 +00:00
Anton Korobeynikov
dedfa00ba1
Temporary disable imm patterns for cmp. Actually, all cmp-related stuff (select_cc, setcc, br_cc). needs to be rethought
...
llvm-svn: 70766
2009-05-03 13:18:50 +00:00
Anton Korobeynikov
eb2152f753
Expand divisions into libcalls
...
llvm-svn: 70765
2009-05-03 13:18:33 +00:00
Anton Korobeynikov
05b7a7c8f8
Properly handle sdiv / udiv / srem / urem libcalls
...
llvm-svn: 70764
2009-05-03 13:18:16 +00:00
Anton Korobeynikov
29747e9c26
Custom lower SIGN_EXTEND
...
llvm-svn: 70763
2009-05-03 13:17:49 +00:00