oota-llvm.git
15 years agoadd a comment about why we don't allow inlining indbr.
Chris Lattner [Sun, 1 Nov 2009 18:16:30 +0000 (18:16 +0000)]
add a comment about why we don't allow inlining indbr.

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

15 years agoFix tests.
Evan Cheng [Sun, 1 Nov 2009 18:13:29 +0000 (18:13 +0000)]
Fix tests.

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

15 years agothe verifier shouldn't modify the IR.
Chris Lattner [Sun, 1 Nov 2009 18:11:50 +0000 (18:11 +0000)]
the verifier shouldn't modify the IR.

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

15 years agoReverting 85714, 85715, 85716, which are breaking the build
Douglas Gregor [Sun, 1 Nov 2009 16:42:53 +0000 (16:42 +0000)]
Reverting 85714, 85715, 85716, which are breaking the build

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

15 years agoAdd a function to Passes.h to allow clients to create instances
Dan Gohman [Sun, 1 Nov 2009 15:28:36 +0000 (15:28 +0000)]
Add a function to Passes.h to allow clients to create instances
of the ScalarEvolution pass without needing to #include ScalarEvolution.h.

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

15 years agoDon't #include Pass.h from CallGraph.h.
Dan Gohman [Sun, 1 Nov 2009 15:23:35 +0000 (15:23 +0000)]
Don't #include Pass.h from CallGraph.h.

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

15 years agoRemove the #include of Pass.h from PassManager.h. This breaks a significant
Dan Gohman [Sun, 1 Nov 2009 15:20:19 +0000 (15:20 +0000)]
Remove the #include of Pass.h from PassManager.h. This breaks a significant
#include dependency, as frontends commonly pull in PassManager.h.

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

15 years agoteach ipsccp and ipconstprop that a blockaddress doesn't 'take the address' of a...
Chris Lattner [Sun, 1 Nov 2009 06:11:53 +0000 (06:11 +0000)]
teach ipsccp and ipconstprop that a blockaddress doesn't 'take the address' of a function
in a way that should prevent ip constprop.  This allows clang/test/CodeGen/indirect-goto.c
to pass with the new indirect goto lowering.

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

15 years agochange llvm::MergeBlockIntoPredecessor to not merge two blocks BB1->BB2
Chris Lattner [Sun, 1 Nov 2009 04:57:33 +0000 (04:57 +0000)]
change llvm::MergeBlockIntoPredecessor to not merge two blocks BB1->BB2
when BB2 has its address taken.  Since it ends up doing BB2->rauw(BB1),
this can cause the address of the entry block to be taken.  Since it is
generally undesirable to nuke blocks whose address is taken, even when
we can, just unconditionally stop this xform.

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

15 years agostrengthen an assumption: RevectorBlockTo knows that PredBB
Chris Lattner [Sun, 1 Nov 2009 04:23:20 +0000 (04:23 +0000)]
strengthen an assumption: RevectorBlockTo knows that PredBB
ended in an uncond branch because the pass requires BreakCriticalEdges.

However, BCE doesn't eliminate critical adges from indbrs.

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

15 years agofix an issue where the verifier would reject a function whose entry
Chris Lattner [Sun, 1 Nov 2009 04:08:01 +0000 (04:08 +0000)]
fix an issue where the verifier would reject a function whose entry
block had its address taken even if the blockaddress was dead.

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

15 years agoif CostMetrics says to never duplicate some code, don't unswitch a loop.
Chris Lattner [Sun, 1 Nov 2009 03:42:55 +0000 (03:42 +0000)]
if CostMetrics says to never duplicate some code, don't unswitch a loop.
This prevents unswitching from duplicating indbr's.

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

15 years agoconstant fold indirectbr(blockaddress(%bb)) -> br label %bb.
Chris Lattner [Sun, 1 Nov 2009 03:40:38 +0000 (03:40 +0000)]
constant fold indirectbr(blockaddress(%bb)) -> br label %bb.

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

15 years agoimprove x86 codegen support for blockaddress. We now compile
Chris Lattner [Sun, 1 Nov 2009 03:25:03 +0000 (03:25 +0000)]
improve x86 codegen support for blockaddress.  We now compile
the testcase into:

_test1:                                                     ## @test1
## BB#0:                                                    ## %entry
leaq L_test1_bb6(%rip), %rax
jmpq *%rax
L_test1_bb:                                                 ## Address Taken
LBB1_1:                                                     ## %bb
movb $1, %al
ret
L_test1_bb6:                                                ## Address Taken
LBB1_2:                                                     ## %bb6
movb $2, %al
ret

Note, it is very very strange that BlockAddressSDNode doesn't carry
around TargetFlags.  Dan, please fix this.

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

15 years agopull check for return inst out of loop, never inline a callee that contains
Chris Lattner [Sun, 1 Nov 2009 03:07:53 +0000 (03:07 +0000)]
pull check for return inst out of loop, never inline a callee that contains
an indirectbr.

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

15 years agoFix BlockAddress::replaceUsesOfWithOnConstant to correctly
Chris Lattner [Sun, 1 Nov 2009 03:03:03 +0000 (03:03 +0000)]
Fix BlockAddress::replaceUsesOfWithOnConstant to correctly
maintain the block use count in SubclassData.

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

15 years agoimplement linker support for BlockAddress.
Chris Lattner [Sun, 1 Nov 2009 02:46:39 +0000 (02:46 +0000)]
implement linker support for BlockAddress.

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

15 years agoRevert 85678/85680. The decision is to stay with the current form of
Chris Lattner [Sun, 1 Nov 2009 01:27:45 +0000 (01:27 +0000)]
Revert 85678/85680.  The decision is to stay with the current form of
indirectbr, thus we don't need "blockaddr(@func, null)".  Eliminate it
for simplicity.

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

15 years agoUse cbz and cbnz instructions.
Evan Cheng [Sat, 31 Oct 2009 23:46:45 +0000 (23:46 +0000)]
Use cbz and cbnz instructions.

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

15 years agovml[as].f32 cause stalls in following advanced SIMD instructions. Avoid using
Jim Grosbach [Sat, 31 Oct 2009 22:57:36 +0000 (22:57 +0000)]
vml[as].f32 cause stalls in following advanced SIMD instructions. Avoid using
them for scalar floating point operations for now.

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

15 years agoConsolidate test files
Jim Grosbach [Sat, 31 Oct 2009 22:20:56 +0000 (22:20 +0000)]
Consolidate test files

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

15 years agoChange to use FileCheck
Jim Grosbach [Sat, 31 Oct 2009 22:16:14 +0000 (22:16 +0000)]
Change to use FileCheck

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

15 years agoMake tests more explicit about which instructions are expected.
Jim Grosbach [Sat, 31 Oct 2009 22:14:17 +0000 (22:14 +0000)]
Make tests more explicit about which instructions are expected.

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

15 years agoGrammar tweak to comments
Jim Grosbach [Sat, 31 Oct 2009 22:12:44 +0000 (22:12 +0000)]
Grammar tweak to comments

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

15 years agoMake sure PRE doesn't split crit edges from indirectbr.
Chris Lattner [Sat, 31 Oct 2009 22:11:15 +0000 (22:11 +0000)]
Make sure PRE doesn't split crit edges from indirectbr.

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

15 years agoUpdate test to be more explicit about what instruction sequences are expected for...
Jim Grosbach [Sat, 31 Oct 2009 22:10:38 +0000 (22:10 +0000)]
Update test to be more explicit about what instruction sequences are expected for each operation.

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

15 years agollvm::SplitEdge should refuse to split an edge from an indirectbr.
Chris Lattner [Sat, 31 Oct 2009 22:04:43 +0000 (22:04 +0000)]
llvm::SplitEdge should refuse to split an edge from an indirectbr.
Fix CodeGenPrepare to not try to split edges from indirectbr.

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

15 years agoUpdate test to be more explicit about what instruction sequences are expected for...
Jim Grosbach [Sat, 31 Oct 2009 21:52:58 +0000 (21:52 +0000)]
Update test to be more explicit about what instruction sequences are expected for each operation.

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

15 years agoupdate the comment above llvm::SplitCriticalEdge, and make
Chris Lattner [Sat, 31 Oct 2009 21:51:10 +0000 (21:51 +0000)]
update the comment above llvm::SplitCriticalEdge, and make
it abort on IndirectBrInst as describe in the comment.

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

15 years agoExpand 64-bit logical shift right inline
Jim Grosbach [Sat, 31 Oct 2009 21:42:19 +0000 (21:42 +0000)]
Expand 64-bit logical shift right inline

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

15 years agoExpand 64-bit arithmetic shift right inline
Jim Grosbach [Sat, 31 Oct 2009 21:00:56 +0000 (21:00 +0000)]
Expand 64-bit arithmetic shift right inline

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

15 years agoFix a missing newline in the dwarf output code.
Dan Gohman [Sat, 31 Oct 2009 20:59:09 +0000 (20:59 +0000)]
Fix a missing newline in the dwarf output code.

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

15 years agoMake -print-machineinstrs more readable.
Dan Gohman [Sat, 31 Oct 2009 20:19:03 +0000 (20:19 +0000)]
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.

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

15 years agoFactor out more code into addCommonCodeGenPasses. The JIT wasn't
Dan Gohman [Sat, 31 Oct 2009 20:17:39 +0000 (20:17 +0000)]
Factor out more code into addCommonCodeGenPasses. The JIT wasn't
previously running CodePlacementOpt. Also print headers before
each dump in -print-machineinstrs mode, so that it's clear which
dump is which.

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

15 years agoadjust a couple xforms to work with null bb's in BlockAddress.
Chris Lattner [Sat, 31 Oct 2009 20:13:24 +0000 (20:13 +0000)]
adjust a couple xforms to work with null bb's in BlockAddress.

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

15 years agoMake blockaddress(@func, null) be valid, and make 'deleting a basic
Chris Lattner [Sat, 31 Oct 2009 20:08:37 +0000 (20:08 +0000)]
Make blockaddress(@func, null) be valid, and make 'deleting a basic
block with a blockaddress still referring to it' replace the invalid
blockaddress with a new blockaddress(@func, null) instead of a
inttoptr(1).

This changes the bitcode encoding format, and still needs codegen
support (this should produce a non-zero value, referring to the entry
block of the function would also be quite reasonable).

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

15 years agoForce triple; darwin's ASM syntax differs from linux's.
Benjamin Kramer [Sat, 31 Oct 2009 19:54:06 +0000 (19:54 +0000)]
Force triple; darwin's ASM syntax differs from linux's.

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

15 years agoExpand 64 bit left shift inline rather than using the libcall. For now, this
Jim Grosbach [Sat, 31 Oct 2009 19:38:01 +0000 (19:38 +0000)]
Expand 64 bit left shift inline rather than using the libcall. For now, this
is unconditional. Making it still use the libcall when optimizing for size
would be a good adjustment.

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

15 years agoAdd missing colons for FileCheck.
Benjamin Kramer [Sat, 31 Oct 2009 19:22:24 +0000 (19:22 +0000)]
Add missing colons for FileCheck.

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

15 years agoConvert to FileCheck
Jim Grosbach [Sat, 31 Oct 2009 19:06:53 +0000 (19:06 +0000)]
Convert to FileCheck

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

15 years agoThe universal SDKROOT should only be assigned when hosted. Otherwise the
Jim Grosbach [Sat, 31 Oct 2009 18:00:10 +0000 (18:00 +0000)]
The universal SDKROOT should only be assigned when hosted. Otherwise the
SDKROOT can refer to the target when we're building for the host.

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

15 years agoadd a comment.
Chris Lattner [Sat, 31 Oct 2009 17:48:31 +0000 (17:48 +0000)]
add a comment.

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

15 years agoRevert r85667. LoopUnroll currently can't call utility functions which
Dan Gohman [Sat, 31 Oct 2009 17:33:01 +0000 (17:33 +0000)]
Revert r85667. LoopUnroll currently can't call utility functions which
auto-update the DominatorTree because it doesn't keep the DominatorTree
current while it works.

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

15 years agoRemove redundant code.
Dan Gohman [Sat, 31 Oct 2009 16:16:41 +0000 (16:16 +0000)]
Remove redundant code.

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

15 years agoMerge the enhancements from LoopUnroll's FoldBlockIntoPredecessor into
Dan Gohman [Sat, 31 Oct 2009 16:08:00 +0000 (16:08 +0000)]
Merge the enhancements from LoopUnroll's FoldBlockIntoPredecessor into
MergeBlockIntoPredecessor. This makes SimplifyCFG slightly more aggressive,
and makes it unnecessary for LoopUnroll to have its own copy of this code.

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

15 years agoRename forgetLoopBackedgeTakenCount to forgetLoop, because it
Dan Gohman [Sat, 31 Oct 2009 15:04:55 +0000 (15:04 +0000)]
Rename forgetLoopBackedgeTakenCount to forgetLoop, because it
clears out more information than just the stored backedge taken count.

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

15 years agoReplace LoopUnrollPass.cpp's custom code-size estimation code using
Dan Gohman [Sat, 31 Oct 2009 14:54:17 +0000 (14:54 +0000)]
Replace LoopUnrollPass.cpp's custom code-size estimation code using
the new common CodeMetrics code.

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

15 years agoSimplify this code.
Dan Gohman [Sat, 31 Oct 2009 14:46:50 +0000 (14:46 +0000)]
Simplify this code.

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

15 years agoRemove an unnecessary #include.
Dan Gohman [Sat, 31 Oct 2009 14:39:43 +0000 (14:39 +0000)]
Remove an unnecessary #include.

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

15 years agoUpdate CMakeLists for recent renames.
Dan Gohman [Sat, 31 Oct 2009 14:38:25 +0000 (14:38 +0000)]
Update CMakeLists for recent renames.

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

15 years agoRename UnrollLoop.cpp to LoopUnroll.cpp, and LoopUnroll.cpp to
Dan Gohman [Sat, 31 Oct 2009 14:37:31 +0000 (14:37 +0000)]
Rename UnrollLoop.cpp to LoopUnroll.cpp, and LoopUnroll.cpp to
LoopUnrollPass.cpp, for consistency with other passes which are
similarly split.

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

15 years agoRemove CodeGenLICM. It's largely obsoleted by MachineLICM's new ability
Dan Gohman [Sat, 31 Oct 2009 14:35:41 +0000 (14:35 +0000)]
Remove CodeGenLICM. It's largely obsoleted by MachineLICM's new ability
to unfold loop-invariant loads.

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

15 years agoMake ScalarEvolutionAliasAnalysis slightly more aggressive, by making an
Dan Gohman [Sat, 31 Oct 2009 14:32:25 +0000 (14:32 +0000)]
Make ScalarEvolutionAliasAnalysis slightly more aggressive, by making an
underlying alias call even for non-identified-object values.

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

15 years agoReapply r85634, with the bug fixed.
Dan Gohman [Sat, 31 Oct 2009 14:22:52 +0000 (14:22 +0000)]
Reapply r85634, with the bug fixed.

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

15 years agoWhen discarding SrcValue information, discard all of it so that code
Dan Gohman [Sat, 31 Oct 2009 14:14:04 +0000 (14:14 +0000)]
When discarding SrcValue information, discard all of it so that code
that uses this information knows to behave conservatively.

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

15 years agoFix 80-column violation.
Dan Gohman [Sat, 31 Oct 2009 14:12:53 +0000 (14:12 +0000)]
Fix 80-column violation.

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

15 years agoFix warning with gcc-4.0 and signed/unsigned.
Eric Christopher [Sat, 31 Oct 2009 09:24:35 +0000 (09:24 +0000)]
Fix warning with gcc-4.0 and signed/unsigned.

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

15 years agoIt's safe to remat t2LDRpci; Add PseudoSourceValue to load / store's to enable more...
Evan Cheng [Sat, 31 Oct 2009 03:39:36 +0000 (03:39 +0000)]
It's safe to remat t2LDRpci; Add PseudoSourceValue to load / store's to enable more machine licm. More changes coming.

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

15 years agoRevert 85634. It's breaking consumer-typeset (and others).
Evan Cheng [Sat, 31 Oct 2009 01:28:06 +0000 (01:28 +0000)]
Revert 85634. It's breaking consumer-typeset (and others).

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

15 years agoAdd a target triple so that this test behaves consistently across hosts.
Dan Gohman [Sat, 31 Oct 2009 00:15:28 +0000 (00:15 +0000)]
Add a target triple so that this test behaves consistently across hosts.

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

15 years agoAdd assertion checks here to turn silent miscompiles into aborts.
Dan Gohman [Fri, 30 Oct 2009 23:59:06 +0000 (23:59 +0000)]
Add assertion checks here to turn silent miscompiles into aborts.

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

15 years agoDon't mark registers dead here when processing nodes with MVT::Flag
Dan Gohman [Fri, 30 Oct 2009 23:57:47 +0000 (23:57 +0000)]
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.

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

15 years agoFix the -mattr line for this test so that it passes on hosts that lack SSSE3.
Dan Gohman [Fri, 30 Oct 2009 23:18:27 +0000 (23:18 +0000)]
Fix the -mattr line for this test so that it passes on hosts that lack SSSE3.

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

15 years agoAdd a testcase for the recent duplicate PHI elimination changes.
Dan Gohman [Fri, 30 Oct 2009 23:16:10 +0000 (23:16 +0000)]
Add a testcase for the recent duplicate PHI elimination changes.

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

15 years agoAdd a comment about a missed opportunity.
Dan Gohman [Fri, 30 Oct 2009 23:15:43 +0000 (23:15 +0000)]
Add a comment about a missed opportunity.

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

15 years agoOptimize around the fact that pred_iterator is slow: instead of sorting
Dan Gohman [Fri, 30 Oct 2009 23:15:21 +0000 (23:15 +0000)]
Optimize around the fact that pred_iterator is slow: instead of sorting
PHI operands by the predecessor order, sort them by the order used by the
first PHI in the block. This is still suffucient to expose duplicates.

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

15 years agoUpdates to the ARM target assembler for llvm-mc per review comments from
Kevin Enderby [Fri, 30 Oct 2009 22:55:57 +0000 (22:55 +0000)]
Updates to the ARM target assembler for llvm-mc per review comments from
Daniel Dunbar.
- Reordered the fields in the ARMOperand Mem struct to make the struct smaller.
Making bool's into 1 bit fields and put the MCExpr* fields adjacent to each
other.
- Fixed a number of places in ARMAsmParser.cpp so they have doxygen comments.
- Change the name of ARMAsmParser::ParseRegister() to MaybeParseRegister and
added the bool ParseWriteBack parameter.
- Changed ARMAsmParser::ParseMemory() to call MaybeParseRegister().
- Added ARMAsmParser::ParseMemoryOffsetReg to factor out parsing the offset of a
memory operand.  And use it for both parsing both preindexed and post indexing
addressing forms in ARMAsmParser::ParseMemory.
- Changed the first argument to ParseShift() to a reference.
- Changed ParseShift() to check for Rrx first and return to reduce nesting.

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

15 years agoIf string field is empty then return NULL.
Devang Patel [Fri, 30 Oct 2009 22:52:47 +0000 (22:52 +0000)]
If string field is empty then return NULL.

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

15 years agoif basic blocks are destroyed while there are *just* BlockAddress' hanging
Chris Lattner [Fri, 30 Oct 2009 22:39:36 +0000 (22:39 +0000)]
if basic blocks are destroyed while there are *just* BlockAddress' hanging
around, then zap them.  This is analogous to dangling constantexprs hanging
off functions.

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

15 years agoTeach SimplifyCFG how to eliminate duplicate PHI nodes within a block.
Dan Gohman [Fri, 30 Oct 2009 22:39:04 +0000 (22:39 +0000)]
Teach SimplifyCFG how to eliminate duplicate PHI nodes within a block.
This reduces codesize on a variety of codes by 1-2% on x86-64. It also
helps clean up after SSAUpdater.

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

15 years agomake hasAddressTaken() constant time by storing a refcount in BB's subclass data.
Chris Lattner [Fri, 30 Oct 2009 22:33:29 +0000 (22:33 +0000)]
make hasAddressTaken() constant time by storing a refcount in BB's subclass data.

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

15 years agoAdd a note about Robert Muth's alternate jump table implementation.
Bob Wilson [Fri, 30 Oct 2009 22:22:46 +0000 (22:22 +0000)]
Add a note about Robert Muth's alternate jump table implementation.

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

15 years agoSort the incoming values in PHI nodes to match the predecessor order.
Dan Gohman [Fri, 30 Oct 2009 22:22:22 +0000 (22:22 +0000)]
Sort the incoming values in PHI nodes to match the predecessor order.
This helps expose duplicate PHIs, which will make it easier for them
to be eliminated.

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

15 years agoFix MachineLICM to use the correct virtual register class when
Dan Gohman [Fri, 30 Oct 2009 22:18:41 +0000 (22:18 +0000)]
Fix MachineLICM to use the correct virtual register class when
unfolding loads for hoisting.  getOpcodeAfterMemoryUnfold returns the
opcode of the original operation without the load, not the load
itself, MachineLICM needs to know the operand index in order to get
the correct register class. Extend getOpcodeAfterMemoryUnfold to
return this information.

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

15 years agoit isn't valid to take the address of the entry block.
Chris Lattner [Fri, 30 Oct 2009 22:15:48 +0000 (22:15 +0000)]
it isn't valid to take the address of the entry block.

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

15 years agoIf a type is derived from a derived type then calculate size appropriately.
Devang Patel [Fri, 30 Oct 2009 22:09:30 +0000 (22:09 +0000)]
If a type is derived from a derived type then calculate size appropriately.

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

15 years agoBuild in ARM mode explicitly when on ARM Darwin
Jim Grosbach [Fri, 30 Oct 2009 21:33:05 +0000 (21:33 +0000)]
Build in ARM mode explicitly when on ARM Darwin

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

15 years agoAdd missing substitution for %llvmgcc_only.
Daniel Dunbar [Fri, 30 Oct 2009 21:13:59 +0000 (21:13 +0000)]
Add missing substitution for %llvmgcc_only.

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

15 years agoAllow cross target build
Jim Grosbach [Fri, 30 Oct 2009 20:54:59 +0000 (20:54 +0000)]
Allow cross target build

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

15 years agoFix a comment.
Bob Wilson [Fri, 30 Oct 2009 20:13:25 +0000 (20:13 +0000)]
Fix a comment.

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

15 years agoAdd option to createGVNPass to disable PRE.
Evan Cheng [Fri, 30 Oct 2009 20:12:24 +0000 (20:12 +0000)]
Add option to createGVNPass to disable PRE.

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

15 years agoI forgot to commit this test.
Evan Cheng [Fri, 30 Oct 2009 20:03:40 +0000 (20:03 +0000)]
I forgot to commit this test.

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

15 years agoWhen cross-building, the CFLAGS and CXXFLAGS are for the target, and don't
Jim Grosbach [Fri, 30 Oct 2009 19:53:38 +0000 (19:53 +0000)]
When cross-building, the CFLAGS and CXXFLAGS are for the target, and don't
apply to the build tools. If we want to allow build tool flags input, we
should have separate inputs (BUILD_CFLAGS and BUILD_CXXFLAGS, perhaps).

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

15 years agoRemove extraneous comment line
Jim Grosbach [Fri, 30 Oct 2009 19:52:05 +0000 (19:52 +0000)]
Remove extraneous comment line

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

15 years agoupdate name check for Apple style builds to be more permissive
Jim Grosbach [Fri, 30 Oct 2009 19:51:32 +0000 (19:51 +0000)]
update name check for Apple style builds to be more permissive

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

15 years agoStop the iterator in ValueLiveAt from potentially running off the end of the interval.
Lang Hames [Fri, 30 Oct 2009 18:12:09 +0000 (18:12 +0000)]
Stop the iterator in ValueLiveAt from potentially running off the end of the interval.

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

15 years agoThis fixes functions like
Rafael Espindola [Fri, 30 Oct 2009 14:33:14 +0000 (14:33 +0000)]
This fixes functions like

void f (int a1, int a2, int a3, int a4, int a5,...)

In ARMTargetLowering::LowerFormalArguments if the function has 4 or
more regular arguments we used to set VarArgsFrameIndex using an
offset of 0, which is only correct if the function has exactly 4
regular arguments.

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

15 years agoCMake: install .def files from source `include/llvm' directory.
Oscar Fuentes [Fri, 30 Oct 2009 11:42:08 +0000 (11:42 +0000)]
CMake: install .def files from source `include/llvm' directory.

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

15 years agoRather than having llvm-gcc changing the meaning of OptimizeSize, just make sure...
Evan Cheng [Fri, 30 Oct 2009 07:23:49 +0000 (07:23 +0000)]
Rather than having llvm-gcc changing the meaning of OptimizeSize, just make sure loop unswitch is conservative when optimization level is < 3.

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

15 years agoAdd ARM codegen for indirect branches.
Bob Wilson [Fri, 30 Oct 2009 05:45:42 +0000 (05:45 +0000)]
Add ARM codegen for indirect branches.
clang/test/CodeGen/indirect-goto.c runs! (unoptimized)

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

15 years agoMost stack straces don't need 3 digits worth of levels.
Dan Gohman [Fri, 30 Oct 2009 02:45:10 +0000 (02:45 +0000)]
Most stack straces don't need 3 digits worth of levels.

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

15 years agoDon't delete blocks which have their address taken.
Dan Gohman [Fri, 30 Oct 2009 02:13:27 +0000 (02:13 +0000)]
Don't delete blocks which have their address taken.

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

15 years agoMention if a block has its address taken in debug output.
Dan Gohman [Fri, 30 Oct 2009 02:08:26 +0000 (02:08 +0000)]
Mention if a block has its address taken in debug output.

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

15 years agoSimplify this code and avoid an extra space character in the output.
Dan Gohman [Fri, 30 Oct 2009 02:01:10 +0000 (02:01 +0000)]
Simplify this code and avoid an extra space character in the output.

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

15 years agoAdd support for BlockAddress static initializers.
Dan Gohman [Fri, 30 Oct 2009 01:45:18 +0000 (01:45 +0000)]
Add support for BlockAddress static initializers.

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

15 years agoAdd a FIXME comment.
Dan Gohman [Fri, 30 Oct 2009 01:38:20 +0000 (01:38 +0000)]
Add a FIXME comment.

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

15 years agoAdd some comments.
Dan Gohman [Fri, 30 Oct 2009 01:34:35 +0000 (01:34 +0000)]
Add some comments.

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

15 years agoInitial x86 support for BlockAddresses.
Dan Gohman [Fri, 30 Oct 2009 01:28:02 +0000 (01:28 +0000)]
Initial x86 support for BlockAddresses.

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

15 years agoInitial target-independent CodeGen support for BlockAddresses.
Dan Gohman [Fri, 30 Oct 2009 01:27:03 +0000 (01:27 +0000)]
Initial target-independent CodeGen support for BlockAddresses.

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

15 years agoRemove dead code.
Devang Patel [Fri, 30 Oct 2009 00:39:25 +0000 (00:39 +0000)]
Remove dead code.

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