Bill Wendling
b46e5165bf
Use the canonical way to get an empty structure.
...
llvm-svn: 53206
2008-07-07 21:41:57 +00:00
Dan Gohman
d6ec05077f
Refactor the tablegen DAGISelEmitter code for outputing calls to
...
getTargetNode and SelectNodeTo to reduce duplication, and to
make some of the getTargetNode code available to SelectNodeTo.
Use SelectNodeTo instead of getTargetNode in several new
interesting cases, as it mutates nodes in place instead of
creating new ones.
This triggers some scheduling behavior differences due to nodes
being presented to the scheduler in a different order. Some of the
arbitrary scheduling decisions it makes are now arbitrarily made
differently. This is visible in CodeGen/PowerPC/LargeAbsoluteAddr.ll,
where a trivial scheduling difference led to a trivial register
allocation difference.
llvm-svn: 53203
2008-07-07 21:00:17 +00:00
Bill Wendling
1214860a78
Use StringMap for greater justice!
...
llvm-svn: 53202
2008-07-07 20:59:31 +00:00
Dan Gohman
9169763955
Fix SDNode::MorphNodeTo (a function used by by SelectNodeTo) to
...
properly track dead nodes that are on the original SDNode's operand
list but not the new one, and have no other uses.
llvm-svn: 53201
2008-07-07 20:57:48 +00:00
Dan Gohman
aedb4a61b8
Move MachineMemOperand's constructor out of line, to avoid a
...
#include dependency on Support/MathExtras.h in the header file.
llvm-svn: 53200
2008-07-07 20:32:02 +00:00
Dan Gohman
230263c63e
Simplify this use of BuildMI. This is also in preparation for
...
pool-allocating MachineInstrs.
llvm-svn: 53198
2008-07-07 20:09:12 +00:00
Dan Gohman
14464bc61c
Use of operator* is redundant and confusing here.
...
llvm-svn: 53197
2008-07-07 20:08:05 +00:00
Dan Gohman
c7fc432b19
Minor const-correctness fixes.
...
llvm-svn: 53196
2008-07-07 20:06:06 +00:00
Dan Gohman
75f9b72bfc
Shrink MachineMemOperand by storing the alignment in log form
...
and rearranging the fields.
llvm-svn: 53195
2008-07-07 20:05:04 +00:00
Dan Gohman
14ce7d1eba
Assert that all MachineInstrs update PhysRegUseDefLists in
...
their cleanup code.
llvm-svn: 53194
2008-07-07 19:55:35 +00:00
Evan Cheng
03001cb820
Fix two serious LSR bugs.
...
1. LSR runOnLoop is always returning false regardless if any transformation is made.
2. AddUsersIfInteresting can create new instructions that are added to DeadInsts. But there is a later early exit which prevents them from being freed.
llvm-svn: 53193
2008-07-07 19:51:32 +00:00
Bruno Cardoso Lopes
5f18582c2e
fixed 32-bit fp_to_sint pattern
...
llvm-svn: 53192
2008-07-07 19:11:24 +00:00
Dan Gohman
93e6fc4873
Make ilist noncopyable too.
...
llvm-svn: 53190
2008-07-07 18:43:32 +00:00
Dan Gohman
125919217a
Don't use std::advance just to increment or decrement by one.
...
llvm-svn: 53189
2008-07-07 18:39:33 +00:00
Dan Gohman
ff702ad891
Make BumpPtrAllocator noncopyable.
...
llvm-svn: 53188
2008-07-07 18:38:14 +00:00
Dan Gohman
2974879866
Add a space between * and /* to help simple-minded lexers.
...
llvm-svn: 53187
2008-07-07 18:34:27 +00:00
Dan Gohman
768f2c9246
Remove most of the uses of SDOperandPtr, usually replacing it with a
...
simple const SDOperand*, which is what's usually needed.
For AddNodeIDOperands, which is small, just duplicate the function to
accept an SDUse*.
For SelectionDAG::getNode - Add an overload that accepts SDUse* that
copies the operands into a temporary SDOperand array, but also has
special-case checks for 0 through 3 operands to avoid the copy in
the common cases.
llvm-svn: 53183
2008-07-07 18:26:29 +00:00
Dan Gohman
2860b7a608
Remove uses of "llvm/Support/Debug.h" from LLVM include files, which
...
all happened be unnecessary.
llvm-svn: 53182
2008-07-07 18:14:29 +00:00
Dan Gohman
f9c226beaf
Remove unnecessary static_casts.
...
llvm-svn: 53181
2008-07-07 18:08:20 +00:00
Dan Gohman
027b98686a
Remove an unnecessary reinterpret_cast.
...
llvm-svn: 53180
2008-07-07 18:07:36 +00:00
Dan Gohman
56e3f63ec5
Add explicit keywords.
...
llvm-svn: 53179
2008-07-07 18:00:37 +00:00
Dan Gohman
e916fd5b96
Use empty() instead of size().
...
llvm-svn: 53178
2008-07-07 17:52:43 +00:00
Dan Gohman
38740a98b2
Make DenseMap's insert return a pair, to more closely resemble std::map.
...
llvm-svn: 53177
2008-07-07 17:46:23 +00:00
Ted Kremenek
7c3d9cae58
Removed ImmutableMap::SlimFind and replaced it with ImmutableMap::lookup. The new method does the same thing, except that it returns a pointer to the mapped data type, and not to an internal tree node.
...
llvm-svn: 53171
2008-07-07 16:20:55 +00:00
Evan Cheng
d8b83e1292
LegalizeSetCCOperands should legalize the result of ExpandLibCall. Patch by Richard Osborne.
...
llvm-svn: 53169
2008-07-07 07:18:09 +00:00
Nick Lewycky
f5c547d499
Handle 'lshr' instruction with SCEVUDiv object.
...
Comment the xor %x, -1 case.
llvm-svn: 53167
2008-07-07 06:15:49 +00:00
Bill Wendling
ecf34435f4
Prevent option name conflict.
...
llvm-svn: 53166
2008-07-07 05:42:27 +00:00
Duncan Sands
2fa6cf5c2f
LegalizeTypes soft-float support for stores of a
...
float value.
llvm-svn: 53165
2008-07-07 00:08:12 +00:00
Anton Korobeynikov
a970df57bc
Add convenient helper for checking whether global is weak in linker sense
...
having weak or linkonce or common or extweak LLVM linkage.
llvm-svn: 53158
2008-07-05 23:48:30 +00:00
Anton Korobeynikov
6ef6af2cec
Testcase for PR2463
...
llvm-svn: 53157
2008-07-05 23:33:40 +00:00
Anton Korobeynikov
9cd0b50f16
Override weak stuff during linking of aliases. This fixes PR2463.
...
llvm-svn: 53156
2008-07-05 23:33:22 +00:00
Anton Korobeynikov
62117b7296
Testcase for PR2146
...
llvm-svn: 53155
2008-07-05 23:03:46 +00:00
Anton Korobeynikov
1bb56dedf5
Properly link alias and function decls. This fixes PR2146
...
llvm-svn: 53154
2008-07-05 23:03:21 +00:00
Nick Lewycky
a91c655ee5
80col
...
llvm-svn: 53153
2008-07-05 22:41:37 +00:00
Nick Lewycky
9f1a4dc672
Fix missed optimization opportunity when analyzing cast of mul and select.
...
llvm-svn: 53151
2008-07-05 21:19:34 +00:00
Mon P Wang
5c755ff51b
Fixed generating incorrect aligned stores that I backout of r53031
...
that fixed problems in EmitStackConvert where the source and target type
have different alignment by creating a stack slot with the max
alignment of source and target type.
llvm-svn: 53150
2008-07-05 20:40:31 +00:00
Bruno Cardoso Lopes
c9c3f49993
Several changes to Mips backend, experimental fp support being the most
...
important.
- Cleanup in the Subtarget info with addition of new features, not all support
yet, but they allow the future inclusion of features easier. Among new features,
we have : Arch family info (mips1, mips2, ...), ABI info (o32, eabi), 64-bit
integer
and float registers, allegrex vector FPU (VFPU), single float only support.
- TargetMachine now detects allegrex core.
- Added allegrex (Mips32r2) sext_inreg instructions.
- *Added Float Point Instructions*, handling single float only, and
aliased accesses for 32-bit FPUs.
- Some cleanup in FP instruction formats and FP register classes.
- Calling conventions improved to support mips 32-bit EABI.
- Added Asm Printer support for fp cond codes.
- Added support for sret copy to a return register.
- EABI support added into LowerCALL and FORMAL_ARGS.
- MipsFunctionInfo now keeps a virtual register per function to track the
sret on function entry until function ret.
- MipsInstrInfo FP support into methods (isMoveInstr, isLoadFromStackSlot, ...),
FP cond codes mapping and initial FP Branch Analysis.
- Two new Mips SDNode to handle fp branch and compare instructions : FPBrcond,
FPCmp
- MipsTargetLowering : handling different FP classes, Allegrex support, sret
return copy, no homing location within EABI, non 32-bit stack objects
arguments, and asm constraint for float.
llvm-svn: 53146
2008-07-05 19:05:21 +00:00
Duncan Sands
93e180342a
Rather than having a different custom legalization
...
hook for each way in which a result type can be
legalized (promotion, expansion, softening etc),
just use one: ReplaceNodeResults, which returns
a node with exactly the same result types as the
node passed to it, but presumably with a bunch of
custom code behind the scenes. No change if the
new LegalizeTypes infrastructure is not turned on.
llvm-svn: 53137
2008-07-04 11:47:58 +00:00
Duncan Sands
04fb6bf468
Linux also does not require exception handling
...
moves in order to get correct debug info. Since
I can't imagine how any target could possibly
be any different, I've just stripped out the
option: now all the world's like Darwin!
llvm-svn: 53134
2008-07-04 09:55:48 +00:00
Bill Wendling
4bb9089db7
Don't return std::vector by value, but pass it in by reference to be filled.
...
llvm-svn: 53123
2008-07-03 23:13:02 +00:00
Bill Wendling
2e50689435
Revert my previous check-in that split up MachineModuleInfo. It turns out to
...
slow the compiler down at -O0 some 30% or more. Ooops.
llvm-svn: 53120
2008-07-03 22:53:42 +00:00
Devang Patel
a0e4fb8283
Provide a hook to set the code generation debug options to investigate lto failures.
...
llvm-svn: 53119
2008-07-03 22:53:14 +00:00
Evan Cheng
fad8be450d
Backed out 53031.
...
llvm-svn: 53110
2008-07-03 18:20:14 +00:00
Evan Cheng
633e22b3ee
Back out 53091 for now.
...
llvm-svn: 53109
2008-07-03 18:11:29 +00:00
Owen Anderson
3ea90a7d55
Use information already present in the ValueTable to fast-fail when we know there won't be a value number match. This speeds up GVN on a case where there are very few redundancies by ~25%.
...
llvm-svn: 53108
2008-07-03 17:44:33 +00:00
Devang Patel
eb611ddeb2
Do not try to update dominator info while manipulating CFG. This code does not handle all cases and keeps invalid dom info around some cases, which misleads other passes down stream.
...
Right now, dom info is recaluclated in the end if the loop is switched.
llvm-svn: 53106
2008-07-03 17:37:52 +00:00
Owen Anderson
d57cdc3c60
Remove the ability for ADCE to remove unreachable blocks in loop nests, because, as Eli pointed out, SimplifyCFG already does this.
...
llvm-svn: 53104
2008-07-03 17:21:41 +00:00
Evan Cheng
7d98a48f15
- Remove calls to copyKillDeadInfo which is an N^2 function. Instead, propagate kill / dead markers as new instructions are constructed in foldMemoryOperand, convertToThressAddress, etc.
...
- Also remove LiveVariables::instructionChanged, etc. Replace all calls with cheaper calls which update VarInfo kill list.
llvm-svn: 53097
2008-07-03 09:09:37 +00:00
Evan Cheng
798d9bb97f
isel load folding is disabled at -fast. Now hoist the check up to the top level to save some time.
...
llvm-svn: 53096
2008-07-03 08:39:51 +00:00
Matthijs Kooijman
ba5d7efc6c
Add newline at the end of Constants.cpp.
...
llvm-svn: 53092
2008-07-03 07:46:41 +00:00
Anton Korobeynikov
4827deb74f
llvm-gcc sometimes marks external declarations hidden, because intializers are
...
processed separately. Honour such situation and emit PIC relocations properly
in such case.
llvm-svn: 53091
2008-07-03 07:43:14 +00:00
Bill Wendling
a96eabaab7
Remove unused function.
...
llvm-svn: 53090
2008-07-03 07:10:03 +00:00
Devang Patel
f94b9826b5
Preserve dom info.
...
llvm-svn: 53089
2008-07-03 07:04:22 +00:00
Devang Patel
874a3a0b0d
Keep track of inherited analysis (e.g. dominator tree).
...
llvm-svn: 53088
2008-07-03 07:02:30 +00:00
Devang Patel
226edd1826
Remove extra FIXME
...
llvm-svn: 53087
2008-07-03 06:50:04 +00:00
Devang Patel
c4dcf82a16
Reconstruct dom info, if loop is unswitched.
...
llvm-svn: 53086
2008-07-03 06:48:21 +00:00
Devang Patel
e491bb8845
LoopUnswitch does not preserve dominator info in all cases.
...
llvm-svn: 53085
2008-07-03 05:55:03 +00:00
Dan Gohman
b261292917
Reapply r52988, "Simplify addRegisterKilled and addRegisterDead." The
...
254.gap failure was not due to this mod.
llvm-svn: 53068
2008-07-03 01:18:51 +00:00
Dan Gohman
99e6237ba7
Use operator new instead of new char[].
...
llvm-svn: 53067
2008-07-03 00:59:36 +00:00
Dan Gohman
7722f791f6
Use operator new instead of new char[].
...
llvm-svn: 53066
2008-07-03 00:53:09 +00:00
Dan Gohman
f3c4d7f877
Avoid unnecessarily copying APInt objects.
...
llvm-svn: 53065
2008-07-03 00:52:03 +00:00
Dan Gohman
4c6db53a36
Correct a comment.
...
llvm-svn: 53064
2008-07-03 00:51:05 +00:00
Evan Cheng
9f8b66f3f1
Use std::replace instead of std::find and push_back.
...
llvm-svn: 53063
2008-07-03 00:28:27 +00:00
Devang Patel
7dcfff392a
Undo previous patch. It is not that simple to fix dom info here.
...
llvm-svn: 53062
2008-07-03 00:08:13 +00:00
Evan Cheng
7a265d83bf
- Add LiveVariables::replaceKillInstruction. This does a subset of instructionChanged. That is, it only update the VarInfo.kills if the new instruction is known to have the correct dead and kill markers.
...
- CommuteInstruction copies kill / dead markers over to new instruction. So use replaceKillInstruction instead.
llvm-svn: 53061
2008-07-03 00:07:19 +00:00
Evan Cheng
c939f45fe7
commuteInstruction should preserve dead markers.
...
llvm-svn: 53060
2008-07-03 00:04:51 +00:00
Owen Anderson
30cc028e4a
Make LiveVariables even more optional, by making it optional in the call to TargetInstrInfo::convertToThreeAddressInstruction
...
Also, if LV isn't around, then TwoAddr doesn't need to be updating flags, since they won't have been set in the first place.
llvm-svn: 53058
2008-07-02 23:41:07 +00:00
Dan Gohman
22e9707480
Replace a few uses of SelectionDAG::getTargetNode with
...
SelectionDAG::SelectNodeTo in the instruction selector. This
updates existing nodes in place instead of creating new ones.
Go back to selecting ISD::DBG_LABEL nodes into
TargetInstrInfo::DBG_LABEL nodes instead of leaving them
unselected, now that SelectNodeTo allows us to update them
in place.
llvm-svn: 53057
2008-07-02 23:23:19 +00:00
Devang Patel
5adfcb5783
Preserve dom info while simplifing loop after the unswitch.
...
llvm-svn: 53052
2008-07-02 22:58:54 +00:00
Eric Christopher
30f1d3f0db
Add a couple more helper functions to deal with
...
creating global constant strings and pointers
to global constant strings.
llvm-svn: 53051
2008-07-02 22:57:59 +00:00
Dan Gohman
1b46bfecfe
Revert r52988. It broke 254.gap on x86-64.
...
llvm-svn: 53050
2008-07-02 22:12:55 +00:00
Owen Anderson
8c10c2482a
TwoAddressInstructionPass doesn't really require LiveVariables, it just needs to update it if it's already around.
...
llvm-svn: 53049
2008-07-02 21:28:58 +00:00
Chuck Rose III
6d161f1fd3
VStudio x64 build fixes. Looks like the x64 projects got out of date and this brings them up to code. I've built the project with these new vcproj files for win32 and x64 both debug and release.
...
llvm-svn: 53047
2008-07-02 21:02:51 +00:00
Owen Anderson
abfd3a8162
Use ADCE instead of just DCE. ADCE will better clean up after jump threading,
...
for instance.
llvm-svn: 53045
2008-07-02 18:42:07 +00:00
Owen Anderson
488b89f608
Use df_ext_iterator to capture the reachable set without allocating an extra set.
...
Also, move large sets and vectors out of instance variables and onto the stack,
and give them more reasonable sizes.
llvm-svn: 53044
2008-07-02 18:41:09 +00:00
Owen Anderson
6acc782dad
Avoid a redundant call.
...
llvm-svn: 53040
2008-07-02 18:15:31 +00:00
Owen Anderson
323b5755a6
Add support to ADCE for pruning unreachable blocks. This addresses the final
...
part of PR2509.
llvm-svn: 53038
2008-07-02 18:05:19 +00:00
Mon P Wang
2cf56ce269
Make the default min align of CreateStackTemporary to be 1
...
llvm-svn: 53036
2008-07-02 17:50:10 +00:00
Duncan Sands
739a0548c4
Add a new getMergeValues method that does not need
...
to be passed the list of value types, and use this
where appropriate. Inappropriate places are where
the value type list is already known and may be
long, in which case the existing method is more
efficient.
llvm-svn: 53035
2008-07-02 17:40:58 +00:00
Owen Anderson
9edcf24da9
Use DenseSet rather than SmallPtrSet for the alive set. Using SmallPtrSet
...
with a huge "size" parameter is actually quite inefficient.
llvm-svn: 53034
2008-07-02 17:32:04 +00:00
Owen Anderson
286d0c40c3
Have DenseSet::insert return a bool indicating whether the insertion succeeded or not.
...
llvm-svn: 53033
2008-07-02 17:29:59 +00:00
Owen Anderson
b22a640fe4
A better fix for PR2503 that doesn't pessimize GVN in the presence of unreachable blocks.
...
llvm-svn: 53032
2008-07-02 17:20:16 +00:00
Mon P Wang
4b7c1acf26
Fixed problem in EmitStackConvert where the source and target type
...
have different alignment by creating a stack slot with the max
alignment of source and target type.
llvm-svn: 53031
2008-07-02 17:07:12 +00:00
Chris Lattner
6b2c4f6143
instead of aborting on shifts of i1, just implicitly fold them.
...
The dag combiner can produce a shift of i1 when folding icmp i1's.
llvm-svn: 53030
2008-07-02 17:01:57 +00:00
Matthijs Kooijman
a5d95540f5
Update link to testing guide to use the new title.
...
llvm-svn: 53018
2008-07-02 13:54:58 +00:00
Duncan Sands
d353c265ff
Fix typo compounded by a cut-and-pasto.
...
llvm-svn: 53012
2008-07-02 10:03:53 +00:00
Duncan Sands
ed283c49d5
Let AnalyzeNewNode take care of calling ExpungeNode.
...
This makes sure that all new nodes are expunged, not
just those the top node of a new subtree.
llvm-svn: 53011
2008-07-02 09:56:41 +00:00
Evan Cheng
7e4abde27c
- Use a faster priority comparison function if -fast.
...
- Code clean up.
llvm-svn: 53010
2008-07-02 09:23:51 +00:00
Chris Lattner
c0d47a2d22
optimize StringMap::clear
...
llvm-svn: 53009
2008-07-02 05:30:45 +00:00
Chris Lattner
bedd1b2427
Add a new (simple) StringMap::clear method, patch by Pratik
...
Solanki!
llvm-svn: 53008
2008-07-02 05:26:32 +00:00
Devang Patel
ed50fb5b61
reuse vectors.
...
llvm-svn: 53007
2008-07-02 01:44:29 +00:00
Devang Patel
57d94d6304
Fix comment.
...
llvm-svn: 53006
2008-07-02 01:31:19 +00:00
Devang Patel
e149d4ed4d
Preserve loop data so that it is not fetched everytime it is needed.
...
Keep track of currentLoop.
llvm-svn: 53005
2008-07-02 01:18:13 +00:00
Bill Wendling
536fb95321
Use the canonical form for getting an empty structure.
...
llvm-svn: 53003
2008-07-02 00:50:02 +00:00
Bill Wendling
82a9321f56
Sorry. I couldn't sleep at night knowing I put these ugly casts into the source tree.
...
llvm-svn: 53001
2008-07-02 00:35:47 +00:00
Ted Kremenek
19941499b8
Implemented operator!= for the ImmutableList iterator.
...
llvm-svn: 52998
2008-07-02 00:06:55 +00:00
Owen Anderson
31936d6ab6
Add a version of AddString that takes a const char* so we can avoid extraneous
...
conversions to std::string.
llvm-svn: 52995
2008-07-01 23:49:59 +00:00
Bill Wendling
b7bd02be57
Darwin doesn't need exception handling information for the "move" info when
...
debug information is being output, because it's leet!
llvm-svn: 52994
2008-07-01 23:34:48 +00:00
Evan Cheng
c963f6c14b
Avoid creating expensive comment string if it's not going to be printed.
...
llvm-svn: 52992
2008-07-01 23:18:29 +00:00
Owen Anderson
501f207bdf
No need to use std::distance. We can just count the number of operands
...
much more cheaply.
llvm-svn: 52990
2008-07-01 22:34:11 +00:00