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

3913 Commits

Author SHA1 Message Date
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
Benjamin Kramer
da70783da7 Add compare_lower and equals_lower methods to StringRef. Switch all users of
StringsEqualNoCase (from StringExtras.h) to it.

llvm-svn: 87020
2009-11-12 20:36:59 +00:00
Devang Patel
c024e96ca3 "Attach debug info with llvm instructions" mode was enabled a month ago. Now make it permanent and remove old way of inserting intrinsics to encode debug info for line number and scopes.
llvm-svn: 87014
2009-11-12 19:02:56 +00:00
Kenneth Uildriks
82bc831061 x86 users can now return arbitrary sized structs. Structs too large to fit in return registers will be returned through a hidden sret parameter introduced during SelectionDAG construction.
llvm-svn: 86876
2009-11-11 19:59:24 +00:00
Dale Johannesen
20e1cd09ba Emit correct code when making a ConstantPool entry for a vector
constant whose component type is not a legal type for the target.
(If the target ConstantPool cannot handle this type either, it has
an opportunity to merge elements.  In practice any target with
8-bit bytes must support i8 *as data*).  7320806 (partial).

llvm-svn: 86751
2009-11-10 23:16:41 +00:00
Devang Patel
5c983cb2ab Implement support to debug inlined functions.
llvm-svn: 86748
2009-11-10 23:06:00 +00:00
Duncan Sands
737962bca6 Codegen support for the llvm.invariant/lifetime.start/end intrinsics:
just throw them away.

llvm-svn: 86678
2009-11-10 09:08:09 +00:00
Dan Gohman
9885f20a6d Remove an unneeded #include.
llvm-svn: 86601
2009-11-09 22:28:30 +00:00
Mike Stump
c2b669b3b2 Fix for 64-bit builds.
llvm-svn: 86600
2009-11-09 22:28:21 +00:00
Evan Cheng
e3acd9adb5 Hide a couple of options.
llvm-svn: 86522
2009-11-09 06:49:37 +00:00
Anton Korobeynikov
0a13189111 Add 8 bit libcalls and make use of them for msp430
llvm-svn: 86384
2009-11-07 17:14:39 +00:00
Chris Lattner
d5eaa6d39b Fix PR5421 by APInt'izing switch lowering.
llvm-svn: 86354
2009-11-07 07:50:34 +00:00
Mon P Wang
ea09038f22 Fix memoizing of CvtRndSatSDNode
llvm-svn: 86340
2009-11-07 04:46:25 +00:00
Kenneth Uildriks
91ceaa85a2 Add code to check at SelectionDAGISel::LowerArguments time to see if return values can be lowered to registers. Coming soon, code to perform sret-demotion if return values cannot be lowered to registers
llvm-svn: 86324
2009-11-07 02:11:54 +00:00
Dan Gohman
e564d875c8 Avoid printing a redundant space in SDNode->dump().
llvm-svn: 86151
2009-11-05 18:49:11 +00:00
Dan Gohman
a66239e39f Make -print-machineinstrs more readable.
- Be consistent when referring to MachineBasicBlocks: BB#0.
 - Be consistent when referring to virtual registers: %reg1024.
 - Be consistent when referring to unknown physical registers: %physreg10.
 - Be consistent when referring to known physical registers: %RAX
 - Be consistent when referring to register 0: %reg0
 - Be consistent when printing alignments: align=16
 - Print jump table contents.
 - Don't print host addresses, in general.
 - and various other cleanups.

llvm-svn: 85682
2009-10-31 20:19:03 +00:00
Dan Gohman
02e34cd465 When discarding SrcValue information, discard all of it so that code
that uses this information knows to behave conservatively.

llvm-svn: 85654
2009-10-31 14:14:04 +00:00
Eric Christopher
dec076697a Fix warning with gcc-4.0 and signed/unsigned.
llvm-svn: 85648
2009-10-31 09:24:35 +00:00
Dan Gohman
3d1f3f707f Don't mark registers dead here when processing nodes with MVT::Flag
results. This works around a problem affecting targets which rely on
MVT::Flag to handle physical register defs.

llvm-svn: 85638
2009-10-30 23:57:47 +00:00
Dan Gohman
6b7d1390d7 Initial target-independent CodeGen support for BlockAddresses.
llvm-svn: 85556
2009-10-30 01:27:03 +00:00
Dan Gohman
ed15829b83 Remove some unnecessary spaces in debug output.
llvm-svn: 85536
2009-10-29 23:30:06 +00:00
Dan Gohman
7f5acc4b57 Move some code from being emitted as boilerplate duplicated in every
*ISelDAGToDAG.cpp to being regular code in SelectionDAGISel.cpp.

llvm-svn: 85530
2009-10-29 22:30:23 +00:00
Dan Gohman
3393a4c997 Rename usesCustomDAGSchedInserter to usesCustomInserter, and update a
bunch of associated comments, because it doesn't have anything to do
with DAGs or scheduling. This is another step in decoupling MachineInstr
emitting from scheduling.

llvm-svn: 85517
2009-10-29 18:10:34 +00:00
Eric Christopher
d34a37560a Make sure we return the right sized type here.
llvm-svn: 85436
2009-10-28 21:32:16 +00:00
Dan Gohman
7948563977 Don't call SDNode::isPredecessorOf when it isn't necessary. If the load's
chains have no users, they can't be predecessors of the condition.

llvm-svn: 85394
2009-10-28 15:28:02 +00:00
Dan Gohman
9547c094eb Rewrite SelectionDAG::isPredecessorOf to be iterative instead of
recursive to avoid consuming extraordinary amounts of stack space
when processing tall graphs.

llvm-svn: 85369
2009-10-28 03:44:30 +00:00
Evan Cheng
4e3bc5efb7 Add a second ValueType argument to isFPImmLegal.
llvm-svn: 85361
2009-10-28 01:43:28 +00:00
Dan Gohman
00c9f3e905 Mark dead physregdefs dead immediately. This helps MachineSink and
MachineLICM and other things which run before LiveVariables is run.

llvm-svn: 85360
2009-10-28 01:13:53 +00:00
Chris Lattner
2bc8002f4c rename indbr -> indirectbr to appease the residents of #llvm.
llvm-svn: 85351
2009-10-28 00:19:10 +00:00
Dan Gohman
191e70dc4d Update the MachineBasicBlock CFG for an indirect branch.
llvm-svn: 85325
2009-10-27 22:10:34 +00:00
Dan Gohman
ed02bc6151 Add CodeGen support for indirect branches.
llvm-svn: 85323
2009-10-27 21:56:26 +00:00
Chris Lattner
bac03ba22e don't use stdio
llvm-svn: 85296
2009-10-27 20:42:54 +00:00
Evan Cheng
151726ad30 Do away with addLegalFPImmediate. Add a target hook isFPImmLegal which returns true if the fp immediate can be natively codegened by target.
llvm-svn: 85281
2009-10-27 19:56:55 +00:00
Chris Lattner
fdda543cea add enough support for indirect branch for the feature test to pass
(assembler,asmprinter, bc reader+writer) and document it.  Codegen
currently aborts on it.

llvm-svn: 85274
2009-10-27 19:13:16 +00:00
Chris Lattner
855341bf05 pseudosourcevalue is also still using getGlobalContext(), so it isn't
thread safe either.

llvm-svn: 85253
2009-10-27 17:02:08 +00:00
Eric Christopher
89c2f934d6 Add objectsize intrinsic and hook it up through codegen. Doesn't
do anything than return "I don't know" at the moment.

llvm-svn: 85189
2009-10-27 00:52:25 +00:00
Victor Hernandez
673c036bc7 Remove FreeInst.
Remove LowerAllocations pass.
Update some more passes to treate free calls just like they were treating FreeInst.

llvm-svn: 85176
2009-10-26 23:43:48 +00:00
Nick Lewycky
2b8400628d Remove includes of Support/Compiler.h that are no longer needed after the
VISIBILITY_HIDDEN removal.

llvm-svn: 85043
2009-10-25 06:57:41 +00:00
Nick Lewycky
711c726c97 Remove VISIBILITY_HIDDEN from class/struct found inside anonymous namespaces.
Chris claims we should never have visibility_hidden inside any .cpp file but
that's still not true even after this commit.

llvm-svn: 85042
2009-10-25 06:33:48 +00:00
Dan Gohman
b15fee5666 APInt-ify the gep scaling code, so that it correctly handles the case where
the scale overflows pointer-sized arithmetic. This fixes PR5281.

llvm-svn: 84954
2009-10-23 17:57:43 +00:00
Anton Korobeynikov
726b132e13 Fix null pointer dereference.
llvm-svn: 84806
2009-10-22 00:15:17 +00:00
Anton Korobeynikov
7b6fe9f251 Fix invalid for vector types fneg(bitconvert(x)) => bitconvert(x ^ sign)
transform.

llvm-svn: 84683
2009-10-20 21:37:45 +00:00
Evan Cheng
e921ebe70d -Revert parts of 84326 and 84411. Distinquishing between fixed and non-fixed
stack slots and giving them different PseudoSourceValue's did not fix the
problem of post-alloc scheduling miscompiling llvm itself.
- Apply Dan's conservative workaround by assuming any non fixed stack slots can
alias other memory locations. This means a load from spill slot #1 cannot 
move above a store of spill slot #2. 
- Enable post-alloc scheduling for x86 at optimization leverl Default and above.

llvm-svn: 84424
2009-10-18 18:16:27 +00:00
Evan Cheng
b40322ac49 Only fixed stack objects and spill slots should be get FixedStack PseudoSourceValue.
llvm-svn: 84411
2009-10-18 06:27:36 +00:00
Evan Cheng
d941e8b23a Revert 84315 for now. Re-thinking the patch.
llvm-svn: 84321
2009-10-17 07:53:04 +00:00
Evan Cheng
12dd96e2f8 Rename getFixedStack to getStackObject. The stack objects represented are not
necessarily fixed. Only those will negative frame indices are "fixed."

llvm-svn: 84315
2009-10-17 06:22:26 +00:00
Evan Cheng
33ffbd3518 80 col violation.
llvm-svn: 84311
2009-10-17 06:05:11 +00:00
Dan Gohman
0a76c903df Delete an obsolete comment.
llvm-svn: 84300
2009-10-17 01:37:38 +00:00
Victor Hernandez
a25a2890fa Remove MallocInst from LLVM Instructions.
llvm-svn: 84299
2009-10-17 01:18:07 +00:00
Mon P Wang
385786cdcf Allow widening of extract subvector
llvm-svn: 84279
2009-10-16 22:05:48 +00:00
Zhongxing Xu
03d844a262 Indent code.
llvm-svn: 84247
2009-10-16 05:42:28 +00:00
Jakob Stoklund Olesen
2ba26ceb11 Report errors correctly for unselected target intrinsics.
llvm-svn: 84193
2009-10-15 18:50:03 +00:00
Duncan Sands
4fcf6123dd I don't see any point in having both eh.selector.i32 and eh.selector.i64,
so get rid of eh.selector.i64 and rename eh.selector.i32 to eh.selector.
Likewise for eh.typeid.for.  This aligns us with gcc, which always uses a
32 bit value for the selector on all platforms.  My understanding is that
the register allocator used to assert if the selector intrinsic size didn't
match the pointer size, and this was the reason for introducing the two
variants.  However my testing shows that this is no longer the case (I
fixed some bugs in selector lowering yesterday, and some more today in the
fastisel path; these might have caused the original problems).

llvm-svn: 84106
2009-10-14 16:11:37 +00:00
Devang Patel
72f708ec2f s/DebugLoc.CompileUnit/DebugLoc.Scope/g
s/DebugLoc.InlinedLoc/DebugLoc.InlinedAtLoc/g

llvm-svn: 84054
2009-10-13 23:28:53 +00:00
Duncan Sands
d4a35e9f36 Introduce new convenience methods for sign extending or
truncating an SDValue (depending on whether the target
type is bigger or smaller than the value's type); or zero
extending or truncating it.  Use it in a few places (this
seems to be a popular operation, but I only modified cases
of it in SelectionDAGBuild).  In particular, the eh_selector
lowering was doing this wrong due to a repeated rather than
inverted test, fixed with this change.

llvm-svn: 84027
2009-10-13 21:04:12 +00:00
Devang Patel
8abee488dc Set default location for a function if it is not set.
llvm-svn: 83921
2009-10-12 23:10:55 +00:00
Nate Begeman
d27f450262 More heuristics for Combiner-AA. Still catches all important cases, but
compile time penalty on gnugo, the worst case in MultiSource, is down to
about 2.5% from 30%

llvm-svn: 83824
2009-10-12 05:53:58 +00:00
Dan Gohman
605f85e0e6 Create a new InstrEmitter class for translating SelectionDAG nodes
into MachineInstrs. This is mostly just moving the code from
ScheduleDAGSDNodesEmit.cpp into a new class. This decouples MachineInstr
emitting from scheduling.

llvm-svn: 83699
2009-10-10 01:32:21 +00:00
Dan Gohman
3b025b778b Make getMachineNode return a MachineSDNode* instead of a generic SDNode*
since it won't do any folding. This will help avoid some inconvenient
casting.

llvm-svn: 83698
2009-10-10 01:29:16 +00:00
Dan Gohman
5141b26ffa The ScheduleDAG framework now requires an AliasAnalysis argument, though
it isn't needed in the ScheduleDAGSDNodes schedulers.

llvm-svn: 83691
2009-10-09 23:33:48 +00:00
Devang Patel
c97c44b584 Extract scope information from the variable itself, instead of relying on alloca or llvm.dbg.declare location.
While recording beginning of a function, use scope info from the first location entry instead of just relying on first location entry itself.

llvm-svn: 83684
2009-10-09 22:42:28 +00:00
Bob Wilson
72c8f63e50 Add a SelectionDAG getTargetInsertSubreg convenience function,
similar to getTargetExtractSubreg.

llvm-svn: 83564
2009-10-08 18:49:46 +00:00
Devang Patel
1639c0e45a Add support to handle debug info attached to an instruction.
This is not yet enabled.

llvm-svn: 83400
2009-10-06 18:37:31 +00:00
Devang Patel
6a7f2ee022 Set default location for the function if it is not already set.
This code is not  yet enabled.

llvm-svn: 83349
2009-10-06 00:09:08 +00:00
Devang Patel
d24ba7a101 If location info is attached with an instruction then keep track of alloca slots used by a variable. This info will be used by AsmPrinter to emit debug info for variables.
llvm-svn: 83189
2009-10-01 01:03:26 +00:00
Devang Patel
044648c2d7 Use MDNode * directly as an RecordSourceLine() argument.
llvm-svn: 83182
2009-09-30 22:51:28 +00:00
Reid Kleckner
4c0732ea64 Silence comparison always false warning in -Asserts mode.
llvm-svn: 83164
2009-09-30 20:43:07 +00:00
Reid Kleckner
ffe2b97d7a Fix integer overflow in instruction scheduling. This can happen if we have
basic blocks that are so long that their size overflows a short.

Also assert that overflow does not happen in the future, as requested by Evan.

This fixes PR4401.

llvm-svn: 83159
2009-09-30 20:15:38 +00:00
Devang Patel
5dcd8e1d86 Remove unnecessary cast.
llvm-svn: 83100
2009-09-29 19:56:13 +00:00
Devang Patel
1070b7a713 s/class Metadata/class MetadataContext/g
llvm-svn: 83019
2009-09-28 21:41:20 +00:00
Devang Patel
d836a7d651 Do not use global typedef for MDKindID.
llvm-svn: 83016
2009-09-28 21:14:55 +00:00
Dan Gohman
ffa11ade11 Use VerifySchedule instead of doing the work manually.
llvm-svn: 82995
2009-09-28 16:09:41 +00:00
Dan Gohman
6899a1cd58 Convert comparisons like (x == infinity) to (x >= infinity) on targets
where FCMP_OEQ is not legal and FCMP_OGE is, such as x86. 

llvm-svn: 82861
2009-09-26 15:24:17 +00:00
Dan Gohman
0ac693a89e Improve MachineMemOperand handling.
- Allocate MachineMemOperands and MachineMemOperand lists in MachineFunctions.
   This eliminates MachineInstr's std::list member and allows the data to be
   created by isel and live for the remainder of codegen, avoiding a lot of
   copying and unnecessary translation. This also shrinks MemSDNode.
 - Delete MemOperandSDNode. Introduce MachineSDNode which has dedicated
   fields for MachineMemOperands.
 - Change MemSDNode to have a MachineMemOperand member instead of its own
   fields with the same information. This introduces some redundancy, but
   it's more consistent with what MachineInstr will eventually want.
 - Ignore alignment when searching for redundant loads for CSE, but remember
   the greatest alignment.

Target-specific code which previously used MemOperandSDNodes with generic
SDNodes now use MemIntrinsicSDNodes, with opcodes in a designated range
so that the SelectionDAG framework knows that MachineMemOperand information
is available.

llvm-svn: 82794
2009-09-25 20:36:54 +00:00
Dan Gohman
0c4e55a2f8 Rename getTargetNode to getMachineNode, for consistency with the
naming scheme used in SelectionDAG, where there are multiple kinds
of "target" nodes, but "machine" nodes are nodes which represent
a MachineInstr.

llvm-svn: 82790
2009-09-25 18:54:59 +00:00
Dale Johannesen
b4b27526eb Make sure sin, cos, sqrt calls are marked readonly
before producing FSIN, FCOS, FSQRT.  If they aren't
so marked we have to assume they might set errno.

llvm-svn: 82781
2009-09-25 18:00:35 +00:00
Dale Johannesen
c137aa03ce Generate FSQRT from calls to the sqrt function, which
allows appropriate backends to generate a sqrt instruction.

On x86, this isn't done at -O0 because we go through
FastISel instead.  This is a behavior change from before
this series of sqrt patches started.  I think this is OK
considering that compile speed is most important at -O0, but
could be convinced otherwise.

llvm-svn: 82778
2009-09-25 17:23:22 +00:00
Nate Begeman
09ef66c0ec Fix combiner-aa issue with bases which are different, but can alias.
Previously, it treated GV+28 GV+0 as different bases, and assumed they could
not alias.

llvm-svn: 82753
2009-09-25 06:05:26 +00:00
Dan Gohman
5c7946a550 Add a version of dumpr() that has a SelectionDAG* argument.
llvm-svn: 82742
2009-09-25 00:34:34 +00:00
Dan Gohman
69f69162d1 Use getStoreSize() instead of getStoreSizeInBits()/8.
llvm-svn: 82656
2009-09-23 21:07:02 +00:00
Dan Gohman
1256f9265b Rename several variables from EVT to more descriptive names, now that EVT
is also the name of their type, as declarations like "EVT EVT" look
really odd.

llvm-svn: 82654
2009-09-23 21:02:20 +00:00
Dan Gohman
8b2d3ef326 Give MachineMemOperand an operator<<, factoring out code from
two different places for printing MachineMemOperands.

Drop the virtual from Value::dump and instead give Value a
protected virtual hook that can be overridden by subclasses
to implement custom printing. This lets printing be more
consistent, and simplifies printing of PseudoSourceValue
values.

llvm-svn: 82599
2009-09-23 01:33:16 +00:00
Dan Gohman
c50bd99a43 Change MachineMemOperand's alignment value to be the alignment of
the base pointer, without the offset. This matches MemSDNode's
new alignment behavior, and holds more interesting information.

llvm-svn: 82473
2009-09-21 19:47:04 +00:00
Chris Lattner
3568d49264 tidy up
llvm-svn: 82397
2009-09-20 17:32:21 +00:00
Daniel Dunbar
378331a13d Tabs -> spaces, and remove trailing whitespace.
llvm-svn: 82355
2009-09-20 02:20:51 +00:00
Evan Cheng
7714c8412d Fix PR4926. When target hook EmitInstrWithCustomInserter() insert new basic blocks and update CFG, it should also inform sdisel of the changes so the phi source operands will come from the right basic blocks.
llvm-svn: 82311
2009-09-19 09:51:03 +00:00
Evan Cheng
7cb9c456e5 Enhance EmitInstrWithCustomInserter() so target can specify CFG changes that sdisel will use to properly complete phi nodes.
Not functionality change yet.

llvm-svn: 82273
2009-09-18 21:02:19 +00:00
Chris Lattner
288097205f duncan points out the EH selector values are signed.
llvm-svn: 82245
2009-09-18 18:34:29 +00:00
Evan Cheng
479df579a0 Revert r82214. It broke 403.gcc on x86_64 / Darwin.
llvm-svn: 82215
2009-09-18 08:26:06 +00:00
Evan Cheng
d1392886c1 Fix a bug in sdisel switch lowering code. When it updates the phi nodes in switch successor blocks, it can introduce multiple phi operands of the same value from different blocks (and may not be on the predecessor list).
This can be seen on CodeGen/Generic/2006-09-06-SwitchLowering.ll. But it's not known to cause any real regression (but I have added an assertion for it now).

llvm-svn: 82214
2009-09-18 08:16:04 +00:00
Chris Lattner
7c218a0238 tolerate llvm.eh.selector.i64 on 32-bit systems and llvm.eh.selector.i32 on
64-bit systems.

llvm-svn: 82180
2009-09-17 23:54:54 +00:00
Devang Patel
0b710cf26b Fix typo.
llvm-svn: 82080
2009-09-16 21:09:07 +00:00
Devang Patel
63a798ef1e At iSel time, update DebugLoc based on debug info attached with an instruction.
llvm-svn: 82077
2009-09-16 20:39:11 +00:00
Nate Begeman
d34c7760b3 Do not add the SVOffset to the Node CSE ID. The same pointer argument cannot have different
SVOffsets.

llvm-svn: 81937
2009-09-15 22:30:11 +00:00
Nate Begeman
e7fa31031b Better solution for tracking both the original alignment of the access, and the current alignment based
on the source value offset.  This avoids increasing the size of mem nodes. 

llvm-svn: 81897
2009-09-15 19:05:41 +00:00
Nate Begeman
ebc8c4a3f1 Remove incorrect CSE code from r81813.
llvm-svn: 81819
2009-09-15 00:38:09 +00:00
Nate Begeman
729869a398 Substantially speed up combiner-aa in the following ways:
1. Switch from an std::set to a SmallPtrSet for visited chain nodes.
2. Do not force the recursive flattening of token factor nodes, regardless of
   use count.
3. Immediately process newly created TokenFactor nodes.

Also, improve combiner-aa by teaching it that loads to non-overlapping offsets
of relatively aligned objects cannot alias.

These changes result in a >5x speedup for combiner-aa on most testcases.

llvm-svn: 81816
2009-09-15 00:18:30 +00:00
Nate Begeman
a9e552182a Teach the legalizer to propagate the original alignment of loads and store when
it splits them.

llvm-svn: 81815
2009-09-15 00:14:28 +00:00
Nate Begeman
e9572a945b Add an "original alignment" field to load and store nodes. This enables the
DAG Combiner to disambiguate chains for loads and stores of types which are
 broken up by the Legalizer into smaller pieces.  

llvm-svn: 81813
2009-09-15 00:13:12 +00:00
Chris Lattner
fbe97bcd52 kill off the last use of TRI::AsmName.
llvm-svn: 81727
2009-09-13 22:42:03 +00:00
Dan Gohman
685eb70d06 Make fast-isel try ISD::FNEG before resorting to bitcasts and xors.
llvm-svn: 81493
2009-09-11 00:36:43 +00:00
Dan Gohman
964c0b8333 Reapply r81171 with a fix: don't try to use i64 when it
isn't legal.

llvm-svn: 81492
2009-09-11 00:34:46 +00:00
Bob Wilson
7b39f31422 Don't swap the operands of a subtraction when trying to create a
post-decrement load/store.

llvm-svn: 81464
2009-09-10 22:09:31 +00:00
Bob Wilson
76cffeddd1 Revert r81171 which was causing pr4927.
llvm-svn: 81415
2009-09-10 00:49:22 +00:00
Dan Gohman
beccd0690e When widening a vector load, use the correct chain. This fixes PR4891.
llvm-svn: 81343
2009-09-09 14:22:57 +00:00
Chris Lattner
0b34068b2b change selectiondag to add the sign extended versions of immediate operands
to instructions instead of zero extended ones.  This makes the asmprinter
print signed values more consistently.  This apparently only really affects
the X86 backend.

llvm-svn: 81265
2009-09-08 23:05:44 +00:00
Dan Gohman
8f7b263087 Fix an abort on a store of an empty struct member. getValue returns
null in the case of an empty struct, so don't try to call getNumValues
on it.

llvm-svn: 81180
2009-09-08 01:44:02 +00:00
Dan Gohman
572ecc26b6 Fix a thinko: When lowering fneg with xor, bitcast the operands
from floating-point to integer first, and bitcast the result
back to floating-point. Previously, this test was passing by
falling back to SelectionDAG lowering. The resulting code isn't
as nice, but it's correct and CodeGen now stays on the fast path.

llvm-svn: 81171
2009-09-07 23:47:14 +00:00
Duncan Sands
942d35c184 Simplify. Testing shows that this is not equivalent to BBI = CR.CaseBB + 1.
llvm-svn: 81124
2009-09-06 18:03:32 +00:00
Duncan Sands
598fe699d0 Remove some not-really-used variables, as warned
about by icc (#593, partial).  Patch by Erick Tryzelaar.

llvm-svn: 81115
2009-09-06 12:41:19 +00:00
Duncan Sands
10c1356bad Remove some unused variables and methods warned about by
icc (#177, partial).  Patch by Erick Tryzelaar.

llvm-svn: 81106
2009-09-06 08:33:48 +00:00
Devang Patel
7b422c1956 Detect VLAs.
Do not use DenseMap operator[] because it inserts new entry if lookup fails. Use find() to check an entry in a DenseMap first.

llvm-svn: 81058
2009-09-05 00:34:14 +00:00
Dan Gohman
c24fb1af4f LLVM currently represents floating-point negation as -0.0 - x. Fix
FastISel to recognize this pattern and emit a floating-point
negation using xor.

llvm-svn: 80963
2009-09-03 22:53:57 +00:00
Dan Gohman
69e9573064 Recognize more opportunities to use SSE min and max instructions,
swapping the operands if necessary.

llvm-svn: 80940
2009-09-03 20:34:31 +00:00
Sandeep Patel
9c4e094e2a Retype from unsigned to CallingConv::ID accordingly. Approved by Bob Wilson.
llvm-svn: 80773
2009-09-02 08:44:58 +00:00
Daniel Dunbar
9872eb764c Remove Offset from ExternalSybmol MachineOperands, this is unused (and at least partly unsupported, in X86 encoding at least).
llvm-svn: 80726
2009-09-01 22:06:46 +00:00
Devang Patel
fbaeda732e Reapply 79977.
Use MDNodes to encode debug info in llvm IR.

llvm-svn: 80406
2009-08-28 23:24:31 +00:00
Anton Korobeynikov
c61d5bbbe2 Add extload expansion for f128
llvm-svn: 80116
2009-08-26 17:39:40 +00:00
Devang Patel
10c075a316 Revert 79977. It causes llvm-gcc bootstrap failures on some platforms.
llvm-svn: 80073
2009-08-26 05:01:18 +00:00
Owen Anderson
3b65ce66e8 Get rid of this horrible "benign race" by exploiting ManagedStatic to initialize
the array on its first access.

llvm-svn: 80040
2009-08-25 22:27:22 +00:00
Devang Patel
7d42bfab6c Update DebugInfo interface to use metadata, instead of special named llvm.dbg.... global variables, to encode debugging information in llvm IR. This is mostly a mechanical change that tests metadata support very well.
This change speeds up llvm-gcc by more then 6% at "-O0 -g" (measured by compiling InstructionCombining.cpp!)

llvm-svn: 79977
2009-08-25 05:24:07 +00:00
Daniel Dunbar
411094cde6 Fix some refactos for iostream changes (in -Asserts mode).
- The world needs better C++ refactoring tools, can I get an Amen!?

llvm-svn: 79843
2009-08-23 08:50:52 +00:00
Chris Lattner
bd73307361 eliminate uses of cerr()
llvm-svn: 79834
2009-08-23 07:05:07 +00:00
Chris Lattner
89d3d59e83 remove a few DOUTs here and there.
llvm-svn: 79832
2009-08-23 06:35:02 +00:00
Chris Lattner
1c0452caeb Change Pass::print to take a raw ostream instead of std::ostream,
update all code that this affects.

llvm-svn: 79830
2009-08-23 06:03:38 +00:00
Eli Friedman
e8106d9fc6 Add check for completeness. Note that this doesn't actually have any
effect with the way the current code is structured.

llvm-svn: 79792
2009-08-23 00:14:19 +00:00
Chris Lattner
5d8af49626 Rename TargetAsmInfo (and its subclasses) to MCAsmInfo.
llvm-svn: 79763
2009-08-22 20:48:53 +00:00
Devang Patel
c071d6c1b4 Record variable debug info at ISel time directly.
llvm-svn: 79742
2009-08-22 17:12:53 +00:00
Owen Anderson
51e0724ae8 Reapply r79708 with the appropriate fix for the case that still requires locking.
llvm-svn: 79731
2009-08-22 06:32:36 +00:00
Chris Lattner
b75d76e6d1 revert r79708 + r79711
llvm-svn: 79720
2009-08-22 04:07:34 +00:00
Eric Christopher
724f0fec19 Actually remove unused static. Previous commit removed trailing
whitespace.

llvm-svn: 79711
2009-08-22 00:41:47 +00:00
Eric Christopher
6da03d3055 Remove unused static.
llvm-svn: 79710
2009-08-22 00:40:45 +00:00
Owen Anderson
2a5b6c38b8 Ease contention on this lock by noticing that all writes to the VTs array will
be of (dynamically) constant values, so races on it are immaterial.  We just need
to ensure that at least one write has completed before return the pointer into it.

With this change, parllc exhibits essentially no overhead on 403.gcc.

llvm-svn: 79708
2009-08-22 00:29:12 +00:00
Bill Wendling
50e8e856f2 Fix typo. Should check both values of RangeUse for 0. Patch by Marius Wachtler.
llvm-svn: 79649
2009-08-21 18:16:06 +00:00
Dan Gohman
eb6fbd7fd1 Add an x86 peep that narrows TEST instructions to forms that use
a smaller encoding. These kinds of patterns are very frequent in
sqlite3, for example.

llvm-svn: 79439
2009-08-19 18:16:17 +00:00