oota-llvm.git
14 years agoRevert commit 101503 (johannes), in the hope of fixing the dragonegg build,
Duncan Sands [Fri, 16 Apr 2010 19:28:59 +0000 (19:28 +0000)]
Revert commit 101503 (johannes), in the hope of fixing the dragonegg build,
see http://google1.osuosl.org:8011/builders/dragonegg-x86_64-linux/builds/693
Original commit text:
Use a ValueMap not a std::map for the reason indicated
in the comment.  This was causing nondeterministic changes
in inlining decisions.

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

14 years agoRemove the assert() from printAddrMode2OffsetOperand(). "#0 and #-0" are
Johnny Chen [Fri, 16 Apr 2010 19:10:52 +0000 (19:10 +0000)]
Remove the assert() from printAddrMode2OffsetOperand().  "#0 and #-0" are
considered legal instructions.

Refs: A8.6.51 LDC, LDC2 (immediate) -- page A8-107, A8.6.58 LDR (immediate, ARM)
-- page A8-121, and A8.6.194 STR (immediate, ARM) -- page A8-395.

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

14 years agoTrim a #include.
Dan Gohman [Fri, 16 Apr 2010 18:45:11 +0000 (18:45 +0000)]
Trim a #include.

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

14 years agoRevert r101455, which fails on the llvm-arm-linux buildbot.
Dan Gohman [Fri, 16 Apr 2010 18:37:31 +0000 (18:37 +0000)]
Revert r101455, which fails on the llvm-arm-linux buildbot.

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

14 years agoUse a ValueMap not a std::map for the reason indicated
Dale Johannesen [Fri, 16 Apr 2010 18:16:08 +0000 (18:16 +0000)]
Use a ValueMap not a std::map for the reason indicated
in the comment.  This was causing nondeterministic changes
in inlining decisions.

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

14 years ago80 col.
Evan Cheng [Fri, 16 Apr 2010 17:58:41 +0000 (17:58 +0000)]
80 col.

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

14 years ago80 col.
Evan Cheng [Fri, 16 Apr 2010 17:57:59 +0000 (17:57 +0000)]
80 col.

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

14 years agoAvoid creating virtual registers for unused values.
Dan Gohman [Fri, 16 Apr 2010 17:15:02 +0000 (17:15 +0000)]
Avoid creating virtual registers for unused values.

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

14 years agoFix an assertion string.
Dan Gohman [Fri, 16 Apr 2010 16:55:18 +0000 (16:55 +0000)]
Fix an assertion string.

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

14 years agoFix a comment.
Dan Gohman [Fri, 16 Apr 2010 16:52:37 +0000 (16:52 +0000)]
Fix a comment.

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

14 years agoDisable inlining of recursive calls. It can complicate tailcallelim and
Dan Gohman [Fri, 16 Apr 2010 16:01:18 +0000 (16:01 +0000)]
Disable inlining of recursive calls. It can complicate tailcallelim and
dependent analyses, and increase code size, so doing it profitably would
require more complex heuristics.

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

14 years agoRefine the detection of seemingly infinitely recursive calls where the
Dan Gohman [Fri, 16 Apr 2010 15:57:50 +0000 (15:57 +0000)]
Refine the detection of seemingly infinitely recursive calls where the
callee is expected to be expanded to something else by codegen, so that
normal infinitely recursive calls are still transformed.

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

14 years agoreapply r101434
Gabor Greif [Fri, 16 Apr 2010 15:33:14 +0000 (15:33 +0000)]
reapply r101434
with a fix for self-hosting

rotate CallInst operands, i.e. move callee to the back
of the operand array

the motivation for this patch are laid out in my mail to llvm-commits:
more efficient access to operands and callee, faster callgraph-construction,
smaller compiler binary

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

14 years agoMake callIsSmall accessible as a utility function.
Dan Gohman [Fri, 16 Apr 2010 15:14:50 +0000 (15:14 +0000)]
Make callIsSmall accessible as a utility function.

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

14 years agoFix SCEVCommutativeExpr::print to be robust in the case of improper
Dan Gohman [Fri, 16 Apr 2010 15:03:25 +0000 (15:03 +0000)]
Fix SCEVCommutativeExpr::print to be robust in the case of improper
expression canonicalization. Its job is to print what's there, not to
make judgements about it.

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

14 years agoDelete a blank line.
Dan Gohman [Fri, 16 Apr 2010 13:32:55 +0000 (13:32 +0000)]
Delete a blank line.

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

14 years agoAdd Debug+Coverage to more svn:ignore properties.
Dan Gohman [Fri, 16 Apr 2010 13:29:35 +0000 (13:29 +0000)]
Add Debug+Coverage to more svn:ignore properties.

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

14 years agoAdd JIT exception handling test.
Bill Wendling [Fri, 16 Apr 2010 09:04:28 +0000 (09:04 +0000)]
Add JIT exception handling test.

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

14 years agoThe JIT calls TidyLandingPads to tidy up the landing pads. However, because the
Bill Wendling [Fri, 16 Apr 2010 08:46:10 +0000 (08:46 +0000)]
The JIT calls TidyLandingPads to tidy up the landing pads. However, because the
JIT doesn't use the MC back-end asm printer to emit labels that it uses, the
section for the MCSymbol is never set. And thus the MCSymbol for the EH label
isn't marked as "defined". Because of that, TidyLandingPads removes the needed
landing pads from the JIT output. This breaks EH for every JIT program.

This is a work-around for this limitation. We pass in the label locations
map. If the label has a non-zero value, then it was "emitted" by the JIT and
TidyLandingPads shouldn't remove that label.

A nicer solution would be to mark the MCSymbol as "used" by the JIT and not rely
upon the section being set to determine if it's defined or not.

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

14 years agocompleted my pass over all 6+ months of commits, next step, format and make comprehen...
Chris Lattner [Fri, 16 Apr 2010 06:20:22 +0000 (06:20 +0000)]
completed my pass over all 6+ months of commits, next step, format and make comprehendable.

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

14 years agoAdding support for dag combiner to promote operations for profit. This requires targe...
Evan Cheng [Fri, 16 Apr 2010 06:14:10 +0000 (06:14 +0000)]
Adding support for dag combiner to promote operations for profit. This requires target specific queries. For example, x86 should promote i16 to i32 when it does not impact load folding.
x86 support is off by default. It can be enabled with -promote-16bit.

Work in progress.

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

14 years agoUse getAL() rather than a major constant.
Evan Cheng [Fri, 16 Apr 2010 05:46:06 +0000 (05:46 +0000)]
Use getAL() rather than a major constant.

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

14 years agoAdd Debug+Coverage and friends to svn:ignore properties.
Dan Gohman [Fri, 16 Apr 2010 05:31:57 +0000 (05:31 +0000)]
Add Debug+Coverage and friends to svn:ignore properties.

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

14 years agoAdd a check for posix_spawn.
Eric Christopher [Fri, 16 Apr 2010 05:14:21 +0000 (05:14 +0000)]
Add a check for posix_spawn.

Regenerate configure and other autoconf files.

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

14 years agoRefine further the scope where the global DebugLoc value is active.
Dan Gohman [Fri, 16 Apr 2010 05:06:56 +0000 (05:06 +0000)]
Refine further the scope where the global DebugLoc value is active.

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

14 years agoRevert r64616 which worked around http://gcc.gnu.org/PR42757 , we just didn't
Nick Lewycky [Fri, 16 Apr 2010 04:32:20 +0000 (04:32 +0000)]
Revert r64616 which worked around gcc.gnu.org/PR42757 , we just didn't
know it at the time.

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

14 years agoSilence an unused variable warning.
Eric Christopher [Fri, 16 Apr 2010 04:02:04 +0000 (04:02 +0000)]
Silence an unused variable warning.

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

14 years agofix comment noticed by Bob
Chris Lattner [Fri, 16 Apr 2010 02:32:17 +0000 (02:32 +0000)]
fix comment noticed by Bob

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

14 years agoback out r101423 and r101397, they break llvm-gcc self-host on darwin10
Gabor Greif [Fri, 16 Apr 2010 01:16:20 +0000 (01:16 +0000)]
back out r101423 and r101397, they break llvm-gcc self-host on darwin10

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

14 years agomove comment.
Chris Lattner [Fri, 16 Apr 2010 01:05:52 +0000 (01:05 +0000)]
move comment.

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

14 years agofix PR6832: we were using the alignment of a pointer when we
Chris Lattner [Fri, 16 Apr 2010 01:05:38 +0000 (01:05 +0000)]
fix PR6832: we were using the alignment of a pointer when we
wanted the alignment of the pointee.

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

14 years agoCreate an exports file, so that the plugin only exports the onload symbol.
Dan Gohman [Fri, 16 Apr 2010 00:43:25 +0000 (00:43 +0000)]
Create an exports file, so that the plugin only exports the onload symbol.

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

14 years agoMake things static that don't need to be referenced from outside the file.
Dan Gohman [Fri, 16 Apr 2010 00:42:57 +0000 (00:42 +0000)]
Make things static that don't need to be referenced from outside the file.

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

14 years agoimprove comments.
Chris Lattner [Fri, 16 Apr 2010 00:38:19 +0000 (00:38 +0000)]
improve comments.

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

14 years agoAdd an svn:ignore.
Dan Gohman [Fri, 16 Apr 2010 00:26:43 +0000 (00:26 +0000)]
Add an svn:ignore.

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

14 years agopull all the ConvertToScalarInfo code together into one
Chris Lattner [Fri, 16 Apr 2010 00:24:57 +0000 (00:24 +0000)]
pull all the ConvertToScalarInfo code together into one
place.

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

14 years agomore refactoring: suck some stuff out of SRoA into
Chris Lattner [Fri, 16 Apr 2010 00:20:00 +0000 (00:20 +0000)]
more refactoring: suck some stuff out of SRoA into
ConvertToScalarInfo.

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

14 years agoshift intrinsic operand
Gabor Greif [Fri, 16 Apr 2010 00:06:45 +0000 (00:06 +0000)]
shift intrinsic operand

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

14 years agointroduce a new ConvertToScalarInfo struct to simplify
Chris Lattner [Thu, 15 Apr 2010 23:50:26 +0000 (23:50 +0000)]
introduce a new ConvertToScalarInfo struct to simplify
CanConvertToScalar/MergeInType.  Eliminate a pointless
LLVMContext argument to MergeInType.

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

14 years agoAvoid sinking machine instructions into a loop.
Jakob Stoklund Olesen [Thu, 15 Apr 2010 23:41:02 +0000 (23:41 +0000)]
Avoid sinking machine instructions into a loop.

MachineLoopInfo is already available when MachineSinking runs, so the check is
free.

There is no test case because it would require a critical edge into a loop, and
CodeGenPrepare splits those. This check is just to be extra careful.

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

14 years agoAdded another test case for am3offset operand, testing Rn, #+/-imm8.
Johnny Chen [Thu, 15 Apr 2010 23:23:40 +0000 (23:23 +0000)]
Added another test case for am3offset operand, testing Rn, #+/-imm8.
Previous checkin tested Rn, #+/-Rm.

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

14 years agoAdd test case for machine-sink on critical edges
Jakob Stoklund Olesen [Thu, 15 Apr 2010 23:19:16 +0000 (23:19 +0000)]
Add test case for machine-sink on critical edges

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

14 years agoFixed a bug in ARM disassembly where LDRSBT should have am3offset operand, not
Johnny Chen [Thu, 15 Apr 2010 23:12:47 +0000 (23:12 +0000)]
Fixed a bug in ARM disassembly where LDRSBT should have am3offset operand, not
am2offset.  Modified the instruction table entry and added a new test case.

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

14 years agoMake the export files absolute paths, and change Makefile.rules
Dan Gohman [Thu, 15 Apr 2010 23:08:00 +0000 (23:08 +0000)]
Make the export files absolute paths, and change Makefile.rules
to expect them this way, to fix srcdir!=objdir builds.

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

14 years agoAdd a dependency on the .dir file to make sure that the directory
Dan Gohman [Thu, 15 Apr 2010 22:46:27 +0000 (22:46 +0000)]
Add a dependency on the .dir file to make sure that the directory
is created before the native exports file is built in a parallel build.

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

14 years agoUse default lowering of DYNAMIC_STACKALLOC. As far as I can tell, ARM isle is doing...
Evan Cheng [Thu, 15 Apr 2010 22:20:34 +0000 (22:20 +0000)]
Use default lowering of DYNAMIC_STACKALLOC. As far as I can tell, ARM isle is doing the right thing and codegen looks correct for both Thumb and Thumb2.

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

14 years agotidy interface to isOnlyCopiedFromConstantGlobal
Chris Lattner [Thu, 15 Apr 2010 21:59:20 +0000 (21:59 +0000)]
tidy interface to isOnlyCopiedFromConstantGlobal

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

14 years agoDon't use absolute path for EXPORTED_SYMBOL_FILE, this breaks under the new
Daniel Dunbar [Thu, 15 Apr 2010 21:57:43 +0000 (21:57 +0000)]
Don't use absolute path for EXPORTED_SYMBOL_FILE, this breaks under the new
system.

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

14 years agoGeneralize the EXPORTED_SYMBOL_FILE concept in the Makefiles to work with
Dan Gohman [Thu, 15 Apr 2010 20:54:25 +0000 (20:54 +0000)]
Generalize the EXPORTED_SYMBOL_FILE concept in the Makefiles to work with
native linking export files, including running sed to prepend underscores
on darwin, and make use of it in libLTO and libEnhancedDisassembly.

Remove the leading underscores from library export files so that they
work with the new EXPORTED_SYMBOL_FILE support.

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

14 years agozap mergeinfo
Gabor Greif [Thu, 15 Apr 2010 20:52:17 +0000 (20:52 +0000)]
zap mergeinfo

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

14 years agoreapply r101364, which has been backed out in r101368
Gabor Greif [Thu, 15 Apr 2010 20:51:13 +0000 (20:51 +0000)]
reapply r101364, which has been backed out in r101368
with a fix

rotate CallInst operands, i.e. move callee to the back
of the operand array

the motivation for this patch are laid out in my mail to llvm-commits:
more efficient access to operands and callee, faster callgraph-construction,
smaller compiler binary

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

14 years agoPointed out by housel on #llvm.
Duncan Sands [Thu, 15 Apr 2010 20:35:54 +0000 (20:35 +0000)]
Pointed out by housel on #llvm.

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

14 years agoFix PR6847. RegScavenger should ignore DebugValues.
Jakob Stoklund Olesen [Thu, 15 Apr 2010 20:28:39 +0000 (20:28 +0000)]
Fix PR6847. RegScavenger should ignore DebugValues.

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

14 years agoMake sure the initialization of a GC root is after its definition.
Nicolas Geoffray [Thu, 15 Apr 2010 19:53:35 +0000 (19:53 +0000)]
Make sure the initialization of a GC root is after its definition.

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

14 years agoRevert r100896 and around - this breaks the only mingw32 buildbot we have.
Anton Korobeynikov [Thu, 15 Apr 2010 19:51:42 +0000 (19:51 +0000)]
Revert r100896 and around - this breaks the only mingw32 buildbot we have.

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

14 years agoprune includes
Gabor Greif [Thu, 15 Apr 2010 19:44:21 +0000 (19:44 +0000)]
prune includes

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

14 years agoARM SelectDYN_ALLOC should emit a copy from SP rather than referencing SP directly...
Evan Cheng [Thu, 15 Apr 2010 18:42:28 +0000 (18:42 +0000)]
ARM SelectDYN_ALLOC should emit a copy from SP rather than referencing SP directly. In cases where there are two dyn_alloc in the same BB it would have caused the old SP value to be reused and badness ensues. rdar://7493908

llvm is generating poor code for dynamic alloca, I'll fix that later.

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

14 years agoDEBUG() print out "Unknown format" msg.
Johnny Chen [Thu, 15 Apr 2010 18:13:51 +0000 (18:13 +0000)]
DEBUG() print out "Unknown format" msg.

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

14 years agoReuseFrameIndexVals is used in multiple files, so it can't be static.
Dan Gohman [Thu, 15 Apr 2010 17:34:58 +0000 (17:34 +0000)]
ReuseFrameIndexVals is used in multiple files, so it can't be static.

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

14 years agoEnablePPC64RS and EnablePPC32RS are used in multiple files, so they
Dan Gohman [Thu, 15 Apr 2010 17:20:57 +0000 (17:20 +0000)]
EnablePPC64RS and EnablePPC32RS are used in multiple files, so they
can't be static.

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

14 years agoFix a bunch of namespace polution.
Dan Gohman [Thu, 15 Apr 2010 17:08:50 +0000 (17:08 +0000)]
Fix a bunch of namespace polution.

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

14 years agoFix namespace polution.
Dan Gohman [Thu, 15 Apr 2010 16:23:27 +0000 (16:23 +0000)]
Fix namespace polution.

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

14 years agoMake getPredecessorWithUniqueSuccessorForBB return the unique successor
Dan Gohman [Thu, 15 Apr 2010 16:19:08 +0000 (16:19 +0000)]
Make getPredecessorWithUniqueSuccessorForBB return the unique successor
in addition to the predecessor.

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

14 years agotypos
Gabor Greif [Thu, 15 Apr 2010 15:14:46 +0000 (15:14 +0000)]
typos

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

14 years agoback out r101364, as it trips the linux nightlybot on some clang C++ tests
Gabor Greif [Thu, 15 Apr 2010 12:46:56 +0000 (12:46 +0000)]
back out r101364, as it trips the linux nightlybot on some clang C++ tests

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

14 years agozap mergeinfo
Gabor Greif [Thu, 15 Apr 2010 11:36:12 +0000 (11:36 +0000)]
zap mergeinfo

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

14 years agoSimplify ".bc" detection.
Benjamin Kramer [Thu, 15 Apr 2010 11:33:14 +0000 (11:33 +0000)]
Simplify ".bc" detection.

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

14 years agorotate CallInst operands, i.e. move callee to the back
Gabor Greif [Thu, 15 Apr 2010 10:49:53 +0000 (10:49 +0000)]
rotate CallInst operands, i.e. move callee to the back
of the operand array

the motivation for this patch are laid out in my mail to llvm-commits:
more efficient access to operands and callee, faster callgraph-construction,
smaller compiler binary

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

14 years agoenhance the load/store narrowing optimization to handle a
Chris Lattner [Thu, 15 Apr 2010 06:10:49 +0000 (06:10 +0000)]
enhance the load/store narrowing optimization to handle a
tokenfactor in between the load/store.  This allows us to
optimize test7 into:

_test7:                                 ## @test7
## BB#0:                                ## %entry
movl (%rdx), %eax
                                        ## kill: SIL<def> ESI<kill>
movb %sil, 5(%rdi)
ret

instead of:

_test7:                                 ## @test7
## BB#0:                                ## %entry
movl 4(%esp), %ecx
movl $-65281, %eax           ## imm = 0xFFFFFFFFFFFF00FF
andl 4(%ecx), %eax
movzbl 8(%esp), %edx
shll $8, %edx
addl %eax, %edx
movl 12(%esp), %eax
movl (%eax), %eax
movl %edx, 4(%ecx)
ret

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

14 years agoteach codegen to turn trunc(zextload) into load when possible.
Chris Lattner [Thu, 15 Apr 2010 05:40:59 +0000 (05:40 +0000)]
teach codegen to turn trunc(zextload) into load when possible.
This doesn't occur much at all, it only seems to formed in the case
when the trunc optimization kicks in due to phase ordering.  In that
case it is saves a few bytes on x86-32.

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

14 years agoadd a simple dag combine to replace trivial shl+lshr with
Chris Lattner [Thu, 15 Apr 2010 05:28:43 +0000 (05:28 +0000)]
add a simple dag combine to replace trivial shl+lshr with
and.  This happens with the store->load narrowing stuff.

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

14 years agoImplement rdar://7860110 (also in target/readme.txt) narrowing
Chris Lattner [Thu, 15 Apr 2010 04:48:01 +0000 (04:48 +0000)]
Implement rdar://7860110 (also in target/readme.txt) narrowing
a load/or/and/store sequence into a narrower store when it is
safe.  Daniel tells me that clang will start producing this sort
of thing with bitfields, and this does  trigger a few dozen times
on 176.gcc produced by llvm-gcc even now.

This compiles code like CodeGen/X86/2009-05-28-DAGCombineCrash.ll
into:

        movl    %eax, 36(%rdi)

instead of:

        movl    $4294967295, %eax       ## imm = 0xFFFFFFFF
        andq    32(%rdi), %rax
        shlq    $32, %rcx
        addq    %rax, %rcx
        movq    %rcx, 32(%rdi)

and each of the testcases into a single store.  Each of them used
to compile into craziness like this:

_test4:
movl $65535, %eax            ## imm = 0xFFFF
andl (%rdi), %eax
shll $16, %esi
addl %eax, %esi
movl %esi, (%rdi)
ret

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

14 years agoAdd more const qualifiers for LLVM IR pointers in CodeGen.
Dan Gohman [Thu, 15 Apr 2010 04:33:49 +0000 (04:33 +0000)]
Add more const qualifiers for LLVM IR pointers in CodeGen.

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

14 years agofurther tweak this to do something useful.
Chris Lattner [Thu, 15 Apr 2010 04:31:42 +0000 (04:31 +0000)]
further tweak this to do something useful.

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

14 years agoremove undef control flow.
Chris Lattner [Thu, 15 Apr 2010 04:30:19 +0000 (04:30 +0000)]
remove undef control flow.

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

14 years agoRemove unnecessary uses of <iostream>.
Daniel Dunbar [Thu, 15 Apr 2010 03:47:24 +0000 (03:47 +0000)]
Remove unnecessary uses of <iostream>.

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

14 years agotests: MC/Disassembler tests depend on ARM support being compiler in.
Daniel Dunbar [Thu, 15 Apr 2010 03:47:20 +0000 (03:47 +0000)]
tests: MC/Disassembler tests depend on ARM support being compiler in.

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

14 years agofix a crash on "lli ex" or any other file whose name is exactly two
Chris Lattner [Thu, 15 Apr 2010 03:32:19 +0000 (03:32 +0000)]
fix a crash on "lli ex" or any other file whose name is exactly two
characters long.

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

14 years agoFix build.
Anders Carlsson [Thu, 15 Apr 2010 03:11:28 +0000 (03:11 +0000)]
Fix build.

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

14 years agoAdd const qualifiers to CodeGen's use of LLVM IR constructs.
Dan Gohman [Thu, 15 Apr 2010 01:51:59 +0000 (01:51 +0000)]
Add const qualifiers to CodeGen's use of LLVM IR constructs.

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

14 years agoAllow lowering for palignr instructions for mmx sized vectors. Add
Eric Christopher [Thu, 15 Apr 2010 01:40:20 +0000 (01:40 +0000)]
Allow lowering for palignr instructions for mmx sized vectors.  Add
patterns to handle the lowering.

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

14 years agoMore 80 violations.
Evan Cheng [Thu, 15 Apr 2010 01:25:27 +0000 (01:25 +0000)]
More 80 violations.

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

14 years agoWrap the error msgs in DEBUG() macro so that they won't appear in NDEBUG build.
Johnny Chen [Thu, 15 Apr 2010 01:20:56 +0000 (01:20 +0000)]
Wrap the error msgs in DEBUG() macro so that they won't appear in NDEBUG build.

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

14 years ago80 col violations.
Evan Cheng [Thu, 15 Apr 2010 01:01:55 +0000 (01:01 +0000)]
80 col violations.

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

14 years agoAdd comment.
Devang Patel [Thu, 15 Apr 2010 00:02:49 +0000 (00:02 +0000)]
Add comment.

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

14 years agoThere is no need to track compile unit offsets if there is only one compile unit.
Devang Patel [Wed, 14 Apr 2010 23:56:24 +0000 (23:56 +0000)]
There is no need to track compile unit offsets if there is only one compile unit.

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

14 years agoRemove dead code.
Devang Patel [Wed, 14 Apr 2010 23:54:13 +0000 (23:54 +0000)]
Remove dead code.

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

14 years agoIPO needs ScalarOpts and InstCombine in its libs
Tobias Grosser [Wed, 14 Apr 2010 23:42:23 +0000 (23:42 +0000)]
IPO needs ScalarOpts and InstCombine in its libs

The commit "Adding IPSCCP and Internalize passes to the C-bindings" introduced
new dependencies for IPO. Add these to the CMAKE build as otherwise the
BUILD_SHARED_LIBS=1 build fails.

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

14 years agoFixed another assert exposed by fuzzing. Now, the DisassembleVFPLdStMulFrm()
Johnny Chen [Wed, 14 Apr 2010 22:37:17 +0000 (22:37 +0000)]
Fixed another assert exposed by fuzzing.  Now, the DisassembleVFPLdStMulFrm()
function checks whether we have a valid submode for VLDM/VSTM (must be either
"ia" or "db") before calling ARM_AM::getAM5Opc(AMSubMode, unsigned char).

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

14 years agoAdd -arm-long-calls option to force calls to be indirect. This makes the
Jim Grosbach [Wed, 14 Apr 2010 22:28:31 +0000 (22:28 +0000)]
Add -arm-long-calls option to force calls to be indirect. This makes the
kernel linker happier when dealing with kexts.

Radar 7805069

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

14 years agoFix TrackingVH to handle const Value subclasses.
Dan Gohman [Wed, 14 Apr 2010 22:24:25 +0000 (22:24 +0000)]
Fix TrackingVH to handle const Value subclasses.

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

14 years agoRemove a const here. This makes this function consistent with all the
Dan Gohman [Wed, 14 Apr 2010 22:23:05 +0000 (22:23 +0000)]
Remove a const here. This makes this function consistent with all the
other getOperand wrappers, and it makes it easier to use with DebugInfo
code, which isn't currently prepared to see const MDNode *.

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

14 years agoConstify GetConstantStringInfo.
Dan Gohman [Wed, 14 Apr 2010 22:20:45 +0000 (22:20 +0000)]
Constify GetConstantStringInfo.

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

14 years agoDon't use DILocation when processing a DebugLoc.
Nicolas Geoffray [Wed, 14 Apr 2010 22:06:37 +0000 (22:06 +0000)]
Don't use DILocation when processing a DebugLoc.

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

14 years agoFor t2BFI disassembly, apply the same error checking as in r101205.
Johnny Chen [Wed, 14 Apr 2010 22:04:45 +0000 (22:04 +0000)]
For t2BFI disassembly, apply the same error checking as in r101205.
Change the error msg to read "Encoding error: msb < lsb".

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

14 years agoMove a bunch of methods from CallSite to CallSiteBase, so that they can
Dan Gohman [Wed, 14 Apr 2010 21:47:32 +0000 (21:47 +0000)]
Move a bunch of methods from CallSite to CallSiteBase, so that they can
be used in ImmutableCallSite too.

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

14 years agoFixed another assert exposed by fuzzing. The utility function getRegisterEnum()
Johnny Chen [Wed, 14 Apr 2010 21:03:13 +0000 (21:03 +0000)]
Fixed another assert exposed by fuzzing.  The utility function getRegisterEnum()
was asserting because the (RegClass, RegNum) combination doesn't make sense from
an encoding point of view.

Since getRegisterEnum() is used all over the place, to change the code to check
for encoding error after each call would not only bloat the code, but also make
it less readable.  An Err flag is added to the ARMBasicMCBuilder where a client
can set a non-zero value to indicate some kind of error condition while building
up the MCInst.  ARMBasicMCBuilder::BuildIt() checks this flag and returns false
if a non-zero value is detected.

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

14 years agoRemove unneeded types from test.
Jakob Stoklund Olesen [Wed, 14 Apr 2010 20:56:09 +0000 (20:56 +0000)]
Remove unneeded types from test.

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

14 years ago- Code clean up to reduce indentation.
Evan Cheng [Wed, 14 Apr 2010 20:52:55 +0000 (20:52 +0000)]
- Code clean up to reduce indentation.
- TryToOptimizeStoreOfMallocToGlobal should check if TargetData is available and bail out if it is not. The transformations being done requires TD.

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

14 years agoUse FunTy instead of hard-coding Function.
Dan Gohman [Wed, 14 Apr 2010 20:49:44 +0000 (20:49 +0000)]
Use FunTy instead of hard-coding Function.

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