1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
Commit Graph

34344 Commits

Author SHA1 Message Date
Evan Cheng
d4f8c9fee2 Teach tail duplication to update SSA form. Work in progress.
llvm-svn: 90432
2009-12-03 08:43:53 +00:00
Chris Lattner
b46655e25c expand note.
llvm-svn: 90429
2009-12-03 07:43:46 +00:00
Chris Lattner
6b86618a2b add a note
llvm-svn: 90428
2009-12-03 07:41:54 +00:00
Nate Begeman
3a9c51f256 Don't pull vector sext through both hands of a logical operation, since doing so prevents the fusion of vector sext and setcc into vsetcc.
Add a testcase for the above transformation.
Fix a bogus use of APInt noticed while tracking this down.

llvm-svn: 90423
2009-12-03 07:11:29 +00:00
Chris Lattner
b3cc713378 fix a build problem with VC++, PR5664, patch by Alp Toker!
llvm-svn: 90419
2009-12-03 06:58:32 +00:00
Bob Wilson
b53c801366 Recognize canonical forms of vector shuffles where the same vector is used for
both source operands.  In the canonical form, the 2nd operand is changed to an
undef and the shuffle mask is adjusted to only reference elements from the 1st
operand.  Radar 7434842.

llvm-svn: 90417
2009-12-03 06:40:55 +00:00
Jakob Stoklund Olesen
c4ee94503f Don't call getValueType() on a null SDValue
llvm-svn: 90415
2009-12-03 05:15:35 +00:00
Owen Anderson
251cb28a25 Fix this crasher, and add a FIXME for a missed optimization.
llvm-svn: 90408
2009-12-03 03:43:29 +00:00
Evan Cheng
1c3edb4fa8 Fill out codegen SSA updater. It's not yet tested.
llvm-svn: 90395
2009-12-03 02:31:43 +00:00
Bill Wendling
4dbdfa814e Revert r90371. It was causing build failures.
llvm-svn: 90383
2009-12-03 01:54:07 +00:00
Jakob Stoklund Olesen
6772f75d4d Don't hang on to pointers or references after vector::push_back.
The MO reference to a MachineOperand can be invalidated by
MachineInstr::addOperand. Don't even use it for debugging.

llvm-svn: 90381
2009-12-03 01:49:56 +00:00
Devang Patel
45a72a7032 Emit method definition DIE at module level (even for methods with inlined functino body at soure level) so that the debugger can invoke it. This fixes many test failures in gdb test suite.
llvm-svn: 90375
2009-12-03 01:25:38 +00:00
Bill Wendling
b01be4b16d Further improvements: refactoring code that does the same thing into one
function, converting "dyn_cast" to "cast", asserting the correct things, and
other general cleanups.

llvm-svn: 90371
2009-12-03 01:15:46 +00:00
Chris Lattner
29e2e60be6 yay for case insensitive file systems (?)
llvm-svn: 90370
2009-12-03 01:10:05 +00:00
Chris Lattner
851aea6ce2 fix PR5673 by being more careful about pointers to functions.
llvm-svn: 90369
2009-12-03 01:05:45 +00:00
Chris Lattner
09df97d257 remove some dead std::ostream using code.
llvm-svn: 90366
2009-12-03 00:55:04 +00:00
Chris Lattner
9ce833945e improve portability to avoid conflicting with std::next in c++'0x.
Patch by Howard Hinnant!

llvm-svn: 90365
2009-12-03 00:50:42 +00:00
Bill Wendling
db54e8c67c This initial code is meant to convert TargetData to use an AbstractTypesUser so
that it doesn't have dangling pointers when abstract types are resolved. This
modifies it somewhat to address comments: making the "StructLayoutMap" an
anonymous structure, calling "removeAbstractTypeUser" when appropriate, and
adding asserts where helpful.

llvm-svn: 90362
2009-12-03 00:17:12 +00:00
Douglas Gregor
7416e5586f Fix CMake makefiles
llvm-svn: 90354
2009-12-02 22:19:31 +00:00
Evan Cheng
e573096db2 Skeleton for MachineInstr level SSA updater.
llvm-svn: 90353
2009-12-02 22:02:52 +00:00
Jim Grosbach
230025f501 Add MaxStackAlignment.cpp to CMake
llvm-svn: 90337
2009-12-02 19:31:07 +00:00
Jim Grosbach
0e1230b23b Factor the stack alignment calculations out into a target independent pass.
No functionality change.

llvm-svn: 90336
2009-12-02 19:30:24 +00:00
Bob Wilson
adb1889175 Don't count PHI instructions toward the limit for tail duplicating a block.
llvm-svn: 90326
2009-12-02 17:15:24 +00:00
Jim Grosbach
ccb304105a Move EliminateDuplicatePHINodes() from SimplifyCFG.cpp to Local.cpp
llvm-svn: 90324
2009-12-02 17:06:45 +00:00
Andreas Neustifter
e70972f8d5 Cheap, mostly strict, stable sorting.
This is necessary for tests so the results are comparable.

llvm-svn: 90320
2009-12-02 15:57:15 +00:00
Benjamin Kramer
65c962b3aa Silence compiler warnings.
llvm-svn: 90319
2009-12-02 15:33:44 +00:00
Devang Patel
6f4a280987 Clarify that DIEString does not keep a copy of the string.
llvm-svn: 90318
2009-12-02 15:25:16 +00:00
Owen Anderson
f47cde694f Cleanup/remove some parts of the lifetime region handling code in memdep and GVN,
per Chris' comments.  Adjust testcases to match.

llvm-svn: 90304
2009-12-02 07:35:19 +00:00
Chris Lattner
b541c63e60 factor some code better.
llvm-svn: 90299
2009-12-02 06:44:58 +00:00
Chris Lattner
90aff65316 formatting cleanups.
llvm-svn: 90298
2009-12-02 06:35:55 +00:00
Chris Lattner
cb2c4e9f42 tidy up, remove dependence on order of evaluation of function args from EmitMemCpy.
llvm-svn: 90297
2009-12-02 06:05:42 +00:00
Mon P Wang
91ac05d480 Fixed an assertion failure for tracking sext of a vector of integers
llvm-svn: 90290
2009-12-02 04:59:58 +00:00
Devang Patel
122acaf238 Add utility routine to create subprogram definition entry from subprogram declaration entry.
llvm-svn: 90282
2009-12-01 23:09:02 +00:00
Devang Patel
190698f233 Reuse existing subprogram DIE.
llvm-svn: 90281
2009-12-01 23:07:59 +00:00
Chris Lattner
bd9a13086f return more useful error messages by using strerror to format errno
instead of returning an ambiguous reason.

llvm-svn: 90275
2009-12-01 22:51:41 +00:00
Evan Cheng
0c687845b1 Fix PR5391: support early clobber physical register def tied with a use (ewwww)
- A valno should be set HasRedefByEC if there is an early clobber def in the middle of its live ranges. It should not be set if the def of the valno is defined by an early clobber.
- If a physical register def is tied to an use and it's an early clobber, it just means the HasRedefByEC is set since it's still one continuous live range.
- Add a couple of missing checks for HasRedefByEC in the coalescer. In general, it should not coalesce a vr with a physical register if the physical register has a early clobber def somewhere. This is overly conservative but that's the price for using such a nasty inline asm "feature".

llvm-svn: 90269
2009-12-01 22:25:00 +00:00
Chris Lattner
cb2e2bd645 rename some variables.
llvm-svn: 90258
2009-12-01 21:16:01 +00:00
Chris Lattner
9cd2498f45 tidy
llvm-svn: 90257
2009-12-01 21:15:15 +00:00
Dan Gohman
3f4d608e3c Add edge source labels to SelectionDAG graphs, now that the graph printing
framework omits differentiated edge sources in the case where the labels
are empty strings.

llvm-svn: 90254
2009-12-01 19:20:00 +00:00
Dan Gohman
78e1e2806c Minor cleanups.
llvm-svn: 90253
2009-12-01 19:16:15 +00:00
Dan Gohman
58675165bb Trim an unnecessary #include.
llvm-svn: 90252
2009-12-01 19:13:27 +00:00
Devang Patel
45858cdfe6 Clear function specific containers while processing end of a function, even if DW_TAG_subprogram for current function is not found.
llvm-svn: 90247
2009-12-01 18:13:48 +00:00
Jim Grosbach
5541b5f793 Thumb1 exception handling setjmp
llvm-svn: 90246
2009-12-01 18:10:36 +00:00
Johnny Chen
e3171163da For VLDM/VSTM (Advanced SIMD), set encoding bits Inst{11-8} to 0b1011.
llvm-svn: 90243
2009-12-01 17:37:06 +00:00
Jakob Stoklund Olesen
2b50f038b1 Move PHIElimination::isLiveOut method to LiveVariables.
We want LiveVariables clients to use methods rather than accessing the
getVarInfo data structure directly. That way it will be possible to change the
LiveVariables representation.

llvm-svn: 90240
2009-12-01 17:13:31 +00:00
Chris Lattner
d576951cec fix 255.vortex again, third time's the charm.
llvm-svn: 90217
2009-12-01 07:33:32 +00:00
Chris Lattner
7c0c90df97 fix PR5640 by tracking whether a block is the header of a loop more
precisely, which prevents us from infinitely peeling the loop.

llvm-svn: 90211
2009-12-01 06:04:43 +00:00
Jakob Stoklund Olesen
f07d6129a2 Use CFG connectedness as a secondary sort key when deciding the order of copy coalescing.
This means that well connected blocks are copy coalesced before the less connected blocks. Connected blocks are more difficult to
coalesce because intervals are more complicated, so handling them first gives a greater chance of success.

llvm-svn: 90194
2009-12-01 03:03:00 +00:00
Dan Gohman
dc068e9517 Devang pointed out that this code should use DIScope instead of
DICompileUnit. This code now prints debug filenames successfully.

llvm-svn: 90181
2009-12-01 00:45:56 +00:00
Evan Cheng
fcbc30f36e Fix PR5614: parts of a physical register def may be killed the rest.
llvm-svn: 90180
2009-12-01 00:44:45 +00:00
Johnny Chen
7f7f23087c For VMOV (immediate), make some of the encoding bits (cmode and op) unspecified.
For VMOVv*i[16,32], op bit is don't care, and some cmode bits vary depending on
the immediate values.

Ref: Table A7-15 Modified immediate values for Advanced SIMD instructions.
llvm-svn: 90173
2009-12-01 00:02:02 +00:00
Devang Patel
aca7704897 If pointer type has a name then do not ignore the name.
llvm-svn: 90172
2009-11-30 23:56:56 +00:00
Dan Gohman
e573c59c90 Minor whitespace fixes.
llvm-svn: 90166
2009-11-30 23:33:53 +00:00
Dan Gohman
af05157fde Fix a minor inconsistency.
llvm-svn: 90165
2009-11-30 23:33:37 +00:00
Jakob Stoklund Olesen
ce2743a619 New virtual registers created for spill intervals should inherit allocation hints from the original register.
This helps us avoid silly copies when rematting values that are copied to a physical register:

leaq	_.str44(%rip), %rcx
movq	%rcx, %rsi
call	_strcmp

becomes:

leaq	_.str44(%rip), %rsi
call	_strcmp

The coalescer will not touch the movq because that would tie down the physical register.

llvm-svn: 90163
2009-11-30 22:55:54 +00:00
Bob Wilson
a71b008477 Reprioritize tests for tail duplication to be aggressive about indirect
branches even when optimizing for code size.  Unless we find evidence to the
contrary in the future, the special treatment for indirect branches does not
have a significant effect on code size, and performance still matters with -Os.

llvm-svn: 90147
2009-11-30 18:56:45 +00:00
Bob Wilson
b293fe32cb Remove isProfitableToDuplicateIndirectBranch target hook. It is profitable
for all the processors where I have tried it, and even when it might not help
performance, the cost is quite low.  The opportunities for duplicating
indirect branches are limited by other factors so code size does not change
much due to tail duplicating indirect branches aggressively.

llvm-svn: 90144
2009-11-30 18:35:03 +00:00
Bob Wilson
f893a19df9 Fix some more ARM unified syntax warnings.
llvm-svn: 90141
2009-11-30 17:47:19 +00:00
Tobias Grosser
bc1905d14d Fix last DOTGraphTraits problems in CompilationGraph.
llvm-svn: 90136
2009-11-30 13:34:51 +00:00
Tobias Grosser
246c05c351 Remove forgotten ShortNames in Trie and CompilationGraph
llvm-svn: 90135
2009-11-30 13:14:13 +00:00
Tobias Grosser
74c7605daf Remove ShortNames from getNodeLabel in DOTGraphTraits
llvm-svn: 90134
2009-11-30 12:38:47 +00:00
Tobias Grosser
48d8ba7043 Instantiate DefaultDOTGraphTraits
llvm-svn: 90133
2009-11-30 12:38:13 +00:00
Tobias Grosser
38b3077d08 Small PostDominatorTree improvements
* Do not SEGFAULT if tree entryNode() is NULL
 * Print function names in dotty printer

llvm-svn: 90130
2009-11-30 12:06:37 +00:00
Nick Lewycky
81fea1665b Revert r90107, fixing test/Transforms/GVN/2009-11-29-ReverseMap.ll and the
llvm-gcc build.

llvm-svn: 90113
2009-11-30 07:05:51 +00:00
Mon P Wang
27bce4e285 Added support to allow clients to custom widen. For X86, custom widen vectors for
divide/remainder since these operations can trap by unroll them and adding undefs
for the resulting vector.

llvm-svn: 90108
2009-11-30 02:42:02 +00:00
Chris Lattner
dd895d559f reapply r90093 with an addition of keeping the forward
and reverse nonlocal memdep maps in synch, this should
fix 255.vortex.

llvm-svn: 90107
2009-11-30 02:26:29 +00:00
Nick Lewycky
116b145b02 Teach ConstantFolding to do a better job when folding gep(bitcast).
This permits the devirtualization of llvm.org/PR3100#c9 when compiled by clang.

llvm-svn: 90099
2009-11-29 21:40:55 +00:00
Benjamin Kramer
d9780ec7c5 Revert r90089 for now, it's breaking selfhost.
llvm-svn: 90097
2009-11-29 21:17:48 +00:00
Chris Lattner
de1d55c200 revert this patch for now, it causes failures of:
LLVM::Transforms/GVN/2009-02-17-LoadPRECrash.ll
    LLVM::Transforms/GVN/2009-06-17-InvalidPRE.ll

llvm-svn: 90096
2009-11-29 21:14:59 +00:00
Chris Lattner
6155ce3427 Fix a really nasty caching bug I introduced in memdep. An entry
was being added to the Result vector, but not being put in the
cache.  This means that if the cache was reused wholesale for a
later query that it would be missing this entry and we'd do an
incorrect load elimination.

Unfortunately, it's not really possible to write a useful 
testcase for this, but this unbreaks 255.vortex.

llvm-svn: 90093
2009-11-29 21:09:36 +00:00
Benjamin Kramer
a1d24b5a8d Fix two FIXMEs.
llvm-svn: 90089
2009-11-29 20:29:30 +00:00
Nick Lewycky
2c7105b098 Detabify.
llvm-svn: 90085
2009-11-29 18:10:39 +00:00
Benjamin Kramer
34f2bcd0ae Remove dead returns.
llvm-svn: 90083
2009-11-29 17:42:58 +00:00
Kovarththanan Rajaratnam
435a9894a7 This patch ensures that Path::GetMainExecutable is able to handle the
case where realpath() fails. When this occurs we segfault trying to
create a std::string from a NULL pointer.

Fixes PR5635.

llvm-svn: 90082
2009-11-29 17:19:48 +00:00
Chris Lattner
cd6fed25d5 add testcases for the foo_with_overflow op xforms added recently and
fix bugs exposed by the tests.  Testcases from Alastair Lynn!

llvm-svn: 90056
2009-11-29 02:57:29 +00:00
Chris Lattner
40d74cea6b update and consolidate the load pre notes.
llvm-svn: 90050
2009-11-29 02:19:52 +00:00
Chris Lattner
d48ff7ea6a Implement PR5634.
llvm-svn: 90046
2009-11-29 00:51:17 +00:00
Nick Lewycky
ff44d9d88a Teach memdep to look for memory use intrinsics during dependency queries. Fixes
PR5574.

llvm-svn: 90045
2009-11-28 21:27:49 +00:00
Chris Lattner
83284453a1 reenable load address insertion in load pre. This allows us to
handle cases like this:
void test(int N, double* G) {
  long j;
  for (j = 1; j < N - 1; j++)
      G[j+1] = G[j] + G[j+1];
}

where G[1] isn't live into the loop.

llvm-svn: 90041
2009-11-28 16:08:18 +00:00
Chris Lattner
f8d8142a06 Enhance InsertPHITranslatedPointer to be able to return a list of newly
inserted instructions.  No functionality change until someone starts using it.

llvm-svn: 90039
2009-11-28 15:39:14 +00:00
Chris Lattner
f825d5d176 implement a FIXME: limit the depth that DecomposeGEPExpression goes the same
way that getUnderlyingObject does it. 

This fixes the 'DecomposeGEPExpression and getUnderlyingObject disagree!' 
assertion on sqlite3.

llvm-svn: 90038
2009-11-28 15:12:41 +00:00
Chris Lattner
2e5340d0dc enable code to handle un-phi-translatable cases more aggressively:
if we don't have an address expression available in a predecessor,
then model this as the value being clobbered at the end of the pred
block instead of being modeled as a complete phi translation failure.
This is important for PRE of loads because we want to see that the
load is available in all but this predecessor, and complete phi
translation failure results in not getting any information about
predecessors.

This doesn't do anything until I renable code insertion since PRE
now sees that it is available in all but one predecessors, but can't
insert the addressing in the predecessor that is missing it to 
eliminate the redundancy.

llvm-svn: 90037
2009-11-28 14:54:10 +00:00
Chris Lattner
f3e5cbfc99 disable value insertion for now, I need to figure out how
to inform GVN about the newly inserted values.  This fixes 
PR5631.

llvm-svn: 90022
2009-11-27 22:50:07 +00:00
Chris Lattner
73b425ba51 Rework InsertPHITranslatedPointer to handle the recursive case, this
fixes PR5630 and sets the stage for the next phase of goodness (testcase
pending).

llvm-svn: 90019
2009-11-27 22:05:15 +00:00
Chris Lattner
473e8af336 recursively phi translate bitcast operands too, for consistency.
llvm-svn: 90016
2009-11-27 20:25:30 +00:00
Nick Lewycky
44573bb42b Oops! Fix bug introduced in my recent cleanup change. Thanks to Tobias Grosser
for pointing this out.

llvm-svn: 90015
2009-11-27 19:57:53 +00:00
Chris Lattner
b1fceb6006 add support for recursive phi translation and phi
translation of add with immediate.  This allows us
to optimize this function:

void test(int N, double* G) {
  long j;
  G[1] = 1;
    for (j = 1; j < N - 1; j++)
        G[j+1] = G[j] + G[j+1];
}

to only do one load every iteration of the loop.

llvm-svn: 90013
2009-11-27 19:11:31 +00:00
Chris Lattner
bdaed088ea factor some logic out of instcombine into a new SimplifyAddInst method.
llvm-svn: 90011
2009-11-27 17:42:22 +00:00
Chris Lattner
0df78ea645 add a deadargelim note.
llvm-svn: 90009
2009-11-27 17:12:30 +00:00
Chris Lattner
c0b92ff385 This testcase is actually only partially redundant, and requires
the FIXME I added yesterday to be implemented.

llvm-svn: 90008
2009-11-27 16:53:57 +00:00
Chris Lattner
cdfa9dadf1 fix PR5436 by making the 'simple' case of SRoA not promote out of range
array indexes.  The "complex" case of SRoA still handles them, and correctly.

This fixes a weirdness where we'd correctly avoid transforming A[0][42] if
the 42 was too large, but we'd only do it if it was one gep, not two separate
ones.

llvm-svn: 90007
2009-11-27 16:37:41 +00:00
Chris Lattner
c81be8ddba add comment.
llvm-svn: 90002
2009-11-27 08:40:14 +00:00
Chris Lattner
af321b5729 reduce nesting, no functionality change.
llvm-svn: 90001
2009-11-27 08:37:22 +00:00
Chris Lattner
e7056c8cde limit the recursion depth of GetLinearExpression. This
fixes a crash analyzing consumer-lame, which had an "%X = add %X, 1"
in unreachable code.

llvm-svn: 90000
2009-11-27 08:32:52 +00:00
Chris Lattner
a466dbe80a teach GVN's load PRE to insert computations of the address in predecessors
where it is not available.  It's unclear how to get this inserted 
computation into GVN's scalar availability sets, Owen, help? :)

llvm-svn: 89997
2009-11-27 08:25:10 +00:00
Chris Lattner
0971e6da1f Fix phi translation in load PRE to agree with the phi
translation done by memdep, and reenable gep translation 
again.

llvm-svn: 89992
2009-11-27 06:31:14 +00:00
Chris Lattner
16ee3226ce redisable this, my bootstrap worked because it wasn't an optimized build, whoops.
llvm-svn: 89991
2009-11-27 05:53:01 +00:00
Chris Lattner
ea3b1f2186 try again.
llvm-svn: 89990
2009-11-27 05:19:56 +00:00
Chris Lattner
895214c65e this is causing buildbot failures, disable for now.
llvm-svn: 89985
2009-11-27 01:52:22 +00:00
Chris Lattner
225a88f4ab this (and probably several others) are now done.
llvm-svn: 89982
2009-11-27 00:35:04 +00:00
Chris Lattner
02ffb0a608 teach phi translation of GEPs to simplify geps like 'gep x, 0'.
This allows us to compile the example from PR5313 into:

LBB1_2:                                                     ## %bb
	incl	%ecx
	movb	%al, (%rsi)
	movslq	%ecx, %rax
	movb	(%rdi,%rax), %al
	testb	%al, %al
	jne	LBB1_2

instead of:

LBB1_2:                                                     ## %bb
	movslq	%eax, %rcx
	incl	%eax
	movb	(%rdi,%rcx), %cl
	movb	%cl, (%rsi)
	movslq	%eax, %rcx
	cmpb	$0, (%rdi,%rcx)
	jne	LBB1_2

llvm-svn: 89981
2009-11-27 00:34:38 +00:00
Chris Lattner
6611a6f733 factor some instcombine simplifications for getelementptr out to a new
SimplifyGEPInst method in InstructionSimplify.h.  No functionality change.

llvm-svn: 89980
2009-11-27 00:29:05 +00:00
Chris Lattner
4810fa619f teach memdep to do trivial PHI translation of GEPs. More to
come.

llvm-svn: 89979
2009-11-27 00:07:37 +00:00
Chris Lattner
4824ebfded Teach memdep to phi translate bitcasts. This allows us to compile
the example in GCC PR16799 to:

LBB1_2:                                                     ## %bb1
	movl	%eax, %eax
	subq	%rax, %rdi
	movq	%rdi, (%rcx)
	movl	(%rdi), %eax
	testl	%eax, %eax
	je	LBB1_2

instead of:

LBB1_2:                                                     ## %bb1
	movl	(%rdi), %ecx
	subq	%rcx, %rdi
	movq	%rdi, (%rax)
	cmpl	$0, (%rdi)
	je	LBB1_2

llvm-svn: 89978
2009-11-26 23:41:07 +00:00
Nick Lewycky
c0a516186a Fix typo spotted by Gabor Greif.
llvm-svn: 89976
2009-11-26 23:19:05 +00:00
Chris Lattner
5020bb83d7 factor some code out into some helper functions.
llvm-svn: 89975
2009-11-26 23:18:49 +00:00
Nick Lewycky
07c3eb54a4 Clean up file, no functionality change.
llvm-svn: 89974
2009-11-26 22:54:26 +00:00
Chris Lattner
15482aa384 Add a hack for PR5601, a crash on obsolete syntax that we plan to
remove in LLVM 3.0

llvm-svn: 89973
2009-11-26 22:48:23 +00:00
Chris Lattner
e949f49b23 fix crash on Transforms/InstCombine/intrinsics.ll introduced by r89970
llvm-svn: 89972
2009-11-26 22:08:06 +00:00
Chris Lattner
cf7665b0c8 Fix PR5471 by removing an instcombine xform. Some pieces of the code
generates store to undef and some generates store to null as the idiom
for undefined behavior.  Since simplifycfg zaps both, don't remove the
undefined behavior in instcombine.

llvm-svn: 89971
2009-11-26 22:04:42 +00:00
Chris Lattner
08e20f453d implement a bunch of xforms for overflow intrinsics, based on a patch
by Alastair Lynn.

llvm-svn: 89970
2009-11-26 21:42:47 +00:00
Bob Wilson
c029183683 Rename new TailDuplicationPass to avoid name conflict with the old one.
llvm-svn: 89968
2009-11-26 21:38:41 +00:00
Chris Lattner
ce573daf09 Implement PR1143 (at -m64) by making basicaa look through extensions. We
previously already handled it at -m32 because there were no i32->i64 
extensions for addressing.

llvm-svn: 89959
2009-11-26 18:53:33 +00:00
Chris Lattner
a403a7eddc fix two transposed lines duncan caught and add an explanatory comment.
llvm-svn: 89958
2009-11-26 18:35:46 +00:00
Chris Lattner
f7a0da351e this todo is resolved.
llvm-svn: 89957
2009-11-26 17:14:10 +00:00
Chris Lattner
2178a80b90 move DecomposeGEPExpression out into ValueTracking.cpp
llvm-svn: 89956
2009-11-26 17:12:50 +00:00
Chris Lattner
d86a693b70 teach GetLinearExpression to be a bit more aggressive.
llvm-svn: 89955
2009-11-26 17:00:01 +00:00
Chris Lattner
62a36a703c resolve a fixme. I haven't figured out how to write a testcase
to exercise this though.

llvm-svn: 89954
2009-11-26 16:52:32 +00:00
Chris Lattner
9c88c96b3f Teach basicaa that x|c == x+c when the c bits of x are clear. This
allows us to compile the example in readme.txt into:

LBB1_1:                                                     ## %bb
	movl	4(%rdx,%rax), %ecx
	movl	%ecx, %esi
	imull	(%rdx,%rax), %esi
	imull	%esi, %ecx
	movl	%esi, 8(%rdx,%rax)
	imull	%ecx, %esi
	movl	%ecx, 12(%rdx,%rax)
	movl	%esi, 16(%rdx,%rax)
	imull	%ecx, %esi
	movl	%esi, 20(%rdx,%rax)
	addq	$16, %rax
	cmpq	$4000, %rax
	jne	LBB1_1

instead of:

LBB1_1: 
	movl	(%rdx,%rax), %ecx
	imull	4(%rdx,%rax), %ecx
	movl	%ecx, 8(%rdx,%rax)
	imull	4(%rdx,%rax), %ecx
	movl	%ecx, 12(%rdx,%rax)
	imull	8(%rdx,%rax), %ecx
	movl	%ecx, 16(%rdx,%rax)
	imull	12(%rdx,%rax), %ecx
	movl	%ecx, 20(%rdx,%rax)
	addq	$16, %rax
	cmpq	$4000, %rax
	jne	LBB1_1

GCC (4.2) doesn't seem to be able to eliminate the loads in this 
testcase either, it generates:

L2:
	movl	(%rdx), %eax
	imull	4(%rdx), %eax
	movl	%eax, 8(%rdx)
	imull	4(%rdx), %eax
	movl	%eax, 12(%rdx)
	imull	8(%rdx), %eax
	movl	%eax, 16(%rdx)
	imull	12(%rdx), %eax
	movl	%eax, 20(%rdx)
	addl	$4, %ecx
	addq	$16, %rdx
	cmpl	$1002, %ecx
	jne	L2

llvm-svn: 89952
2009-11-26 16:26:43 +00:00
Chris Lattner
677b93d4c8 teach basicaa that A[i] != A[i+1].
llvm-svn: 89951
2009-11-26 16:18:10 +00:00
Chris Lattner
69e59e50f3 Change the other half of aliasGEP (which handles GEP differencing) to use DecomposeGEPExpression. This dramatically simplifies and shrinks the code by eliminating the horrible CheckGEPInstructions method, fixes a miscompilation (@test3) and makes the code more aggressive. In particular, we now handle the @test4 case, which is reduced from the SmallPtrSet constructor. Missing this caused us to emit a variable length memset instead of a fixed size one.
llvm-svn: 89922
2009-11-26 02:17:34 +00:00
Chris Lattner
bd90980add Generalize DecomposeGEPExpression to exactly handle what Value::getUnderlyingObject does (when TD is around). This allows us to avoid calling DecomposeGEPExpression unless the ultimate alias check we care about passes, speedup up BasicAA a bit.
llvm-svn: 89920
2009-11-26 02:14:59 +00:00
Chris Lattner
57bca7101d Implement a new DecomposeGEPExpression method, which decomposes a GEP into a list of scaled offsets. Use this to eliminate some previous ad-hoc code which was subtly broken (it assumed all Constant*'s were non-zero, but strange constant express could be zero).
llvm-svn: 89915
2009-11-26 02:13:03 +00:00
Chris Lattner
260350330e Use GEPOperator more pervasively to simplify code.
llvm-svn: 89914
2009-11-26 02:11:08 +00:00
Chris Lattner
0b862edca3 update some notes slightly
llvm-svn: 89913
2009-11-26 01:51:18 +00:00
Chris Lattner
9646ffc9a2 remove some redundant braces
llvm-svn: 89912
2009-11-26 01:50:12 +00:00
Evan Cheng
82b29e816e When all defs of a vr are implicit_def, delete all of the defs.
llvm-svn: 89905
2009-11-26 00:32:36 +00:00
Bob Wilson
de012efdba Split tail duplication into a separate pass. This is needed to avoid
running tail duplication when doing branch folding for if-conversion, and
we also want to be able to run tail duplication earlier to fix some
reg alloc problems.  Move the CanFallThrough function from BranchFolding
to MachineBasicBlock so that it can be shared by TailDuplication.

llvm-svn: 89904
2009-11-26 00:32:21 +00:00
Viktor Kutuzov
c0799914a1 Rollback changes r89516: Added two SubtargetFeatures::AddFeatures methods, which accept a comma-separated string or already parsed command line parameters as input, and some code re-factoring to use these new methods.
llvm-svn: 89893
2009-11-25 22:44:18 +00:00
Evan Cheng
bdedf32e51 ProcessImplicitDefs should watch out for invalidated iterator and extra implicit operands on copies.
llvm-svn: 89880
2009-11-25 21:13:39 +00:00
Bob Wilson
b1cce5329e Tail duplicate indirect branches for PowerPC, too.
With the testcase for pr3120, the "threaded interpreter" runtime decreases
from 1788 to 1413 with this change.

llvm-svn: 89877
2009-11-25 19:57:14 +00:00
Benjamin Kramer
fbac37018a Avoid some possibly unsafe uses of StringRef::data().
llvm-svn: 89873
2009-11-25 18:26:09 +00:00
Devang Patel
d50fc13c19 Use StringRef (again) in DebugInfo interface.
llvm-svn: 89866
2009-11-25 17:36:49 +00:00
Bob Wilson
aee7a9e676 Based on the testcase for pr3120, running on my MacPro with Xeon processors,
it is definitely profitable to tail duplicate indirect branches for x86.
This is likely to be true to various degrees for all modern x86 processors.

llvm-svn: 89865
2009-11-25 17:27:53 +00:00
Bruno Cardoso Lopes
038281c523 Support PIC loading of constant pool entries
llvm-svn: 89863
2009-11-25 12:17:58 +00:00
Daniel Dunbar
ffe6484b7c Sketch structure for X86 disassembler.
llvm-svn: 89850
2009-11-25 06:53:08 +00:00
Edward O'Callaghan
43864a3136 API change Path::isSpecialFile to Path::isRegularFile, improve semantics in regards to comments from 89765 post review.
llvm-svn: 89848
2009-11-25 06:32:19 +00:00
Douglas Gregor
2cb3662a53 Perform explicit instantiations in the proper namespace, since Clang diagnoses this ill-formity.
llvm-svn: 89846
2009-11-25 06:04:18 +00:00
Edward O'Callaghan
4b197b8908 Reverting patch in revision 89758, initial attempt at fixing PR5373 has proven to be bogus.
llvm-svn: 89844
2009-11-25 05:38:41 +00:00
Bruno Cardoso Lopes
974ab18d0e Use endianess dependent offsets for load/store of doubles when
using two swc/lwc instead of sdc/ldc.

llvm-svn: 89826
2009-11-25 01:05:25 +00:00
Dale Johannesen
916d90c926 Fix compiler warnings.
llvm-svn: 89824
2009-11-25 00:58:21 +00:00
Bruno Cardoso Lopes
6d23fc8097 Only include in the callee saved regs the sub registers to avoid
unnecessary save/restore.

llvm-svn: 89823
2009-11-25 00:47:43 +00:00
Bruno Cardoso Lopes
7316c984a5 Add proper emission of load/store double to stack slots for mips1 targets!
llvm-svn: 89821
2009-11-25 00:36:00 +00:00
Devang Patel
4c7b5eaf23 Revert r89803.
llvm-svn: 89819
2009-11-25 00:31:13 +00:00
Bob Wilson
c5fa56c805 Refactor target hook for tail duplication as requested by Chris.
Make tail duplication of indirect branches much more aggressive (for targets
that indicate that it is profitable), based on further experience with
this transformation.  I compiled 3 large applications with and without
this more aggressive tail duplication and measured minimal changes in code
size.  ("size" on Darwin seems to round the text size up to the nearest
page boundary, so I can only say that any code size increase was less than
one 4k page.) Radar 7421267.

llvm-svn: 89814
2009-11-24 23:35:49 +00:00
Dale Johannesen
5809ff0e58 Do not store R31 into the caller's link area on PPC.
This violates the ABI (that area is "reserved"), and
while it is safe if all code is generated with current
compilers, there is some very old code around that uses
that slot for something else, and breaks if it is stored
into.  Adjust testcases looking for current behavior.
I've verified that the stack frame size is right in all
testcases, whether it changed or not.  7311323.

llvm-svn: 89811
2009-11-24 22:59:02 +00:00
Devang Patel
c68c2293a7 Enable debug info for ppc-darwin.
llvm-svn: 89803
2009-11-24 21:38:54 +00:00
Devang Patel
f01ac414c5 Use StringRef instead of std::string in DIEString.
llvm-svn: 89793
2009-11-24 19:42:17 +00:00
Devang Patel
9cd7c1ab8e Remove DebugLabelFolder pass. It is not used by dwarf writer anymore.
llvm-svn: 89790
2009-11-24 19:37:07 +00:00
Devang Patel
d7b0871621 Swith to pubtypes section before emitting pub types.
llvm-svn: 89787
2009-11-24 19:18:41 +00:00
Daniel Dunbar
740136a956 Remove bogus error handling code.
llvm-svn: 89786
2009-11-24 19:03:33 +00:00
Edward O'Callaghan
69ba53657a Provide Path::isSpecialFile interface for PR5568.
llvm-svn: 89765
2009-11-24 15:19:10 +00:00
Edward O'Callaghan
8c1cd4fdbc Fix for PR5373, Credit to Jakub Staszak.
llvm-svn: 89758
2009-11-24 11:51:52 +00:00
Evan Cheng
b81878ed80 Enable predication of NEON instructions in Thumb2 mode.
llvm-svn: 89748
2009-11-24 08:06:15 +00:00
Devang Patel
11c5d09a35 Emit pubtypes.
llvm-svn: 89725
2009-11-24 01:14:22 +00:00
Dale Johannesen
ee890316d5 Make capitalization of names starting "is" more consistent.
No functional change.

llvm-svn: 89724
2009-11-24 01:09:07 +00:00
Evan Cheng
179a11776c Data type suffix must come after predicate.
llvm-svn: 89723
2009-11-24 01:05:23 +00:00
David Goodwin
7945ead4d8 <rdar://problem/6721894>. Allow multiple registers to be renamed together (super and sub) if necessary to break an anti-dependence.
llvm-svn: 89722
2009-11-24 00:59:08 +00:00
Anton Korobeynikov
0f885eb7fd Materialize global addresses via movt/movw pair, this is always better
than doing the same via constpool:
1. Load from constpool costs 3 cycles on A9, movt/movw pair - just 2.
2. Load from constpool might stall up to 300 cycles due to cache miss.
3. Movt/movw does not use load/store unit.
4. Less constpool entries => better compiler performance.

This is only enabled on ELF systems, since darwin does not have needed
relocations (yet).

llvm-svn: 89720
2009-11-24 00:44:37 +00:00
Jim Grosbach
a142a709c8 80 column violations
llvm-svn: 89718
2009-11-24 00:20:27 +00:00
Jeffrey Yasskin
0a0b21f8c5 * Move stub allocation inside the JITEmitter, instead of exposing a
way for each TargetJITInfo subclass to allocate its own stubs. This
means stubs aren't as exactly-sized anymore, but it lets us get rid of
TargetJITInfo::emitFunctionStubAtAddr(), which lets ARM and PPC
support the eager JIT, fixing http://llvm.org/PR4816.

* Rename the JITEmitter's stub creation functions to describe the kind
of stub they create. So far, all of them create lazy-compilation
stubs, but they sometimes get used when far-call stubs are needed.
Fixing http://llvm.org/PR5201 will involve fixing this.

llvm-svn: 89715
2009-11-23 23:35:19 +00:00
Jim Grosbach
910fa44a53 enable iv-users simplification by default
llvm-svn: 89713
2009-11-23 23:25:54 +00:00
Dan Gohman
b5ec39e2dc Remove ISD::DEBUG_LOC and ISD::DBG_LABEL, which are no longer used.
Note that "hasDotLocAndDotFile"-style debug info was already broken;
people wanting this functionality should implement it in the
AsmPrinter/DwarfWriter code.

llvm-svn: 89711
2009-11-23 23:20:51 +00:00
Jeffrey Yasskin
ed6d1ce9ae Allow more than one stub to be being generated at the same time.
It's probably better in the long run to replace the
indirect-GlobalVariable system. That'll be done after a subsequent
patch.

llvm-svn: 89708
2009-11-23 22:49:00 +00:00
Evan Cheng
8c9f6147cd Massive refactoring of NEON instructions. Separate opcode from data size specifier suffix, move \t up stream to instruction format, and fix more 80 column violations.
This fixes the NEON asm printing so the "predicate" field is printed between the opcode and the data type suffix.

llvm-svn: 89706
2009-11-23 21:57:23 +00:00
Dan Gohman
24a93f78ae Simplify this code.
llvm-svn: 89702
2009-11-23 21:30:55 +00:00
Dan Gohman
e5ed49c40d Print the debug info line and column in MachineInstr::print even when there's
no filename. This situation is apparently fairly common right now.

llvm-svn: 89701
2009-11-23 21:29:08 +00:00
Jim Grosbach
76b545e988 move fconst[sd] to UAL. <rdar://7414913>
llvm-svn: 89700
2009-11-23 21:08:25 +00:00
Johnny Chen
e59a67f527 Partially revert r84730 by removing N2VDup from ARMInstrFormats.td and modifying
VDUPLND and VDUPLNQ to derive from N2V instead of N2VDup.  VDUPLND and VDUPLNQ
now expect op19_18 and op17_16 as the first two args.

llvm-svn: 89699
2009-11-23 21:00:43 +00:00
Jim Grosbach
bbb786facf fold immediate of a + Const into the user as a subtract if it can fit as a negated two-part immediate.
llvm-svn: 89694
2009-11-23 20:35:53 +00:00
Johnny Chen
9999d2524e Revert r84572 by removing N3VImm from ARMInstrFormats.td now that we can specify
{?,?,?,?} as op11_8 for VEXTd and VEXTq.

llvm-svn: 89693
2009-11-23 20:09:13 +00:00
Devang Patel
80eee0d8a4 Add CreateLocation varinat that accepts MDNode (with a default value).
llvm-svn: 89689
2009-11-23 19:11:20 +00:00
Devang Patel
6197d0b2eb Revert r89487.
llvm-svn: 89686
2009-11-23 18:43:37 +00:00
Johnny Chen
b49fe624e7 Partially revert r89377 by removing NLdStLN class definition from
ARMInstrFormats.td and fixing VLD[234]LN* and VST[234]LN* to derive from NLdSt
instead of NLdStLN.

llvm-svn: 89684
2009-11-23 18:16:16 +00:00
Dan Gohman
153de919a3 Move CopyCatchInfo into FunctionLoweringInfo.cpp too, for consistency.
llvm-svn: 89683
2009-11-23 18:12:11 +00:00
Dan Gohman
d23a0a12d9 Rename SelectionDAGLowering to SelectionDAGBuilder, and rename
SelectionDAGBuild.cpp to SelectionDAGBuilder.cpp.

llvm-svn: 89681
2009-11-23 18:04:58 +00:00
Johnny Chen
1116f46301 Make it clear that the index bit(s) of Vector Get Lane and Vector Set Lane
should be left unspecified now that Bob Wilson has fixed pr5470.

llvm-svn: 89676
2009-11-23 17:48:17 +00:00
Dan Gohman
4495850afb Move RegsForValue to an anonymous namespace, since it is only used
in this file.

llvm-svn: 89675
2009-11-23 17:46:23 +00:00
Dan Gohman
b0befa7c20 Move some more code out of SelectionDAGBuild.cpp and into
FunctionLoweringInfo.cpp.

llvm-svn: 89674
2009-11-23 17:42:46 +00:00
David Goodwin
07713477dc Minor itinerary fixes for FP instructions.
llvm-svn: 89672
2009-11-23 17:34:12 +00:00
Ted Kremenek
b63a5eedf7 Update CMake file.
llvm-svn: 89671
2009-11-23 17:26:04 +00:00
Dan Gohman
086e19c874 Move the FunctionLoweringInfo class and some related utility functions out
of SelectionDAGBuild.h/cpp into its own files, to help separate
general lowering logic from SelectionDAG-specific lowering logic.

llvm-svn: 89667
2009-11-23 17:16:22 +00:00
Chris Lattner
23bebfe8d5 fix comment, thanks all :)
llvm-svn: 89666
2009-11-23 17:07:35 +00:00
Chris Lattner
1637c0e720 use the new isNoAlias method to simplify some code, only do an escaping check if
we have a non-constant pointer.  Constant pointers can't be local.

llvm-svn: 89665
2009-11-23 16:46:41 +00:00
Chris Lattner
29221ce8d7 whitespace cleanup, tidying
llvm-svn: 89664
2009-11-23 16:45:27 +00:00
Chris Lattner
faf117b46b speed up BasicAA a bit by implementing a long-standing TODO.
llvm-svn: 89663
2009-11-23 16:44:43 +00:00
Dan Gohman
29dbc79996 Move FunctionPassManagerImpl's dumpArguments and dumpPasses calls
out of its run function and into its doInitialization method, so
that it does the dump once instead of once per function.

llvm-svn: 89660
2009-11-23 16:24:18 +00:00
Dan Gohman
58bb87921b Make ConstantFoldConstantExpression recursively visit the entire
ConstantExpr, not just the top-level operator. This allows it to
fold many more constants.

Also, make GlobalOpt call ConstantFoldConstantExpression on
GlobalVariable initializers.

llvm-svn: 89659
2009-11-23 16:22:21 +00:00
Dan Gohman
0ef3e7cf76 Fix a use of an invalidated iterator in the case where there are multiple
adjacent uses of a dead basic block from the same user. This fixes PR5596.

llvm-svn: 89658
2009-11-23 16:13:39 +00:00
Duncan Sands
efd23f129e I forgot to update the prototype for LLVMBuildIntCast when correcting
the body to not pass the name for the isSigned parameter.  However it
seems that changing prototypes is a big-no-no, so here I revert the
previous change and pass "true" for isSigned, meaning this always does
a signed cast, which was the previous behaviour assuming the name was
not NULL!  Some other C function needs to be introduced for the general
case of signed or unsigned casts.  This hopefully unbreaks the ocaml
binding.

llvm-svn: 89648
2009-11-23 10:49:03 +00:00
Nick Lewycky
deb3d7dfbc Start catching LLVMContext misuse in the verifier.
llvm-svn: 89646
2009-11-23 04:52:00 +00:00
Nick Lewycky
b3bedf4b2d Pull LLVMContext out of PromoteMemToReg.
llvm-svn: 89645
2009-11-23 03:50:44 +00:00
Nick Lewycky
76fbcdaaa7 Remove LLVMContext and its include.
llvm-svn: 89644
2009-11-23 03:34:29 +00:00
Nick Lewycky
8cbd0c3156 Remove unused LLVMContext.
llvm-svn: 89642
2009-11-23 03:29:18 +00:00
Nick Lewycky
1328a7b47f Remove dead LLVMContext argument.
llvm-svn: 89641
2009-11-23 03:26:09 +00:00
Nick Lewycky
9d1ee635e3 Reapply r88830 with a bugfix: this transform only applies to icmp eq/ne. This
fixes part of PR5438.

llvm-svn: 89639
2009-11-23 03:17:33 +00:00
Daniel Dunbar
11a4dce179 SourceMgr: Add ShowLine argument to PrintMessage, to allow suppressing the source line output.
llvm-svn: 89627
2009-11-22 22:08:00 +00:00
Jim Grosbach
f49995d449 Add getFrameIndexReference() to TargetRegisterInfo, which allows targets to
tell debug info which base register to use to reference a frame index on a
per-index basis. This is useful, for example, in the presence of dynamic
stack realignment when local variables are indexed via the stack pointer and
stack-based arguments via the frame pointer.

llvm-svn: 89620
2009-11-22 20:14:00 +00:00
Jim Grosbach
928cb87167 Move default FrameReg val to getFrameIndexReference(). Otherwise, debug info can get bogus values.
llvm-svn: 89618
2009-11-22 20:05:32 +00:00
Jim Grosbach
0acdac3bf0 80-column cleanup
llvm-svn: 89612
2009-11-22 19:20:36 +00:00
Jakob Stoklund Olesen
a58473532a Teach MachineBasicBlock::updateTerminator() to handle a failing TII->ReverseBranchCondition(Cond) call.
This fixes the MallocBench/cfrac test case regression.

llvm-svn: 89608
2009-11-22 18:28:04 +00:00
Chris Lattner
73422d2e9b add fixme for dubious code. Duncan, what do you think?
llvm-svn: 89602
2009-11-22 16:16:48 +00:00
Chris Lattner
632f60ccc9 remove a silly condition that doesn't make a lot of sense anymore.
llvm-svn: 89601
2009-11-22 16:15:59 +00:00
Chris Lattner
59be5d3703 reduce indentation, no functionality change.
llvm-svn: 89600
2009-11-22 16:05:05 +00:00
Chris Lattner
b6ecd40652 Remove the AliasAnalysis::getMustAliases method, which is dead.
The hasNoModRefInfoForCalls isn't worth it as a filter because 
basicaa provides m/r info and everything chains to it, so remove
it.

llvm-svn: 89599
2009-11-22 16:01:44 +00:00
Nick Lewycky
e7829c73f2 Remove dead code. While there, also turn a few 'T* ' into 'T *' to match the
rest of the file.

llvm-svn: 89577
2009-11-22 02:38:11 +00:00
Jim Grosbach
33f06ed72e Generate more correct debug info for frame indices.
llvm-svn: 89576
2009-11-22 02:32:29 +00:00
Anton Korobeynikov
5511c0260f Minor optimization: when doing eq/ne comparions and RHS is a constant - swap operands, this will allow us to fold imm into comparison.
llvm-svn: 89574
2009-11-22 01:14:08 +00:00
Anton Korobeynikov
10669b8c42 Drop unsupported imm operands
llvm-svn: 89573
2009-11-22 01:13:54 +00:00
Anton Korobeynikov
44886c9a90 Use 2-byte alignment for functions. 4 bytes are clear overkill here.
llvm-svn: 89572
2009-11-22 01:13:39 +00:00
Anton Korobeynikov
9cea2b264c Use semicolon as assembler comment string
llvm-svn: 89571
2009-11-22 01:12:49 +00:00
Jim Grosbach
99c5b49c61 Revert 89562. We're being sneakier than I was giving us credit for, and this
isn't necessary.

llvm-svn: 89568
2009-11-21 23:34:09 +00:00
Jim Grosbach
99a88f415b remove trailing whitespace
llvm-svn: 89567
2009-11-21 23:12:12 +00:00
Jim Grosbach
d4603a5c4e Darwin requires a frame pointer for all non-leaf functions to support correct
backtraces.

llvm-svn: 89562
2009-11-21 21:40:08 +00:00
Evan Cheng
a7496ef9a6 Add predicate operand to NEON instructions. Fix lots (but not all) 80 col violations in ARMInstrNEON.td.
llvm-svn: 89542
2009-11-21 06:21:52 +00:00
Evan Cheng
6970be3ca4 Allow target to disable if-converting predicable instructions. e.g. NEON instructions under ARM mode.
llvm-svn: 89541
2009-11-21 06:20:26 +00:00
Devang Patel
7f5e6b43a0 Cosmetic changes, which were long overdue, in DwarfDebug.cpp.
llvm-svn: 89537
2009-11-21 02:48:08 +00:00
Devang Patel
327919890c We are not using DBG_STOPPOINT anymore.
llvm-svn: 89536
2009-11-21 02:46:55 +00:00
Jakob Stoklund Olesen
319458cd03 Be more clever about calculating live variables through new basic blocks.
When splitting a critical edge, the registers live through the edge are:

- Used in a PHI instruction, or
- Live out from the predecessor, and
- Live in to the successor.

This allows the coalescer to eliminate even more phi joins.

llvm-svn: 89530
2009-11-21 02:05:21 +00:00
Eric Christopher
455f4d8400 Add more optimizations for object size checking, enable handling of
object size intrinsic and verify return type is correct. Collect various
code in one place.

llvm-svn: 89523
2009-11-21 01:01:30 +00:00
Devang Patel
c672dccdbb Remove dead code.
llvm-svn: 89522
2009-11-21 00:54:03 +00:00
Dale Johannesen
907ff5a620 When generating a vector the really slow way, via loads
and stores, handle the case where the element size is not
a valid target type correctly (PPC).

llvm-svn: 89521
2009-11-21 00:53:23 +00:00
Devang Patel
8d7175f85f There is no need to use FoldingSet to unique DIEs.
DIEs are created from MDNode, which are already uniqued. And DwarfDebug already uses ValueMaps to find and use existing DIE for a given MDNode.

llvm-svn: 89518
2009-11-21 00:31:03 +00:00
Viktor Kutuzov
ac8f027245 Added two SubtargetFeatures::AddFeatures methods, which accept a comma-separated string or already parsed command line parameters as input, and some code re-factoring to use these new methods.
llvm-svn: 89516
2009-11-21 00:00:02 +00:00
David Goodwin
d5ef76388e Restructure code to allow renaming of multiple-register groups for anti-dep breaking.
llvm-svn: 89511
2009-11-20 23:33:54 +00:00
Evan Cheng
9828118adf Enable hoisting load from constant memories.
llvm-svn: 89510
2009-11-20 23:31:34 +00:00
Dan Gohman
e5eddcd606 Fix a thinko that caused spurious @GOTOFFs.
llvm-svn: 89509
2009-11-20 23:30:32 +00:00
Dan Gohman
ca4026afec Update for new getBlockAddress signature.
llvm-svn: 89507
2009-11-20 23:21:00 +00:00
Dan Gohman
3517f425b8 Target-independent support for TargetFlags on BlockAddress operands,
and support for blockaddresses in x86-32 PIC mode.

llvm-svn: 89506
2009-11-20 23:18:13 +00:00
Sean Callanan
78ee7f5d57 Recommitting PALIGNR shift width fixes.
Thanks to Daniel Dunbar for fixing clang intrinsics:
  http://llvm.org/viewvc/llvm-project?view=rev&revision=89499

llvm-svn: 89500
2009-11-20 22:28:42 +00:00
Dale Johannesen
45f80d39f6 Remove an incorrect overaggressive optimization
(PPC specific).

llvm-svn: 89496
2009-11-20 22:16:40 +00:00
Sean Callanan
d92626fc0d Reverting PALIGNR fix until I figure out how this
broke the Clang testsuite.

llvm-svn: 89495
2009-11-20 22:09:28 +00:00
Sean Callanan
0da77167d3 Fixed PALIGNR to take 8-bit rotations in all cases.
Also fixed the corresponding testcase, and the PALIGNR
  intrinsic (tested for correctness with llvm-gcc).

llvm-svn: 89491
2009-11-20 21:40:28 +00:00
Devang Patel
7b6ef33b1c Do not hold on to a map slot while new entries may be inserted into the map.
Use ValueMap, instead of std::map.

llvm-svn: 89490
2009-11-20 21:37:22 +00:00
David Greene
b4587dcdc9 Cleanups.
Make things a little more efficient as suggested by Evan.

llvm-svn: 89489
2009-11-20 21:13:27 +00:00
Devang Patel
35731e4453 There is no need to emit source location info for DW_TAG_pointer_type.
llvm-svn: 89487
2009-11-20 21:05:37 +00:00
Dan Gohman
d115107ef2 Make Loop::getLoopLatch() work on loops which don't have preheaders, as
it may be used in contexts where preheader insertion may have failed due
to an indirectbr.

Make LoopSimplify's LoopSimplify::SeparateNestedLoop properly fail in
the case that it would require splitting an indirectbr edge.

These fix PR5502.

llvm-svn: 89484
2009-11-20 20:51:18 +00:00
Dan Gohman
94cca19d9d Fix IPSCCP's code for deleting dead blocks to tolerate outstanding
blockaddress users. This fixes PR5569.

llvm-svn: 89483
2009-11-20 20:19:14 +00:00
Daniel Dunbar
09a7f92b02 Revert "Add some rough optimizations for checking routines.", it buildeth not.
llvm-svn: 89482
2009-11-20 20:17:30 +00:00
Eric Christopher
61485dfd00 Add some rough optimizations for checking routines.
llvm-svn: 89479
2009-11-20 19:57:37 +00:00
Evan Cheng
9f57c4916e Remat VLDRD from constpool. Clean up some instruction property specifications.
llvm-svn: 89478
2009-11-20 19:57:15 +00:00
Evan Cheng
92a81f9ffc Add option -licm-const-load to hoist all loads from constant memory.
llvm-svn: 89477
2009-11-20 19:55:37 +00:00
Jim Grosbach
8371342c89 The verify() call of CPEIsInRange() isn't right for the assertion check of
constant pool ranges, as CPEIsInRange() makes conservative assumptions about
the potential alignment changes from branch adjustments. The verification,
on the other hand, runs after those branch adjustments are made, so the
effects on alignment are known and already taken into account. The sanity
check in verify should check the range directly instead.

llvm-svn: 89473
2009-11-20 19:37:38 +00:00
Dan Gohman
b9c2249009 Use stripPointerCasts(). Thanks Duncan!
llvm-svn: 89472
2009-11-20 19:33:16 +00:00
David Goodwin
8954ccb109 Remove some old experimental code that is no longer needed. Remove additional, speculative scheduling pass as its cost did not translate into significant performance improvement. Minor tweaks.
llvm-svn: 89471
2009-11-20 19:32:48 +00:00
Jakob Stoklund Olesen
bf42858641 More consistent labelling of basic blocks in debug output
llvm-svn: 89470
2009-11-20 18:54:59 +00:00
Dan Gohman
198fbdadcf Revert the rule that considers comparisons between two pointers in the
same object to be a non-capture; Duncan pointed out a way that such
a comparison could be a capture.

Make the rule that considers a comparison against null more specific,
and only consider noalias return values compared against null. This
still supports test/Transforms/GVN/nonescaping-malloc.ll, and is not
susceptible to the problem Duncan pointed out with noalias arguments.

llvm-svn: 89468
2009-11-20 17:50:21 +00:00
Mikhail Glushenkov
d561db80e6 Move the handling of CommaSeparated options into ProvideOption.
Makes '--comma-separated val1,val2' mean the same thing as
'--comma-separated=val1,val2' (that is, 'val1' and 'val2' are not lumped
together as 'val1,val2'). Also declutters the main loop a bit.

llvm-svn: 89463
2009-11-20 17:23:17 +00:00
Duncan Sands
5f5ec2a6ec Fix PR5563, an expensive checks failure when running on
tests/Transforms/InstCombine/shufflemask-undef.ll.  If
anyone cares, the use of 2*e here (and the equivalent
all over the place in instcombine) seems wrong, though
harmless: it should really be twice the length of the
input vector.  I think shufflevector used to require
that the mask have the same length as the input, but I
don't think that's true any more.  I don't care enough
about vectors to do anything about this...

llvm-svn: 89456
2009-11-20 13:19:51 +00:00
Duncan Sands
072d688d75 Fix PR5558, which was caused by a wrong fix for PR3393 (see commit 63048),
which was an expensive checks failure due to a bug in the checking.  This
patch in essence reverts the original fix for PR3393, and refixes it by a
tweak to the way expensive checking is done.

llvm-svn: 89454
2009-11-20 10:45:10 +00:00