Commit Graph

45963 Commits

Author SHA1 Message Date
Dan Gohman 1705968102 Add a new function, ReplaceAllUsesOfValuesWith, which handles bulk
replacement of multiple values. This is slightly more efficient
than doing multiple ReplaceAllUsesOfValueWith calls, and theoretically
could be optimized even further. However, an important property of this
new function is that it handles the case where the source value set and
destination value set overlap. This makes it feasible for isel to use
SelectNodeTo in many very common cases, which is advantageous because
SelectNodeTo avoids a temporary node and it doesn't require CSEMap
updates for users of values that don't change position.

Revamp MorphNodeTo, which is what does all the work of SelectNodeTo, to
handle operand lists more efficiently, and to correctly handle a number
of corner cases to which its new wider use exposes it.

This commit also includes a change to the encoding of post-isel opcodes
in SDNodes; now instead of being sandwiched between the target-independent
pre-isel opcodes and the target-dependent pre-isel opcodes, post-isel
opcodes are now represented as negative values. This makes it possible
to test if an opcode is pre-isel or post-isel without having to know
the size of the current target's post-isel instruction set.

These changes speed up llc overall by 3% and reduce memory usage by 10%
on the InstructionCombining.cpp testcase with -fast and -regalloc=local.

llvm-svn: 53728
2008-07-17 19:10:17 +00:00
Evan Cheng d8c156e8be Indentation.
llvm-svn: 53727
2008-07-17 18:41:20 +00:00
Ted Kremenek 88a6b7fa80 Moved RemoveDeadBindings logic for the contents of 'Store' to a virtual RemoveDeadBindings method in StoreManager.
llvm-svn: 53726
2008-07-17 18:38:48 +00:00
Ted Kremenek 9ace803308 We now build universal binaries of the checker.
llvm-svn: 53725
2008-07-17 18:35:12 +00:00
Argyrios Kyrtzidis ef34aed1f9 Unify ctx_iterator/ctx_begin()/ctx_end() and iterator/begin()/end() so that a single iterator type is used for both traversing decls of the same declaration context *and* of the parent declaration contexts, depending on the value of the bool parameter 'LookInParentCtx' that is passed to IdentifierResolver::begin().
llvm-svn: 53724
2008-07-17 17:49:50 +00:00
Duncan Sands 7e5edf1a1f LegalizeTypes support for what seems to be the
only missing ppc long double operations: FNEG
and FP_EXTEND.

llvm-svn: 53723
2008-07-17 17:35:14 +00:00
Nate Begeman 3851e29e20 Remove unnecessary readme entry
llvm-svn: 53722
2008-07-17 17:21:14 +00:00
Duncan Sands d9256a7ceb Turn LegalizeTypes back off again for the moment:
it is breaking Darwin bootstrap due to missing
functionality.

llvm-svn: 53721
2008-07-17 17:06:03 +00:00
Nate Begeman 3a2147aa97 Fix a typo in last commit
llvm-svn: 53720
2008-07-17 17:04:58 +00:00
Nate Begeman 55b7becb29 SSE codegen for vsetcc nodes
llvm-svn: 53719
2008-07-17 16:51:19 +00:00
Matthijs Kooijman 8b69d77a7a Make GlobalOpt preserve address spaces when scalar replacing aggregate globals.
llvm-svn: 53716
2008-07-17 11:59:53 +00:00
Chris Lattner c600c53d1f Fix PR2553
llvm-svn: 53715
2008-07-17 06:07:20 +00:00
Mon P Wang 1e2c6bfa41 When lowering certain atomics, we need to copy the memoperand from the old
atomic operation to the new one.

llvm-svn: 53714
2008-07-17 04:54:06 +00:00
Duncan Sands 77a3d05f1e Factorize some code for determining which libcall to use.
llvm-svn: 53713
2008-07-17 02:36:29 +00:00
Evan Cheng 97cd0298cc Inliner tweak. Function calls should cost more than one instruction!
llvm-svn: 53712
2008-07-17 01:31:49 +00:00
Owen Anderson c062381c7b Factor MergeBlockIntoPredecessor out into BasicBlockUtils.
llvm-svn: 53705
2008-07-17 00:01:40 +00:00
Steve Naroff 97adf60418 RewriteObjC::SynthMessageExpr(): Fix super rewrite (a fairly recent regression).
Fixes <rdar://problem/6046663> clang ObjC rewriter: Regression in handling of 'super' in latest build.

llvm-svn: 53703
2008-07-16 22:35:27 +00:00
Argyrios Kyrtzidis bd25998a45 When in C++, make EnumConstant names hide tag names in the same scope, instead of colliding with them.
llvm-svn: 53702
2008-07-16 21:01:53 +00:00
Devang Patel 41cfed7e49 Name string length is end position marker - begin position marker.
llvm-svn: 53697
2008-07-16 19:49:09 +00:00
Steve Naroff d7ebc05476 Remove a FIXME from RewriteObjC::RewriteObjCSynchronizedStmt().
llvm-svn: 53696
2008-07-16 19:47:39 +00:00
Steve Naroff 8dd1525b9a RewriteObjC::Initialize(): add function decls used by @synchronized.
This fixes <rdar://problem/6040143> clang ObjC rewriter: @synchronized keyword inserts undeclared objc functions.

llvm-svn: 53695
2008-07-16 18:58:11 +00:00
Steve Naroff de7d0f69ba Two fixes:
- Make sure ObjCIvarDecl propagates the bitfield width.
- RewriteObjC::SynthesizeIvarOffsetComputation(): Avoid using the __OFFSETOF__ mumbo jumbo for bitfields (since it isn't legal C). This fixes <rdar://problem/5986079> clang ObjC rewriter: bitfields and ivar access don't mix.

llvm-svn: 53694
2008-07-16 18:22:22 +00:00
Devang Patel a59fe95be3 Do not forget global definitions from inline asm code block.
llvm-svn: 53693
2008-07-16 18:06:52 +00:00
Devang Patel 78e8a09f39 Mark function used by asm block as used, otherwise optimizer may not see the use and may delete the function.
llvm-svn: 53692
2008-07-16 17:54:34 +00:00
Owen Anderson ac31096311 There's no need to iterate block merging and PRE. In fact, iterating the latter
could cause problems for memdep when it breaks critical edges.

llvm-svn: 53691
2008-07-16 17:52:31 +00:00
Scott Michel fe09508210 Somehow, custom lowering of i64 multiplications got dropped along the way.
llvm-svn: 53689
2008-07-16 17:17:29 +00:00
Dan Gohman f169f81036 Fix the result type of X86's truncate to i8.
llvm-svn: 53688
2008-07-16 16:20:48 +00:00
Dan Gohman 2714059079 Fix the result type of a VECTOR_SHUFFLE+BIT_CONVERT dagcombine. This
was turned up by some new SelectionDAG assertion checks that I'm
working on.

llvm-svn: 53687
2008-07-16 16:13:58 +00:00
Dan Gohman 494fb26521 Fix the name of BreakCriticalMachineEdge.h's include guard
llvm-svn: 53686
2008-07-16 16:04:07 +00:00
Dan Gohman 52636b2a81 Correct a top-level comment.
llvm-svn: 53685
2008-07-16 16:03:31 +00:00
Duncan Sands 2d28e281e9 Add support for promoting and expanding AssertZext
and AssertSext.  Needed when passing huge integer
parameters with the zeroext or signext attributes.

llvm-svn: 53684
2008-07-16 16:03:07 +00:00
Dan Gohman add5195334 Clarify the comments here, to make slightly more clear the
difference in purpose of TargetInstrInfo and TargetInstrDesc,
which isn't immediately obvious from the name.

llvm-svn: 53683
2008-07-16 16:02:59 +00:00
Dan Gohman b010a08d3a Tidy a doxygen comment.
llvm-svn: 53682
2008-07-16 15:59:56 +00:00
Dan Gohman 26ffe2bea6 Fix a comment to say nonnegative instead of positive.
llvm-svn: 53681
2008-07-16 15:57:10 +00:00
Dan Gohman bf98f68265 Add an assert to check for empty flags for MachineMemOperand.
llvm-svn: 53680
2008-07-16 15:56:42 +00:00
Steve Naroff ce2dca186b RewriteObjC::RewriteObjCTryStmt():Don't synthesize a catch begin if there are 0 catch clauses.
This fixes <rdar://problem/5987211> clang ObjC rewriter: @try / @finally block produces unbalanced output.

llvm-svn: 53679
2008-07-16 15:31:30 +00:00
Steve Naroff b067bbd019 Teach RewriteObjC::RewriteObjCMethodDecl() to deal with pointer to function return types.
This fixes <rdar://problem/6034961> clang ObjC rewriter: rewriting methods with function pointer return values does not work

llvm-svn: 53678
2008-07-16 14:40:40 +00:00
Duncan Sands 5b2c2975b8 Test passing of integer parameters for integers
of all sizes from i1 to i256.  The code is not
always that great, for example (x86)
        movw    %di, %ax
        movw    %ax, i17_s
where the store could be directly from %di.

llvm-svn: 53677
2008-07-16 13:37:36 +00:00
Duncan Sands 5efef246ed Test codegen of loads and stores of all integer
sizes from i1 to i256.  The generated code is
like one huge bug report of things that the DAG
combiner fails to simplify!

llvm-svn: 53676
2008-07-16 13:10:20 +00:00
Matthijs Kooijman f22f34f0cc Add a few cases to instcombine's extractvalue testcase.
llvm-svn: 53675
2008-07-16 12:57:25 +00:00
Matthijs Kooijman c9d4e06f3a Un-XFAIL multdeadretval, since instcombine now properly handles the mess deadargelim leaves behind :-)
llvm-svn: 53674
2008-07-16 12:56:52 +00:00
Matthijs Kooijman c1d7477ed2 Redo InstCombiner::visitExtractValueInst. Instead of using the (complicate)
FindInsertedValue, it now performs a number of simple transformations that
should result in the same effect when applied iteratively.

llvm-svn: 53673
2008-07-16 12:55:45 +00:00
Duncan Sands e766b4230e Reorder methods alphabetically. No functionality change.
While this is not a wonderful organizing principle, it
does make it easy to find routines, and clear where to
insert new ones.

llvm-svn: 53672
2008-07-16 11:41:33 +00:00
Duncan Sands c359055fa9 Turn on LegalizeTypes by default.
llvm-svn: 53671
2008-07-16 11:36:51 +00:00
Matthijs Kooijman b85cc9db19 Don't use ++idx_begin when I actually mean idx_begin + 1, especially since we
also use *idx_begin in the same expression, giving unpredictable results.

This fixes this bug: http://lists.cs.uiuc.edu/pipermail/llvmdev/2008-July/015877.html

llvm-svn: 53670
2008-07-16 10:47:35 +00:00
Duncan Sands a0b1ab3c0b The atomic.cmp.swap promotion logic is wrong: it
simply does the atomic.cmp.swap on the larger type,
which means it blows away whatever is sitting in
the bytes just after the memory location, i.e.
causes a buffer overflow.  This really requires
target specific code, which is why LegalizeTypes
doesn't try to handle this case generically.  The
existing (wrong) code in LegalizeDAG will go away
automatically once the type legalization code is
removed from LegalizeDAG so I'm leaving it there
for the moment.  Meanwhile, don't test for this
feature.

llvm-svn: 53669
2008-07-16 08:09:48 +00:00
Argyrios Kyrtzidis 7da34d050b When checking for name collision between a tag and a previously defined namespace, the collision occured even when the tag was in a different nested scope.
Fix it by taking into account the scope when checking for namespace-tag name collisions.

llvm-svn: 53667
2008-07-16 07:45:46 +00:00
Evan Cheng c97094552c Fix PR2296. Do not transform x86_sse2_storel_dq into a full-width store.
llvm-svn: 53666
2008-07-16 07:28:14 +00:00
Argyrios Kyrtzidis 16c04102ed Add 'this' in the comments of Parser::ParseCastExpression to indicate that it is handled.
llvm-svn: 53665
2008-07-16 07:23:27 +00:00
Ted Kremenek de3725367b Updated latest checker build.
llvm-svn: 53664
2008-07-16 02:39:15 +00:00