Commit Graph

7295 Commits

Author SHA1 Message Date
Torok Edwin
c25e7581b9 assert(0) -> LLVM_UNREACHABLE.
Make llvm_unreachable take an optional string, thus moving the cerr<< out of
line.
LLVM_UNREACHABLE is now a simple wrapper that makes the message go away for
NDEBUG builds.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75379 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-11 20:10:48 +00:00
Torok Edwin
7d696d8040 Convert more assert(0)+abort() -> LLVM_UNREACHABLE,
and abort()/exit() -> llvm_report_error().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75363 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-11 13:10:19 +00:00
Evan Cheng
8955e93b1f Fix up support for OptionalDefOperand when it defaults to an actual register def. I need this to get ready for major Thumb1 surgery.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75328 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-11 01:06:50 +00:00
Eli Friedman
aad3460086 Use CreateStackStoreLoad helper in more places.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75320 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-11 00:11:07 +00:00
Evan Cheng
ebfc177b59 Two-address pass should use findCommutedOpIndices to determine what registers are commuted.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75317 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-11 00:04:23 +00:00
Evan Cheng
34c75093f0 Use findCommutedOpIndices to find the operands to commute.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75312 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-10 23:26:12 +00:00
David Greene
62fe47a337 Make changes suggested by Chris and eliminate newly-added raw_ostream
hooks as they're no longer needed.

The major change with this patch is to make formatted_raw_ostream usable
by any client of raw_ostream.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75283 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-10 21:14:44 +00:00
Duncan Sands
413a15ef0e Avoid compiler warnings if assertions turned off.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75267 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-10 20:07:07 +00:00
Evan Cheng
261ce1d5f8 Remove TargetInstrInfo::CommuteChangesDestination and added findCommutedOpIndices which returns the operand indices which are swapped (when applicable). This allows for some code clean up and future enhancements.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75264 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-10 19:15:51 +00:00
David Greene
caf642a976 Eliminate an unnecessary include.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75256 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-10 17:55:38 +00:00
David Greene
e7800be8f0 Redesign this to avoid standard stream classes. This stream class
provides pretty -printing of comments and other such things in asm
files.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75202 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-09 23:56:35 +00:00
Owen Anderson
333c400965 This started as a small change, I swear. Unfortunately, lots of things call the [I|F]CmpInst constructors. Who knew!?
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75200 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-09 23:48:35 +00:00
Bob Wilson
2202360734 Fix an apparent copy-and-paste problem in an error message.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75197 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-09 23:42:59 +00:00
Eli Friedman
c680ac9003 Make EXTRACT_VECTOR_ELT a bit more flexible in terms of the returned
value.  Adjust other code to deal with that correctly.  Make 
DAGTypeLegalizer::PromoteIntRes_EXTRACT_VECTOR_ELT take advantage of 
this new flexibility to simplify the code and make it deal with unusual 
vectors (like <4 x i1>) correctly.  Fixes PR3037.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75176 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-09 22:01:03 +00:00
Owen Anderson
5dcaceb0a6 As Chris pointed out, we don't actually need to pass the context around here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75161 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-09 18:44:09 +00:00
Chris Lattner
2a52c69140 back out r75156 for now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75160 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-09 18:41:57 +00:00
David Greene
a637691871 Add some classes to produce pretty-printed asm. We'll use these
shortly to provide nicely printed comments and other goodies in
asm files.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75156 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-09 18:27:23 +00:00
Owen Anderson
d1474d09cb Thread LLVMContext through MVT and related parts of SDISel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75153 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-09 17:57:24 +00:00
Evan Cheng
910139f9ca Targets sometimes assign fixed stack object to spill certain callee-saved
registers based on dynamic conditions. For example, X86 EBP/RBP, when used as
frame register has to be spilled in the first fixed object. It should inform
PEI this so it doesn't get allocated another stack object. Also, it should not
be spilled as other callee-saved registers but rather its spilling and restoring
are being handled by emitPrologue and emitEpilogue. Avoid spilling it twice.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75116 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-09 06:53:48 +00:00
Lang Hames
ffd1326ff8 Improved tracking of value number kills. VN kills are now represented
as an (index,bool) pair. The bool flag records whether the kill is a
PHI kill or not. This code will be used to enable splitting of live
intervals containing PHI-kills.

A slight change to live interval weights introduced an extra spill
into lsr-code-insertion (outside the critical sections). The test 
condition has been updated to reflect this.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75097 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-09 03:57:02 +00:00
Dan Gohman
2e4284de53 Make SelectionDAG::getVectorShuffle work properly for VECTOR_SHUFFLE
nodes with operand types that differ from the result type. (This
doesn't normally happen right now, because
SelectionDAGLowering::visitShuffleVector normalizes vector shuffles.)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75081 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-09 00:46:33 +00:00
David Goodwin
f1daf7d8ab Use common code for both ARM and Thumb-2 instruction and register info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75067 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-08 23:10:31 +00:00
Duncan Sands
f2d754bb38 Nowadays vectors are only split if they have an even
number of elements.  Make some simplifications based
on this (in particular SplitVecRes_SETCC).  Tighten
up some checking while there.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75050 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-08 21:34:03 +00:00
Bill Wendling
058a024eb7 Use interators instead of counters for loops.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75046 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-08 20:57:27 +00:00
Owen Anderson
d1fbd14294 Push LLVMContext _back_ through IRBuilder.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75040 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-08 20:50:47 +00:00
Owen Anderson
e9b11b4313 Switch GlobalVariable ctors to a sane API, where *either* a context or a module is required.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75025 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-08 19:03:57 +00:00
Duncan Sands
8c899ee031 Remove trailing whitespace. Reorder some methods
and cases alphabetically.  No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75001 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-08 11:36:39 +00:00
Nick Lewycky
7f6aa2b162 Remove the vicmp and vfcmp instructions. Because we never had a release with
these instructions, no autoupgrade or backwards compatibility support is
provided.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74991 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-08 03:04:38 +00:00
Owen Anderson
3d29df3e8a Push LLVMContext through GlobalVariables and IRBuilder.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74985 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-08 01:26:06 +00:00
Chris Lattner
2b7a271c71 dag combine sext(setcc) -> vsetcc before legalize. To make this safe,
VSETCC must define all bits, which is different than it was documented
to before.  Since all targets that implement VSETCC already have this
behavior, and we don't optimize based on this, just change the 
documentation.  We now get nice code for vec_compare.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74978 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-08 00:31:33 +00:00
Chris Lattner
a4f7318245 SelectionDAG::SignBitIsZero doesn't work right for vectors,
for now, conservatively return false.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74969 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-07 23:28:46 +00:00
Dale Johannesen
8ea5ec681b Operand of asm("call") (the callee function) is represented
as "X" constraint and "P" modifier on x86.  Make this work.
(Change may not be sufficient to fix it for non-Darwin, but
I'm pretty sure it won't break anything.)
gcc.apple/asm-block-32.c
gcc.apple/asm-block-33.c



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74967 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-07 23:26:33 +00:00
Chris Lattner
c2c27b3627 add support for legalizing an icmp where the result is illegal (4xi1) but
the input is legal (4 x i32)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74964 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-07 23:03:54 +00:00
Chris Lattner
0a6c2d8dea random code cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74962 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-07 22:49:15 +00:00
Chris Lattner
5962ed0a36 implement support for spliting and scalarizing vector setcc's. This
finishes off enough support for vector compares to get the icmp/fcmp
version of 2008-07-23-VSetCC.ll passing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74961 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-07 22:47:46 +00:00
Chris Lattner
9800e849c1 lower vector icmp/fcmp to ICMP/FCMP nodes with the right result
(vector of bool).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74960 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-07 22:41:32 +00:00
Chris Lattner
87c411b5cc ScalarizeVecRes_ShiftOp and ScalarizeVecRes_BinOp are the same,
eliminate the former.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74959 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-07 22:28:41 +00:00
Chris Lattner
64a3fa23f8 add support for vector legalizing of *_EXTEND.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74957 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-07 22:27:17 +00:00
Devang Patel
261cc194d7 Accidently dropped this while removing dead code in previous commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74953 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-07 21:55:14 +00:00
Devang Patel
0a4afb6caf Remove dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74949 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-07 21:12:32 +00:00
Owen Anderson
a9d1f2c559 Have scoped mutexes take referenes instead of pointers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74931 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-07 18:33:04 +00:00
Evan Cheng
ddb03d831b Revert 74898. It broke several tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74925 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-07 17:50:43 +00:00
Sanjiv Gupta
1dd35b4c35 if the terminator is a branch depending upon the side effects of a
previous cmp; a copy can not be inserted here if the copy insn also has
 side effects. We don't have access to the attributes of copy insn here;
 so just play safe by finding a safe locations for branch terminators.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74898 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-07 08:04:51 +00:00
Evan Cheng
2c4d96dfe9 Avoid adding a duplicate def. This fixes PR4478.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74857 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-06 21:34:05 +00:00
Duncan Sands
08b7daf3ff Fix the cmake build - patch by Xerxes Rånby.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74825 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-06 14:28:32 +00:00
Bruno Cardoso Lopes
6933d3eff8 Changed ELFCodeEmitter to inherit from ObjectCodeEmitter
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74821 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-06 09:26:48 +00:00
Bruno Cardoso Lopes
752e928e6b Cleanup MachO writer and code emitter. Fix 80 cols problems, remove extra spaces, shrink down includes and move some methods out-of-line
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74817 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-06 06:40:51 +00:00
Bruno Cardoso Lopes
8ae058a815 Just forgot to include the two new files
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74814 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-06 05:16:40 +00:00
Bruno Cardoso Lopes
ac57e6e498 Add the Object Code Emitter class. Original patch by Aaron Gray, I did some
cleanup, removed some #includes and moved Object Code Emitter out-of-line.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74813 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-06 05:09:34 +00:00
Owen Anderson
0a205a4598 More LLVMContext-ification.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74807 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-05 22:41:43 +00:00