1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 20:12:56 +02:00
Commit Graph

3947 Commits

Author SHA1 Message Date
Mikhail Glushenkov
e862cc48f3 Fix a warning on gcc 4.4.
SelectionDAGBuilder.cpp:4294: warning: suggest explicit braces to avoid
ambiguous ‘else’

llvm-svn: 92395
2010-01-01 04:41:36 +00:00
Mikhail Glushenkov
0fba686958 Trailing whitespace, 80-col violations.
llvm-svn: 92394
2010-01-01 04:41:22 +00:00
Chris Lattner
44298d184a Teach codegen to lower llvm.powi to an efficient (but not optimal)
multiply sequence when the power is a constant integer.  Before, our
codegen for std::pow(.., int) always turned into a libcall, which was
really inefficient.

This should also make many gfortran programs happier I'd imagine.

llvm-svn: 92388
2010-01-01 03:32:16 +00:00
Chris Lattner
d981b3fc91 remove a bunch of unneeded functions.
llvm-svn: 92263
2009-12-29 09:32:19 +00:00
Chris Lattner
84e9de4a58 Final step in the metadata API restructuring: move the
getMDKindID/getMDKindNames methods to LLVMContext (and add
convenience methods to Module), eliminating MetadataContext.
Move the state that it maintains out to LLVMContext.

llvm-svn: 92259
2009-12-29 09:01:33 +00:00
Chris Lattner
9ec640a902 This is a major cleanup of the instruction metadata interfaces that
I asked Devang to do back on Sep 27.  Instead of going through the
MetadataContext class with methods like getMD() and getMDs(), just
ask the instruction directly for its metadata with getMetadata()
and getAllMetadata().

This includes a variety of other fixes and improvements: previously
all Value*'s were bloated because the HasMetadata bit was thrown into
value, adding a 9th bit to a byte.  Now this is properly sunk down to
the Instruction class (the only place where it makes sense) and it
will be folded away somewhere soon.

This also fixes some confusion in getMDs and its clients about 
whether the returned list is indexed by the MDID or densely packed.
This is now returned sorted and densely packed and the comments make
this clear.

This introduces a number of fixme's which I'll follow up on.

llvm-svn: 92235
2009-12-28 23:41:32 +00:00
Chris Lattner
cd3aa9d1ff rename getMDKind -> getMDKindID, make it autoinsert if an MD Kind
doesn't exist already, eliminate registerMDKind.  Tidy up a bunch
of random stuff.

llvm-svn: 92225
2009-12-28 20:45:51 +00:00
Sanjiv Gupta
d17915f6f0 Allow targets to specify the return type of libcalls that are generated for floating point comparisons, rather than hard-coding them as i32.
llvm-svn: 92199
2009-12-28 02:40:33 +00:00
Bill Wendling
3fbb708d4f Remove dead store.
llvm-svn: 92190
2009-12-28 01:51:30 +00:00
Bill Wendling
08d36672e1 Remove dead variable.
llvm-svn: 92189
2009-12-28 01:48:56 +00:00
Bill Wendling
5badb477fa Remove dead variable.
llvm-svn: 92188
2009-12-28 01:47:48 +00:00
Bill Wendling
008e2e1e7f Remove dead variable.
llvm-svn: 92180
2009-12-28 01:02:21 +00:00
Bill Wendling
091861587d Remove dead variable.
llvm-svn: 92178
2009-12-28 01:00:12 +00:00
Chris Lattner
4e96d36f72 handle equality memcmp of 8 bytes on x86-64 with two unaligned loads and a
compare.  On other targets we end up with a call to memcmp because we don't
want 16 individual byte loads.  We should be able to use movups as well, but
we're failing to select the generated icmp.

llvm-svn: 92107
2009-12-24 01:07:17 +00:00
Chris Lattner
5d3919d5f9 move an optimization for memcmp out of simplifylibcalls and into
SDISel.  This optimization was causing simplifylibcalls to 
introduce type-unsafe nastiness.  This is the first step, I'll be 
expanding the memcmp optimizations shortly, covering things that
we really really wouldn't want simplifylibcalls to do.

llvm-svn: 92098
2009-12-24 00:37:38 +00:00
Nuno Lopes
6abe311a0f move a few more symbols to .rodata
llvm-svn: 92011
2009-12-23 17:48:10 +00:00
Dale Johannesen
b4485fd8a9 Use more sensible type for flags in asms. PR 5570.
Patch by Sylve`re Teissier (sorry, ASCII only).

llvm-svn: 91988
2009-12-23 07:32:51 +00:00
Eric Christopher
ce677a909d Update objectsize intrinsic and associated dependencies. Fix
lowering code and update testcases.

llvm-svn: 91979
2009-12-23 02:51:48 +00:00
Bill Wendling
ce8aa5aab2 Remove superfluous SDNode ordering.
llvm-svn: 91971
2009-12-23 01:28:19 +00:00
Bill Wendling
e7107691df Remove node ordering from inline asm nodes. It's not needed.
llvm-svn: 91961
2009-12-23 00:47:20 +00:00
Bill Wendling
d5577d5bdc Remove node ordering from VA nodes. It's not needed.
llvm-svn: 91958
2009-12-23 00:44:51 +00:00
Bill Wendling
3154bbba16 Revert r91949 r91942 and r91936.
llvm-svn: 91953
2009-12-23 00:28:23 +00:00
Bill Wendling
d38b774149 Finish up node ordering in ExpandNode.
llvm-svn: 91949
2009-12-23 00:05:09 +00:00
Bill Wendling
68e8f657a2 Assign ordering to nodes created in ExpandNode. Only roughly 1/2 of the function
is finished.

llvm-svn: 91942
2009-12-22 23:44:56 +00:00
Bill Wendling
12c3fc9d60 Assign ordering to SDNodes in PromoteNode. Also fixing a subtle bug where BSWAP
was using "Tmp1" in the first getNode call instead of Node->getOperand(0).

llvm-svn: 91936
2009-12-22 22:53:39 +00:00
Bill Wendling
237cb134ed Allow 0 as an order number. Don't assign an order to formal arguments.
llvm-svn: 91920
2009-12-22 21:35:02 +00:00
Bob Wilson
c19003bca7 Report an error for bad inline assembly, where the value passed for an
"indirect" operand is not a pointer.

llvm-svn: 91913
2009-12-22 18:34:19 +00:00
Bill Wendling
fc4c238bd5 Add more plumbing. This time in the LowerArguments and "get" functions which
return partial registers. This affected the back-end lowering code some.

Also patch up some places I missed before in the "get" functions.

llvm-svn: 91880
2009-12-22 02:10:19 +00:00
Bill Wendling
5aff4bce9d Add SDNode ordering to inlined asm and VA functions.
llvm-svn: 91876
2009-12-22 01:25:10 +00:00
Bill Wendling
b0bd44f096 Adding more assignment of ordering to SDNodes. This time in the "call" and
generic copy functions.

llvm-svn: 91872
2009-12-22 01:11:43 +00:00
Bill Wendling
e01ea21d47 Add ordering of SDNodes to LowerCallTo.
llvm-svn: 91866
2009-12-22 00:50:32 +00:00
Bill Wendling
761507cdcc Now add ordering to SDNodes created by the massive intrinsic lowering function.
llvm-svn: 91863
2009-12-22 00:40:51 +00:00
Bill Wendling
d5649e184e To make things interesting, I added MORE code to set the ordering of
SDNodes. This time in the load/store and limited-precision code.

llvm-svn: 91860
2009-12-22 00:12:37 +00:00
Bill Wendling
88d8eb621b Add more plumbing to assign ordering to SDNodes. Have the "getValue" method
assign the ordering when called. Combine some of the ordering assignments to
keep things simple.

llvm-svn: 91857
2009-12-21 23:47:40 +00:00
Bill Wendling
576a9ae88d More ordering plumbing. This time for GEP. I need to remember to assign
orderings to values returned by getValue().

llvm-svn: 91850
2009-12-21 23:10:19 +00:00
Bill Wendling
85f5cca691 Another incremental check-in for assigning ordering to SDNodes. This time for
shuffle and insert vector.

llvm-svn: 91847
2009-12-21 22:42:14 +00:00
Bill Wendling
9a0bd2daca Assign ordering to more instructions. Incremental check-in.
llvm-svn: 91846
2009-12-21 22:30:11 +00:00
Bill Wendling
97d31ee226 - Add a bit more plumbing assigning an order to SDNodes.
- Modify the "dump" method to emit the order of an SDNode.

llvm-svn: 91845
2009-12-21 21:59:52 +00:00
Bill Wendling
2d7ea292a6 First wave of plumbing for assigning an ordering to SDNodes. This takes care of
a lot of the branching instructions.

llvm-svn: 91838
2009-12-21 19:59:38 +00:00
Bill Wendling
ecb9172c96 Place SDNodeOrdering.h in the directory it's used.
llvm-svn: 91834
2009-12-21 19:34:59 +00:00
Anton Korobeynikov
682c6a3b74 Use 4-arg getVTList) variant instead of generic one, when possible
llvm-svn: 91744
2009-12-19 02:04:00 +00:00
Bill Wendling
aed33d79ab Changes from review:
- Move DisableScheduling flag into TargetOption.h
- Move SDNodeOrdering into its own header file. Give it a minimal interface that
  doesn't conflate construction with storage.
- Move assigning the ordering into the SelectionDAGBuilder.

This isn't used yet, so there should be no functional changes.

llvm-svn: 91727
2009-12-18 23:32:53 +00:00
Evan Cheng
bc37151dea Increase opportunities to optimize (brcond (srl (and c1), c2)).
llvm-svn: 91717
2009-12-18 21:31:31 +00:00
Bob Wilson
a9f20f9f6e Handle ARM inline asm "w" constraints with 64-bit ("d") registers.
The change in SelectionDAGBuilder is needed to allow using bitcasts to convert
between f64 (the default type for ARM "d" registers) and 64-bit Neon vector
types.  Radar 7457110.

llvm-svn: 91649
2009-12-18 01:03:29 +00:00
Ken Dyck
8eb2574e35 Introduce EVT::getHalfSizedIntegerVT() for use in ExpandUnalignedStore() in
LegalizeDAG.cpp. Unlike the code it replaces, which simply decrements the simple
type by one, getHalfSizedIntegerVT() searches for the smallest simple integer
type that is at least half the size of the type it is called on. This approach
has the advantage that it will continue working if a new value type (such as
i24) is added to MVT.

Also, in preparation for new value types, remove the assertions that
non-power-of-2 8-bit-mutiple types are Extended when legalizing extload and
truncstore operations.

llvm-svn: 91614
2009-12-17 20:09:43 +00:00
Bob Wilson
db6c6a5e63 Fix a comment grammaro.
llvm-svn: 91584
2009-12-17 05:07:36 +00:00
Evan Cheng
dbd8789125 Revert this dag combine change:
Fold (zext (and x, cst)) -> (and (zext x), cst)

DAG combiner likes to optimize expression in the other way so this would end up cause an infinite looping.

llvm-svn: 91574
2009-12-17 00:40:05 +00:00
Daniel Dunbar
70f0e3d7d0 Reapply r91392, it was only unmasking the bug, and since TOT is still broken having it reverted does no good.
llvm-svn: 91560
2009-12-16 20:10:05 +00:00
Daniel Dunbar
bcd7588947 Revert "Initial work on disabling the scheduler. This is a work in progress, and
this", this broke llvm-gcc bootstrap for release builds on
x86_64-apple-darwin10.

llvm-svn: 91533
2009-12-16 10:56:02 +00:00
Evan Cheng
c531da60aa Make 91378 more conservative.
1. Only perform (zext (shl (zext x), y)) -> (shl (zext x), y) when y is a constant. This makes sure it remove at least one zest.
2. If the shift is a left shift, make sure the original shift cannot shift out bits.

llvm-svn: 91399
2009-12-15 03:00:32 +00:00
Bill Wendling
e972f48c8f Initial work on disabling the scheduler. This is a work in progress, and this
stuff isn't used just yet.

We want to model the GCC `-fno-schedule-insns' and `-fno-schedule-insns2'
flags. The hypothesis is that the people who use these flags know what they are
doing, and have hand-optimized the C code to reduce latencies and other
conflicts.

The idea behind our scheme to turn off scheduling is to create a map "on the
side" during DAG generation. It will order the nodes by how they appeared in the
code. This map is then used during scheduling to get the ordering.

llvm-svn: 91392
2009-12-15 01:54:51 +00:00
Evan Cheng
bd48ad16fa Fold (zext (and x, cst)) -> (and (zext x), cst).
llvm-svn: 91380
2009-12-15 00:52:11 +00:00
Evan Cheng
f3b2e55b34 Propagate zest through logical shift.
llvm-svn: 91378
2009-12-15 00:41:36 +00:00
Dan Gohman
57dc006590 Fix integer cast code to handle vector types.
llvm-svn: 91362
2009-12-14 23:40:38 +00:00
Dan Gohman
e4169d615e Fix this to properly clear the FastISel debug location. Thanks to
Bill for spotting this!

llvm-svn: 91355
2009-12-14 23:08:09 +00:00
Anton Korobeynikov
5236d41ee7 Fix weird typo which leads to unallocated memory access for nodes with 4 results.
llvm-svn: 91233
2009-12-13 01:00:59 +00:00
Dan Gohman
512052fbf2 Delete an unnecessary line. The VTSDNode on a SIGN_EXTEND_REG is never
a vector type.

llvm-svn: 91181
2009-12-11 23:26:08 +00:00
Dan Gohman
2e616e859b Implement vector widening, splitting, and scalarizing for SIGN_EXTEND_INREG.
llvm-svn: 91158
2009-12-11 21:31:27 +00:00
Dan Gohman
b2cbb1e37e Fix the result type of SELECT nodes lowered from Select instructions with
aggregate return values. This fixes PR5754.

llvm-svn: 91145
2009-12-11 19:50:50 +00:00
Evan Cheng
41c13e41fe Teach InferPtrAlignment to infer GV+cst alignment and use it to simplify x86 isl lowering code.
llvm-svn: 90925
2009-12-09 01:53:58 +00:00
Evan Cheng
7941695285 Move isConsecutiveLoad to SelectionDAG. It's not target dependent and it's primary used by selectdag passes.
llvm-svn: 90922
2009-12-09 01:36:00 +00:00
Evan Cheng
ad75af2aa2 Infer alignment for non-fixed stack object.
llvm-svn: 90919
2009-12-09 01:17:24 +00:00
Evan Cheng
293ec7b394 Add const qualifier.
llvm-svn: 90918
2009-12-09 01:10:37 +00:00
Evan Cheng
b925774a74 Refactor InferAlignment out of DAGCombine.
llvm-svn: 90917
2009-12-09 01:04:59 +00:00
Anton Korobeynikov
b4b8c71b20 Truncate the arguments of llvm.frameaddress / llvm.returnaddress intrinsics from i32 to platform's largest native type
llvm-svn: 90741
2009-12-07 02:28:26 +00:00
Dan Gohman
e6ce676cb2 Remove old DBG_LABEL code.
llvm-svn: 90669
2009-12-05 17:56:26 +00:00
Dan Gohman
d2797bf9ae Remove the unused DisableLegalizeTypes option and related code.
llvm-svn: 90668
2009-12-05 17:51:33 +00:00
Dan Gohman
b352b42391 Don't blindly set the debug location for PHI node copies.
llvm-svn: 90637
2009-12-05 01:29:04 +00:00
Dan Gohman
c9454cd34f Make TargetSelectInstruction protected and called from FastISel.cpp
instead of SelectionDAGISel.cpp.

llvm-svn: 90636
2009-12-05 01:27:58 +00:00
Dan Gohman
feeb2f07a1 The debug information for an LLVM Instruction applies to that Instruction
and that Instruction only. Implement this by setting the "current debug position"
back to Unknown after processing each instruction.

llvm-svn: 90632
2009-12-05 00:27:08 +00:00
Duncan Sands
90101348bd Add note about a subtle bug in this code. Does not effect the main
architectures that LLVM targets, because they don't use this code.

llvm-svn: 90564
2009-12-04 08:42:17 +00:00
Duncan Sands
606510ae1b Fix ExpandShiftWithUnknownAmountBit, which was completely bogus.
Pointed out by Javier Martinez (who also provided a patch).  Since
this logic is not used on (for example) x86, I guess nobody noticed.
Tested by generating SHL, SRL, SRA on various choices of i64 for all
possible shift amounts, and comparing with gcc.  Since I did this on
x86-32, I had to force the use of ExpandShiftWithUnknownAmountBit.
What I'm saying here is that I don't have a testcase I can add to the
repository.

llvm-svn: 90482
2009-12-03 21:37:32 +00:00
Nate Begeman
3a9c51f256 Don't pull vector sext through both hands of a logical operation, since doing so prevents the fusion of vector sext and setcc into vsetcc.
Add a testcase for the above transformation.
Fix a bogus use of APInt noticed while tracking this down.

llvm-svn: 90423
2009-12-03 07:11:29 +00:00
Jakob Stoklund Olesen
c4ee94503f Don't call getValueType() on a null SDValue
llvm-svn: 90415
2009-12-03 05:15:35 +00:00
Chris Lattner
9ce833945e improve portability to avoid conflicting with std::next in c++'0x.
Patch by Howard Hinnant!

llvm-svn: 90365
2009-12-03 00:50:42 +00:00
Dan Gohman
3f4d608e3c Add edge source labels to SelectionDAG graphs, now that the graph printing
framework omits differentiated edge sources in the case where the labels
are empty strings.

llvm-svn: 90254
2009-12-01 19:20:00 +00:00
Dan Gohman
78e1e2806c Minor cleanups.
llvm-svn: 90253
2009-12-01 19:16:15 +00:00
Dan Gohman
58675165bb Trim an unnecessary #include.
llvm-svn: 90252
2009-12-01 19:13:27 +00:00
Tobias Grosser
bc1905d14d Fix last DOTGraphTraits problems in CompilationGraph.
llvm-svn: 90136
2009-11-30 13:34:51 +00:00
Tobias Grosser
74c7605daf Remove ShortNames from getNodeLabel in DOTGraphTraits
llvm-svn: 90134
2009-11-30 12:38:47 +00:00
Tobias Grosser
48d8ba7043 Instantiate DefaultDOTGraphTraits
llvm-svn: 90133
2009-11-30 12:38:13 +00:00
Mon P Wang
27bce4e285 Added support to allow clients to custom widen. For X86, custom widen vectors for
divide/remainder since these operations can trap by unroll them and adding undefs
for the resulting vector.

llvm-svn: 90108
2009-11-30 02:42:02 +00:00
Dan Gohman
b5ec39e2dc Remove ISD::DEBUG_LOC and ISD::DBG_LABEL, which are no longer used.
Note that "hasDotLocAndDotFile"-style debug info was already broken;
people wanting this functionality should implement it in the
AsmPrinter/DwarfWriter code.

llvm-svn: 89711
2009-11-23 23:20:51 +00:00
Dan Gohman
153de919a3 Move CopyCatchInfo into FunctionLoweringInfo.cpp too, for consistency.
llvm-svn: 89683
2009-11-23 18:12:11 +00:00
Dan Gohman
d23a0a12d9 Rename SelectionDAGLowering to SelectionDAGBuilder, and rename
SelectionDAGBuild.cpp to SelectionDAGBuilder.cpp.

llvm-svn: 89681
2009-11-23 18:04:58 +00:00
Dan Gohman
4495850afb Move RegsForValue to an anonymous namespace, since it is only used
in this file.

llvm-svn: 89675
2009-11-23 17:46:23 +00:00
Dan Gohman
b0befa7c20 Move some more code out of SelectionDAGBuild.cpp and into
FunctionLoweringInfo.cpp.

llvm-svn: 89674
2009-11-23 17:42:46 +00:00
Ted Kremenek
b63a5eedf7 Update CMake file.
llvm-svn: 89671
2009-11-23 17:26:04 +00:00
Dan Gohman
086e19c874 Move the FunctionLoweringInfo class and some related utility functions out
of SelectionDAGBuild.h/cpp into its own files, to help separate
general lowering logic from SelectionDAG-specific lowering logic.

llvm-svn: 89667
2009-11-23 17:16:22 +00:00
Devang Patel
327919890c We are not using DBG_STOPPOINT anymore.
llvm-svn: 89536
2009-11-21 02:46:55 +00:00
Dale Johannesen
907ff5a620 When generating a vector the really slow way, via loads
and stores, handle the case where the element size is not
a valid target type correctly (PPC).

llvm-svn: 89521
2009-11-21 00:53:23 +00:00
Dan Gohman
3517f425b8 Target-independent support for TargetFlags on BlockAddress operands,
and support for blockaddresses in x86-32 PIC mode.

llvm-svn: 89506
2009-11-20 23:18:13 +00:00
Duncan Sands
072d688d75 Fix PR5558, which was caused by a wrong fix for PR3393 (see commit 63048),
which was an expensive checks failure due to a bug in the checking.  This
patch in essence reverts the original fix for PR3393, and refixes it by a
tweak to the way expensive checking is done.

llvm-svn: 89454
2009-11-20 10:45:10 +00:00
Dan Gohman
d3d7358309 Fix fast-isel to avoid selecting the return instruction if a
tail call has been encountered.

llvm-svn: 89444
2009-11-20 02:51:26 +00:00
Dan Gohman
fc21555ca5 Remove the optimizations that convert BRCOND and BR_CC into
unconditional branches or fallthroghes. Instcombine/SimplifyCFG
should be simplifying branches with known conditions.

This fixes some problems caused by these transformations not
updating the MachineBasicBlock CFG.

llvm-svn: 89017
2009-11-17 00:47:23 +00:00
Dan Gohman
0679a637b3 Fix a typo in a comment.
llvm-svn: 88953
2009-11-16 20:35:59 +00:00
Dan Gohman
b36274632d Enable the tail call optimization when the caller returns undef.
llvm-svn: 88737
2009-11-14 02:06:30 +00:00
Dan Gohman
01b65e1e48 Don't let a noalias difference disrupt the tailcall optimization.
llvm-svn: 88672
2009-11-13 18:49:38 +00:00
Dale Johannesen
f57a58c4fe Adjust isConstantSplat to allow for big-endian targets.
PPC is such a target; make it work.

llvm-svn: 87060
2009-11-13 01:45:18 +00:00
David Greene
58e7c6145b Add a bool flag to StackObjects telling whether they reference spill
slots.  The AsmPrinter will use this information to determine whether to
print a spill/reload comment.

Remove default argument values.  It's too easy to pass a wrong argument
value when multiple arguments have default values.  Make everything
explicit to trap bugs early.

Update all targets to adhere to the new interfaces..

llvm-svn: 87022
2009-11-12 20:49:22 +00:00