Commit Graph

70895 Commits

Author SHA1 Message Date
Evan Cheng 1a4492be97 Fix a couple more places where we are creating ld / st instructions without memoperands.
llvm-svn: 85746
2009-11-01 22:04:35 +00:00
Evan Cheng 43219997b6 Make use of imm12 version of Thumb2 ldr / str instructions more aggressively.
llvm-svn: 85743
2009-11-01 21:12:51 +00:00
Chris Lattner ef94654363 fix two strange things in the default passmgr:
1. we'd run simplifycfg at the very start, even though
the per function passes have already cleaned this up.

2. In the main per-function pipeline that is interlaced with inlining 
   etc, we would do instcombine, jump threading, simplifycfg *before*
   doing SROA.  SROA is much more likely to expose opportunities for
   these passes than they are for SROA, so move SRoA up earlier.

also add some comments.

llvm-svn: 85742
2009-11-01 20:41:59 +00:00
Douglas Gregor 0840cc02ce When determining whether a reference to a static data member is an
integral constant expression, make sure to find where the initializer
was provided---inside or outside the class definition---since that can
affect whether we have an integral constant expression (and, we need
to see the initializer itself).

llvm-svn: 85741
2009-11-01 20:32:48 +00:00
Chris Lattner 3e6398baa5 merge phi-merge.ll into phi.ll
I don't know what Dan wants to do with phi-merge-gep.ll, I'll let
him deal with it because instcombine may end up sinking these.

llvm-svn: 85739
2009-11-01 20:10:11 +00:00
Chris Lattner 328ef89bd1 when merging two loads, make sure to take the min of their alignment,
not the max.  This didn't matter until the previous patch because
instcombine would refuse to sink loads with differenting alignments.

llvm-svn: 85738
2009-11-01 20:07:07 +00:00
Chris Lattner 2a249e267a split load sinking out to its own function, like gep sinking.
llvm-svn: 85737
2009-11-01 20:04:24 +00:00
Chris Lattner 0b40a8bc0e fix a bug noticed by inspection: when instcombine sinks loads through
phis, it didn't preserve the alignment of the load.  This is a missed
optimization of the alignment is high and a miscompilation when the
alignment is low.

llvm-svn: 85736
2009-11-01 19:50:13 +00:00
Chris Lattner 2805f116f6 IPSCCP apparently is not a superset of IPCP, this is bad,
but I'll investigate it separately.  This unbreaks 
test/FrontendC/weak_constant.c

llvm-svn: 85735
2009-11-01 19:29:12 +00:00
Chris Lattner d162b5c955 convert to filecheck.
llvm-svn: 85734
2009-11-01 19:22:20 +00:00
Duncan Sands f5e4342f45 Improve the other instance of the comment.
llvm-svn: 85733
2009-11-01 19:16:21 +00:00
Duncan Sands f25d301311 Add a missing closing parenthesis, and tweak to fit in 80
columns.

llvm-svn: 85732
2009-11-01 19:12:43 +00:00
Chris Lattner 649f4e9e8f only run GlobalDCE at -O3 and run it late instead of early.
GlobalOpt already deletes trivially dead functions/globals,
so GlobalDCE only adds values for cycles of dead things.

llvm-svn: 85731
2009-11-01 19:09:12 +00:00
Chris Lattner b5d9c8c708 cleanups, switch GlobalDCE to SmallPtrSet instead of std::set
llvm-svn: 85730
2009-11-01 19:03:42 +00:00
Chris Lattner 2fa61f8427 We currently only run ipsccp at LTO time, which is silly. It subsumes
ipconstprop and doesn't take much time.  Just run it in its place.

This adds a testcase for it, which I plan to expand to cover other
"integration" cases, where we expect the optimizer to be able to
eliminate various things.  Due to phase order issues we've regressed
in a number of areas and integration tests are the only way I see to
prevent this.

llvm-svn: 85729
2009-11-01 18:57:49 +00:00
Chris Lattner 37536b90e1 remove a bunch of locking from LLVMContextImpl. Since only one thread
can be banging on a context at a time, this isn't needed.  Owen, please
review.

llvm-svn: 85728
2009-11-01 18:42:03 +00:00
Edward O'Callaghan 683dcc63b1 Add DragonFly BSD to supported platforms list.
llvm-svn: 85727
2009-11-01 18:30:27 +00:00
Edward O'Callaghan a8fa825177 Fix DragonFly BSD define in compiler-rt.
llvm-svn: 85726
2009-11-01 18:25:55 +00:00
Chris Lattner 249f96e339 improve comment.
llvm-svn: 85725
2009-11-01 18:17:37 +00:00
Chris Lattner 1756673f58 add a comment about why we don't allow inlining indbr.
llvm-svn: 85724
2009-11-01 18:16:30 +00:00
Evan Cheng 50bc004b67 Fix tests.
llvm-svn: 85723
2009-11-01 18:13:29 +00:00
Chris Lattner 253bc77513 the verifier shouldn't modify the IR.
llvm-svn: 85722
2009-11-01 18:11:50 +00:00
Douglas Gregor 5897e097a6 Within a template, qualified name lookup can refer to a non-dependent type
that is not known to be a base class at template definition time due
to some dependent base class. Treat qualified name lookup that refers
to a non-static data member or function as implicit class member
access when the "this" type would be dependent.

llvm-svn: 85718
2009-11-01 17:08:18 +00:00
Douglas Gregor 291f6145b8 Reverting 85714, 85715, 85716, which are breaking the build
llvm-svn: 85717
2009-11-01 16:42:53 +00:00
Dan Gohman 2b12b95d5d Add a function to Passes.h to allow clients to create instances
of the ScalarEvolution pass without needing to #include ScalarEvolution.h.

llvm-svn: 85716
2009-11-01 15:28:36 +00:00
Dan Gohman b49c889d53 Don't #include Pass.h from CallGraph.h.
llvm-svn: 85715
2009-11-01 15:23:35 +00:00
Dan Gohman 576ac96367 Remove the #include of Pass.h from PassManager.h. This breaks a significant
#include dependency, as frontends commonly pull in PassManager.h.

llvm-svn: 85714
2009-11-01 15:20:19 +00:00
Chris Lattner 1a8b80ed5a 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.

llvm-svn: 85709
2009-11-01 06:11:53 +00:00
Chris Lattner a1dc101f66 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.

llvm-svn: 85708
2009-11-01 04:57:33 +00:00
Chris Lattner 746139b736 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.

llvm-svn: 85707
2009-11-01 04:23:20 +00:00
Chris Lattner 274717419c fix an issue where the verifier would reject a function whose entry
block had its address taken even if the blockaddress was dead.

llvm-svn: 85706
2009-11-01 04:08:01 +00:00
Chris Lattner 7a8db3a41a if CostMetrics says to never duplicate some code, don't unswitch a loop.
This prevents unswitching from duplicating indbr's.

llvm-svn: 85705
2009-11-01 03:42:55 +00:00
Chris Lattner 54a4b84012 constant fold indirectbr(blockaddress(%bb)) -> br label %bb.
llvm-svn: 85704
2009-11-01 03:40:38 +00:00
Chris Lattner 50ba5c3dc2 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.

llvm-svn: 85703
2009-11-01 03:25:03 +00:00
Chris Lattner 4578f8ea07 pull check for return inst out of loop, never inline a callee that contains
an indirectbr.

llvm-svn: 85702
2009-11-01 03:07:53 +00:00
Chris Lattner c559a9f686 Fix BlockAddress::replaceUsesOfWithOnConstant to correctly
maintain the block use count in SubclassData.

llvm-svn: 85701
2009-11-01 03:03:03 +00:00
Chris Lattner 140a754ab2 implement linker support for BlockAddress.
llvm-svn: 85700
2009-11-01 02:46:39 +00:00
Chris Lattner aa99c94e2a 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.

llvm-svn: 85699
2009-11-01 01:27:45 +00:00
Evan Cheng 6f29ad9170 Use cbz and cbnz instructions.
llvm-svn: 85698
2009-10-31 23:46:45 +00:00
Jim Grosbach 5cba8de2c8 vml[as].f32 cause stalls in following advanced SIMD instructions. Avoid using
them for scalar floating point operations for now.

llvm-svn: 85697
2009-10-31 22:57:36 +00:00
Jim Grosbach 403202aef1 Consolidate test files
llvm-svn: 85696
2009-10-31 22:20:56 +00:00
Jim Grosbach c79fb530d4 Change to use FileCheck
llvm-svn: 85695
2009-10-31 22:16:14 +00:00
Jim Grosbach 69f364babc Make tests more explicit about which instructions are expected.
llvm-svn: 85694
2009-10-31 22:14:17 +00:00
Jim Grosbach 259c37cc55 Grammar tweak to comments
llvm-svn: 85693
2009-10-31 22:12:44 +00:00
Chris Lattner a546dcf418 Make sure PRE doesn't split crit edges from indirectbr.
llvm-svn: 85692
2009-10-31 22:11:15 +00:00
Jim Grosbach 2c3e618a06 Update test to be more explicit about what instruction sequences are expected for each operation.
llvm-svn: 85691
2009-10-31 22:10:38 +00:00
Chris Lattner c872b09676 llvm::SplitEdge should refuse to split an edge from an indirectbr.
Fix CodeGenPrepare to not try to split edges from indirectbr.

llvm-svn: 85690
2009-10-31 22:04:43 +00:00
Jim Grosbach 0de95af62d Update test to be more explicit about what instruction sequences are expected for each operation.
llvm-svn: 85689
2009-10-31 21:52:58 +00:00
Chris Lattner ba364b0a9a update the comment above llvm::SplitCriticalEdge, and make
it abort on IndirectBrInst as describe in the comment.

llvm-svn: 85688
2009-10-31 21:51:10 +00:00
Jim Grosbach 8fe6fd702d Expand 64-bit logical shift right inline
llvm-svn: 85687
2009-10-31 21:42:19 +00:00