oota-llvm.git
16 years agoAdd CallSite::getArgumentOffset() to hide the differences in operands betwen
Matthijs Kooijman [Tue, 8 Jul 2008 08:50:32 +0000 (08:50 +0000)]
Add CallSite::getArgumentOffset() to hide the differences in operands betwen
Call and Invoke in a single method instead of having it hardcoded in multiple
places.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53224 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd some convenience methods for manipulating
Duncan Sands [Tue, 8 Jul 2008 08:38:44 +0000 (08:38 +0000)]
Add some convenience methods for manipulating
call attributes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53223 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix three bugs:
Chris Lattner [Tue, 8 Jul 2008 05:46:34 +0000 (05:46 +0000)]
Fix three bugs:

1) evaluate [v]fcmp true/false with undefs to true or false instead
   of undef.
2) fix vector comparisons with undef to return a vector result instead
   of i1
3) fix vector comparisons with evaluatable results to return vector
   true/false instead of i1 true/false (PR2529)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53220 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoclarify :)
Chris Lattner [Tue, 8 Jul 2008 05:12:37 +0000 (05:12 +0000)]
clarify :)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53218 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoExpand SCEVUDiv of power of 2 to a lshr instruction.
Nick Lewycky [Tue, 8 Jul 2008 05:05:37 +0000 (05:05 +0000)]
Expand SCEVUDiv of power of 2 to a lshr instruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53217 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAvoid unnecessary string construction during asm printing.
Evan Cheng [Tue, 8 Jul 2008 00:55:58 +0000 (00:55 +0000)]
Avoid unnecessary string construction during asm printing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53215 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoadd _lto_codegen_debug_options so that linker can use it
Nick Kledzik [Mon, 7 Jul 2008 23:24:06 +0000 (23:24 +0000)]
add _lto_codegen_debug_options so that linker can use it

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53213 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoPool-allocation for MachineInstrs, MachineBasicBlocks, and
Dan Gohman [Mon, 7 Jul 2008 23:14:23 +0000 (23:14 +0000)]
Pool-allocation for MachineInstrs, MachineBasicBlocks, and
MachineMemOperands. The pools are owned by MachineFunctions.

This drastically reduces the number of calls to malloc/free made
during the "Emit" phase of scheduling, as well as later phases
in CodeGen. Combined with other changes, this speeds up the
"instruction selection" phase of CodeGen by 10% in some cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53212 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoPool-allocation for SDNodes. The pool is allocated once for each function,
Dan Gohman [Mon, 7 Jul 2008 23:02:41 +0000 (23:02 +0000)]
Pool-allocation for SDNodes. The pool is allocated once for each function,
and reused across SelectionDAGs.

This drastically reduces the number of calls to malloc/free made during
instruction selection, and improves memory locality.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53211 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd some basic Pool-allocation infrastructure. This adds a Recycler class,
Dan Gohman [Mon, 7 Jul 2008 22:58:06 +0000 (22:58 +0000)]
Add some basic Pool-allocation infrastructure. This adds a Recycler class,
for handling bookkeeping for deleted objects, as well as the alist class
template, for keeping lists of objects allocated from Recyclers, and some
related utilities.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53210 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoClean up PPC register specification.
Evan Cheng [Mon, 7 Jul 2008 22:22:07 +0000 (22:22 +0000)]
Clean up PPC register specification.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53209 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoATT asm printer just print register AsmName's instead of calling tolower on each...
Evan Cheng [Mon, 7 Jul 2008 22:21:06 +0000 (22:21 +0000)]
ATT asm printer just print register AsmName's instead of calling tolower on each charater of Name. This speeds it up by 10%.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53208 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoTargetRegisterDesc::Name field is the same as the abstract register name. There is...
Evan Cheng [Mon, 7 Jul 2008 22:19:41 +0000 (22:19 +0000)]
TargetRegisterDesc::Name field is the same as the abstract register name. There is no need for targets to specify register names in addition to their AsmName's.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53207 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoUse the canonical way to get an empty structure.
Bill Wendling [Mon, 7 Jul 2008 21:41:57 +0000 (21:41 +0000)]
Use the canonical way to get an empty structure.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53206 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRefactor the tablegen DAGISelEmitter code for outputing calls to
Dan Gohman [Mon, 7 Jul 2008 21:00:17 +0000 (21:00 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53203 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoUse StringMap for greater justice!
Bill Wendling [Mon, 7 Jul 2008 20:59:31 +0000 (20:59 +0000)]
Use StringMap for greater justice!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53202 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix SDNode::MorphNodeTo (a function used by by SelectNodeTo) to
Dan Gohman [Mon, 7 Jul 2008 20:57:48 +0000 (20:57 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53201 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoMove MachineMemOperand's constructor out of line, to avoid a
Dan Gohman [Mon, 7 Jul 2008 20:32:02 +0000 (20:32 +0000)]
Move MachineMemOperand's constructor out of line, to avoid a
#include dependency on Support/MathExtras.h in the header file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53200 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoSimplify this use of BuildMI. This is also in preparation for
Dan Gohman [Mon, 7 Jul 2008 20:09:12 +0000 (20:09 +0000)]
Simplify this use of BuildMI. This is also in preparation for
pool-allocating MachineInstrs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53198 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoUse of operator* is redundant and confusing here.
Dan Gohman [Mon, 7 Jul 2008 20:08:05 +0000 (20:08 +0000)]
Use of operator* is redundant and confusing here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53197 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoMinor const-correctness fixes.
Dan Gohman [Mon, 7 Jul 2008 20:06:06 +0000 (20:06 +0000)]
Minor const-correctness fixes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53196 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoShrink MachineMemOperand by storing the alignment in log form
Dan Gohman [Mon, 7 Jul 2008 20:05:04 +0000 (20:05 +0000)]
Shrink MachineMemOperand by storing the alignment in log form
and rearranging the fields.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53195 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAssert that all MachineInstrs update PhysRegUseDefLists in
Dan Gohman [Mon, 7 Jul 2008 19:55:35 +0000 (19:55 +0000)]
Assert that all MachineInstrs update PhysRegUseDefLists in
their cleanup code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53194 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix two serious LSR bugs.
Evan Cheng [Mon, 7 Jul 2008 19:51:32 +0000 (19:51 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53193 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agofixed 32-bit fp_to_sint pattern
Bruno Cardoso Lopes [Mon, 7 Jul 2008 19:11:24 +0000 (19:11 +0000)]
fixed 32-bit fp_to_sint pattern

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53192 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoMake ilist noncopyable too.
Dan Gohman [Mon, 7 Jul 2008 18:43:32 +0000 (18:43 +0000)]
Make ilist noncopyable too.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53190 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoDon't use std::advance just to increment or decrement by one.
Dan Gohman [Mon, 7 Jul 2008 18:39:33 +0000 (18:39 +0000)]
Don't use std::advance just to increment or decrement by one.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53189 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoMake BumpPtrAllocator noncopyable.
Dan Gohman [Mon, 7 Jul 2008 18:38:14 +0000 (18:38 +0000)]
Make BumpPtrAllocator noncopyable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53188 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd a space between * and /* to help simple-minded lexers.
Dan Gohman [Mon, 7 Jul 2008 18:34:27 +0000 (18:34 +0000)]
Add a space between * and /* to help simple-minded lexers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53187 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRemove most of the uses of SDOperandPtr, usually replacing it with a
Dan Gohman [Mon, 7 Jul 2008 18:26:29 +0000 (18:26 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53183 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRemove uses of "llvm/Support/Debug.h" from LLVM include files, which
Dan Gohman [Mon, 7 Jul 2008 18:14:29 +0000 (18:14 +0000)]
Remove uses of "llvm/Support/Debug.h" from LLVM include files, which
all happened be unnecessary.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53182 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRemove unnecessary static_casts.
Dan Gohman [Mon, 7 Jul 2008 18:08:20 +0000 (18:08 +0000)]
Remove unnecessary static_casts.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53181 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRemove an unnecessary reinterpret_cast.
Dan Gohman [Mon, 7 Jul 2008 18:07:36 +0000 (18:07 +0000)]
Remove an unnecessary reinterpret_cast.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53180 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd explicit keywords.
Dan Gohman [Mon, 7 Jul 2008 18:00:37 +0000 (18:00 +0000)]
Add explicit keywords.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53179 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoUse empty() instead of size().
Dan Gohman [Mon, 7 Jul 2008 17:52:43 +0000 (17:52 +0000)]
Use empty() instead of size().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53178 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoMake DenseMap's insert return a pair, to more closely resemble std::map.
Dan Gohman [Mon, 7 Jul 2008 17:46:23 +0000 (17:46 +0000)]
Make DenseMap's insert return a pair, to more closely resemble std::map.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53177 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRemoved ImmutableMap::SlimFind and replaced it with ImmutableMap::lookup. The new...
Ted Kremenek [Mon, 7 Jul 2008 16:20:55 +0000 (16:20 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53171 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoLegalizeSetCCOperands should legalize the result of ExpandLibCall. Patch by Richard...
Evan Cheng [Mon, 7 Jul 2008 07:18:09 +0000 (07:18 +0000)]
LegalizeSetCCOperands should legalize the result of ExpandLibCall. Patch by Richard Osborne.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53169 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoHandle 'lshr' instruction with SCEVUDiv object.
Nick Lewycky [Mon, 7 Jul 2008 06:15:49 +0000 (06:15 +0000)]
Handle 'lshr' instruction with SCEVUDiv object.
Comment the xor %x, -1 case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53167 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoPrevent option name conflict.
Bill Wendling [Mon, 7 Jul 2008 05:42:27 +0000 (05:42 +0000)]
Prevent option name conflict.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53166 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoLegalizeTypes soft-float support for stores of a
Duncan Sands [Mon, 7 Jul 2008 00:08:12 +0000 (00:08 +0000)]
LegalizeTypes soft-float support for stores of a
float value.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53165 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd convenient helper for checking whether global is weak in linker sense
Anton Korobeynikov [Sat, 5 Jul 2008 23:48:30 +0000 (23:48 +0000)]
Add convenient helper for checking whether global is weak in linker sense
having weak or linkonce or common or extweak LLVM linkage.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53158 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoTestcase for PR2463
Anton Korobeynikov [Sat, 5 Jul 2008 23:33:40 +0000 (23:33 +0000)]
Testcase for PR2463

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53157 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoOverride weak stuff during linking of aliases. This fixes PR2463.
Anton Korobeynikov [Sat, 5 Jul 2008 23:33:22 +0000 (23:33 +0000)]
Override weak stuff during linking of aliases. This fixes PR2463.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53156 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoTestcase for PR2146
Anton Korobeynikov [Sat, 5 Jul 2008 23:03:46 +0000 (23:03 +0000)]
Testcase for PR2146

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53155 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoProperly link alias and function decls. This fixes PR2146
Anton Korobeynikov [Sat, 5 Jul 2008 23:03:21 +0000 (23:03 +0000)]
Properly link alias and function decls. This fixes PR2146

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53154 91177308-0d34-0410-b5e6-96231b3b80d8

16 years ago80col
Nick Lewycky [Sat, 5 Jul 2008 22:41:37 +0000 (22:41 +0000)]
80col

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53153 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix missed optimization opportunity when analyzing cast of mul and select.
Nick Lewycky [Sat, 5 Jul 2008 21:19:34 +0000 (21:19 +0000)]
Fix missed optimization opportunity when analyzing cast of mul and select.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53151 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFixed generating incorrect aligned stores that I backout of r53031
Mon P Wang [Sat, 5 Jul 2008 20:40:31 +0000 (20:40 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53150 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoSeveral changes to Mips backend, experimental fp support being the most
Bruno Cardoso Lopes [Sat, 5 Jul 2008 19:05:21 +0000 (19:05 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53146 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRather than having a different custom legalization
Duncan Sands [Fri, 4 Jul 2008 11:47:58 +0000 (11:47 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53137 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoLinux also does not require exception handling
Duncan Sands [Fri, 4 Jul 2008 09:55:48 +0000 (09:55 +0000)]
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!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53134 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoDon't return std::vector by value, but pass it in by reference to be filled.
Bill Wendling [Thu, 3 Jul 2008 23:13:02 +0000 (23:13 +0000)]
Don't return std::vector by value, but pass it in by reference to be filled.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53123 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRevert my previous check-in that split up MachineModuleInfo. It turns out to
Bill Wendling [Thu, 3 Jul 2008 22:53:42 +0000 (22:53 +0000)]
Revert my previous check-in that split up MachineModuleInfo. It turns out to
slow the compiler down at -O0 some 30% or more. Ooops.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53120 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoProvide a hook to set the code generation debug options to investigate lto failures.
Devang Patel [Thu, 3 Jul 2008 22:53:14 +0000 (22:53 +0000)]
Provide a  hook to set the code generation debug options to investigate lto failures.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53119 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoBacked out 53031.
Evan Cheng [Thu, 3 Jul 2008 18:20:14 +0000 (18:20 +0000)]
Backed out 53031.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53110 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoBack out 53091 for now.
Evan Cheng [Thu, 3 Jul 2008 18:11:29 +0000 (18:11 +0000)]
Back out 53091 for now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53109 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoUse information already present in the ValueTable to fast-fail when we know there...
Owen Anderson [Thu, 3 Jul 2008 17:44:33 +0000 (17:44 +0000)]
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%.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53108 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoDo not try to update dominator info while manipulating CFG. This code does not handl...
Devang Patel [Thu, 3 Jul 2008 17:37:52 +0000 (17:37 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53106 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRemove the ability for ADCE to remove unreachable blocks in loop nests, because,...
Owen Anderson [Thu, 3 Jul 2008 17:21:41 +0000 (17:21 +0000)]
Remove the ability for ADCE to remove unreachable blocks in loop nests, because, as Eli pointed out, SimplifyCFG already does this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53104 91177308-0d34-0410-b5e6-96231b3b80d8

16 years ago- Remove calls to copyKillDeadInfo which is an N^2 function. Instead, propagate kill...
Evan Cheng [Thu, 3 Jul 2008 09:09:37 +0000 (09:09 +0000)]
- 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53097 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoisel load folding is disabled at -fast. Now hoist the check up to the top level to...
Evan Cheng [Thu, 3 Jul 2008 08:39:51 +0000 (08:39 +0000)]
isel load folding is disabled at -fast. Now hoist the check up to the top level to save some time.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53096 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd newline at the end of Constants.cpp.
Matthijs Kooijman [Thu, 3 Jul 2008 07:46:41 +0000 (07:46 +0000)]
Add newline at the end of Constants.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53092 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agollvm-gcc sometimes marks external declarations hidden, because intializers are
Anton Korobeynikov [Thu, 3 Jul 2008 07:43:14 +0000 (07:43 +0000)]
llvm-gcc sometimes marks external declarations hidden, because intializers are
processed separately. Honour such situation and emit PIC relocations properly
in such case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53091 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRemove unused function.
Bill Wendling [Thu, 3 Jul 2008 07:10:03 +0000 (07:10 +0000)]
Remove unused function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53090 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoPreserve dom info.
Devang Patel [Thu, 3 Jul 2008 07:04:22 +0000 (07:04 +0000)]
Preserve dom info.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53089 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoKeep track of inherited analysis (e.g. dominator tree).
Devang Patel [Thu, 3 Jul 2008 07:02:30 +0000 (07:02 +0000)]
Keep track of inherited analysis (e.g. dominator tree).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53088 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRemove extra FIXME
Devang Patel [Thu, 3 Jul 2008 06:50:04 +0000 (06:50 +0000)]
Remove extra FIXME

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53087 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoReconstruct dom info, if loop is unswitched.
Devang Patel [Thu, 3 Jul 2008 06:48:21 +0000 (06:48 +0000)]
Reconstruct dom info, if loop is unswitched.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53086 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoLoopUnswitch does not preserve dominator info in all cases.
Devang Patel [Thu, 3 Jul 2008 05:55:03 +0000 (05:55 +0000)]
LoopUnswitch does not preserve dominator info in all cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53085 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoReapply r52988, "Simplify addRegisterKilled and addRegisterDead." The
Dan Gohman [Thu, 3 Jul 2008 01:18:51 +0000 (01:18 +0000)]
Reapply r52988, "Simplify addRegisterKilled and addRegisterDead." The
254.gap failure was not due to this mod.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53068 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoUse operator new instead of new char[].
Dan Gohman [Thu, 3 Jul 2008 00:59:36 +0000 (00:59 +0000)]
Use operator new instead of new char[].

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53067 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoUse operator new instead of new char[].
Dan Gohman [Thu, 3 Jul 2008 00:53:09 +0000 (00:53 +0000)]
Use operator new instead of new char[].

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53066 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAvoid unnecessarily copying APInt objects.
Dan Gohman [Thu, 3 Jul 2008 00:52:03 +0000 (00:52 +0000)]
Avoid unnecessarily copying APInt objects.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53065 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoCorrect a comment.
Dan Gohman [Thu, 3 Jul 2008 00:51:05 +0000 (00:51 +0000)]
Correct a comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53064 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoUse std::replace instead of std::find and push_back.
Evan Cheng [Thu, 3 Jul 2008 00:28:27 +0000 (00:28 +0000)]
Use std::replace instead of std::find and push_back.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53063 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoUndo previous patch. It is not that simple to fix dom info here.
Devang Patel [Thu, 3 Jul 2008 00:08:13 +0000 (00:08 +0000)]
Undo previous patch. It is not that simple to fix dom info here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53062 91177308-0d34-0410-b5e6-96231b3b80d8

16 years ago- Add LiveVariables::replaceKillInstruction. This does a subset of instructionChanged...
Evan Cheng [Thu, 3 Jul 2008 00:07:19 +0000 (00:07 +0000)]
- 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53061 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agocommuteInstruction should preserve dead markers.
Evan Cheng [Thu, 3 Jul 2008 00:04:51 +0000 (00:04 +0000)]
commuteInstruction should preserve dead markers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53060 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoMake LiveVariables even more optional, by making it optional in the call to TargetIns...
Owen Anderson [Wed, 2 Jul 2008 23:41:07 +0000 (23:41 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53058 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoReplace a few uses of SelectionDAG::getTargetNode with
Dan Gohman [Wed, 2 Jul 2008 23:23:19 +0000 (23:23 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53057 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoPreserve dom info while simplifing loop after the unswitch.
Devang Patel [Wed, 2 Jul 2008 22:58:54 +0000 (22:58 +0000)]
Preserve dom info while simplifing loop after the unswitch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53052 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd a couple more helper functions to deal with
Eric Christopher [Wed, 2 Jul 2008 22:57:59 +0000 (22:57 +0000)]
Add a couple more helper functions to deal with
creating global constant strings and pointers
to global constant strings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53051 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRevert r52988. It broke 254.gap on x86-64.
Dan Gohman [Wed, 2 Jul 2008 22:12:55 +0000 (22:12 +0000)]
Revert r52988. It broke 254.gap on x86-64.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53050 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoTwoAddressInstructionPass doesn't really require LiveVariables, it just needs to...
Owen Anderson [Wed, 2 Jul 2008 21:28:58 +0000 (21:28 +0000)]
TwoAddressInstructionPass doesn't really require LiveVariables, it just needs to update it if it's already around.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53049 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoVStudio x64 build fixes. Looks like the x64 projects got out of date and this brings...
Chuck Rose III [Wed, 2 Jul 2008 21:02:51 +0000 (21:02 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53047 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoUse ADCE instead of just DCE. ADCE will better clean up after jump threading,
Owen Anderson [Wed, 2 Jul 2008 18:42:07 +0000 (18:42 +0000)]
Use ADCE instead of just DCE.  ADCE will better clean up after jump threading,
for instance.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53045 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoUse df_ext_iterator to capture the reachable set without allocating an extra set.
Owen Anderson [Wed, 2 Jul 2008 18:41:09 +0000 (18:41 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53044 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAvoid a redundant call.
Owen Anderson [Wed, 2 Jul 2008 18:15:31 +0000 (18:15 +0000)]
Avoid a redundant call.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53040 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd support to ADCE for pruning unreachable blocks. This addresses the final
Owen Anderson [Wed, 2 Jul 2008 18:05:19 +0000 (18:05 +0000)]
Add support to ADCE for pruning unreachable blocks.  This addresses the final
part of PR2509.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53038 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoMake the default min align of CreateStackTemporary to be 1
Mon P Wang [Wed, 2 Jul 2008 17:50:10 +0000 (17:50 +0000)]
Make the default min align of CreateStackTemporary to be 1

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53036 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd a new getMergeValues method that does not need
Duncan Sands [Wed, 2 Jul 2008 17:40:58 +0000 (17:40 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53035 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoUse DenseSet rather than SmallPtrSet for the alive set. Using SmallPtrSet
Owen Anderson [Wed, 2 Jul 2008 17:32:04 +0000 (17:32 +0000)]
Use DenseSet rather than SmallPtrSet for the alive set.  Using SmallPtrSet
with a huge "size" parameter is actually quite inefficient.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53034 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoHave DenseSet::insert return a bool indicating whether the insertion succeeded or...
Owen Anderson [Wed, 2 Jul 2008 17:29:59 +0000 (17:29 +0000)]
Have DenseSet::insert return a bool indicating whether the insertion succeeded or not.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53033 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoA better fix for PR2503 that doesn't pessimize GVN in the presence of unreachable...
Owen Anderson [Wed, 2 Jul 2008 17:20:16 +0000 (17:20 +0000)]
A better fix for PR2503 that doesn't pessimize GVN in the presence of unreachable blocks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53032 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFixed problem in EmitStackConvert where the source and target type
Mon P Wang [Wed, 2 Jul 2008 17:07:12 +0000 (17:07 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53031 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoinstead of aborting on shifts of i1, just implicitly fold them.
Chris Lattner [Wed, 2 Jul 2008 17:01:57 +0000 (17:01 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53030 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoUpdate link to testing guide to use the new title.
Matthijs Kooijman [Wed, 2 Jul 2008 13:54:58 +0000 (13:54 +0000)]
Update link to testing guide to use the new title.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53018 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix typo compounded by a cut-and-pasto.
Duncan Sands [Wed, 2 Jul 2008 10:03:53 +0000 (10:03 +0000)]
Fix typo compounded by a cut-and-pasto.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53012 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoLet AnalyzeNewNode take care of calling ExpungeNode.
Duncan Sands [Wed, 2 Jul 2008 09:56:41 +0000 (09:56 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53011 91177308-0d34-0410-b5e6-96231b3b80d8