Commit Graph

8633 Commits

Author SHA1 Message Date
Dan Gohman
2e68beb36a Fix omitted break statements in a switch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146380 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-12 18:13:53 +00:00
Kostya Serebryany
9b02741d22 [asan] use .preinit_array only on linux
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146379 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-12 18:01:46 +00:00
Chandler Carruth
ccbf1e36d3 Switch llvm.cttz and llvm.ctlz to accept a second i1 parameter which
indicates whether the intrinsic has a defined result for a first
argument equal to zero. This will eventually allow these intrinsics to
accurately model the semantics of GCC's __builtin_ctz and __builtin_clz
and the X86 instructions (prior to AVX) which implement them.

This patch merely sets the stage by extending the signature of these
intrinsics and establishing auto-upgrade logic so that the old spelling
still works both in IR and in bitcode. The upgrade logic preserves the
existing (inefficient) semantics. This patch should not change any
behavior. CodeGen isn't updated because it can use the existing
semantics regardless of the flag's value.

Note that this will be followed by API updates to Clang and DragonEgg.

Reviewed by Nick Lewycky!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146357 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-12 04:26:04 +00:00
Andrew Trick
fa1948a40f LSR: ignore strides in outer loops.
Since we're not rewriting IVs in other loops, there's not much reason
to consider their stride when generating formulae.
This should reduce the number of useless formulas considered by LSR.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146302 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-10 00:25:00 +00:00
Kostya Serebryany
25a8b809a0 [asan] call __asan_init from .preinit_array. This simplifies __asan_init vs malloc chicken-and-egg situation on Android and probably on other flavours of Linux. Patch by eugenis@google.com.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146284 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-09 22:09:32 +00:00
Jakub Staszak
2fac1d5d61 SplitBlockPredecessors uses ArrayRef instead of Data and Size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146277 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-09 21:19:53 +00:00
Andrew Trick
5d73448bb7 Add -unroll-runtime for unrolling loops with run-time trip counts.
Patch by Brendon Cahoon!

This extends the existing LoopUnroll and LoopUnrollPass. Brendon
measured no regressions in the llvm test suite with -unroll-runtime
enabled. This implementation works by using the existing loop
unrolling code to unroll the loop by a power-of-two (default 8). It
generates an if-then-else sequence of code prior to the loop to
execute the extra iterations before entering the unrolled loop.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146245 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-09 06:19:40 +00:00
Nick Lewycky
c9b98ad7a7 Fix infinite loop in DSE when deleting a free in a reachable loop that's also
trivially infinite.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146197 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-08 22:36:35 +00:00
Duncan Sands
0ea3a0c236 Remove unused include.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146037 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-07 17:18:31 +00:00
Benjamin Kramer
88c09143b6 Simplify common predecessor finding.
- Walking over pred_begin/pred_end is an expensive operation.
- PHINodes contain a value for each predecessor anyway.
- While it may look like we used to save a few iterations with the set,
  be aware that getIncomingValueForBlock does a linear search on
  the values of the phi node.
- Another -5% on ARMDisassembler.cpp (Release build). This was the last
  entry in the profile that was obviously wasting time.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145937 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-06 16:14:29 +00:00
Benjamin Kramer
85dadecbd6 Push StringRefs through the metadata interface.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145934 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-06 11:50:26 +00:00
Andrew Trick
8a5d792944 LSR: prune undesirable formulae early.
It's always good to prune early, but formulae that are unsatisfactory
in their own right need to be removed before running any other pruning
heuristics. We easily avoid generating such formulae, but we need them
as an intermediate basis for forming other good formulae.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145906 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-06 03:13:31 +00:00
Nick Lewycky
7c06741004 Expose a switch for the new gcov format.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145880 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-06 00:29:13 +00:00
Chad Rosier
a4b6fd5be0 Update comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145866 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-05 22:53:09 +00:00
Chad Rosier
d8bd26ee24 Make the MemCpyOptimizer a bit more aggressive. I can't think of a scenerio
where this would be bad as the backend shouldn't have a problem inlining small
memcpys.
rdar://10510150

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145865 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-05 22:37:00 +00:00
Benjamin Kramer
4da7f90b17 Add a little heuristic to Value::isUsedInBasicBlock to speed it up for small basic blocks.
- Calling getUser in a loop is much more expensive than iterating over a few instructions.
- Use it instead of the open-coded loop in AddrModeMatcher.
- 5% speedup on ARMDisassembler.cpp Release builds.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145810 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-05 17:23:27 +00:00
Nadav Rotem
1608769abe Add support for vectors of pointers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145801 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-05 06:29:09 +00:00
Pete Cooper
de2e27cc52 Fixed deadstoreelimination bug where negative indices were incorrectly causing the optimisation to occur
Turns out long long + unsigned long long is unsigned.  Doh!

Fixes http://llvm.org/bugs/show_bug.cgi?id=11455

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145731 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-03 00:04:30 +00:00
Benjamin Kramer
30fe1ae20d Fix quadratic behavior in InlineFunction by fetching the personality function of the callee once and not for every invoke in the caller.
The callee is usually smaller than the caller, too. This reduces the compile
time of ARMDisassembler.cpp by 32% (Release build). It still takes ages to
compile though.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145690 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-02 18:37:31 +00:00
Chad Rosier
aab8e28d5e Fix a few more places where TargetData/TargetLibraryInfo is not being passed.
Add FIXMEs to places that are non-trivial to fix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145661 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-02 01:26:24 +00:00
Chad Rosier
00737bdb48 Last bit of TargetLibraryInfo propagation. Also fixed a case for TargetData
where it appeared beneficial to pass.
More of rdar://10500969

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145630 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-01 21:29:16 +00:00
Pete Cooper
165695d261 Improved fix for abs(val) != 0 to check other similar case. Also fixed style issues and confusing comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145618 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-01 19:13:26 +00:00
Kostya Serebryany
cc1d856d8e [asan] two minor fixes: use UnreachableInst after the neverreturn function call; use report_fatal_error when blacklist file can not be found
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145611 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-01 18:54:53 +00:00
Pete Cooper
65a6b57c33 Added instcombine pattern to spot comparing -val or val against 0.
(val != 0) == (-val != 0) so "abs(val) != 0" becomes "val != 0"

Fixes <rdar://problem/10482509>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145563 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-01 03:58:40 +00:00
Chad Rosier
618c1dbd29 Propagate TargetLibraryInfo throughout ConstantFolding.cpp and
InstructionSimplify.cpp.  Other fixups as needed.
Part of rdar://10500969

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145559 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-01 03:08:23 +00:00
Kostya Serebryany
af65a8c54b make asan work at -O0, llvm part. Patch by glider@google.com
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145530 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-30 22:19:26 +00:00
Eli Friedman
3dad610aaa Make GlobalMerge honor the preferred alignment on globals without an explicitly specified alignment.
<rdar://problem/10497732>.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145523 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-30 21:54:15 +00:00
Chad Rosier
caebb1e00b Whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145470 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-30 01:59:59 +00:00
Chad Rosier
3d925d24e8 Add support for sqrt, sqrtl, and sqrtf in TargetLibraryInfo. Disable
(fptrunc (sqrt (fpext x))) -> (sqrtf x) transformation if -fno-builtin is 
specified.
rdar://10466410

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145460 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-29 23:57:10 +00:00
Stepan Dyatkovskiy
be4c844648 Potential bug in RewriteLoopBodyWithConditionConstant: use iterator should not be changed inside the uses enumeration loop.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145432 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-29 20:34:39 +00:00
Daniel Dunbar
d782bae970 build/CMake: Finish removal of add_llvm_library_dependencies.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145420 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-29 19:25:30 +00:00
Duncan Sands
d3a38ccfbb Fix a theoretical problem (not seen in the wild): if different instances of a
weak variable are compiled by different compilers, such as GCC and LLVM, while
LLVM may increase the alignment to the preferred alignment there is no reason to
think that GCC will use anything more than the ABI alignment.  Since it is the
GCC version that might end up in the final program (as the linkage is weak), it
is wrong to increase the alignment of loads from the global up to the preferred
alignment as the alignment might only be the ABI alignment.

Increasing alignment up to the ABI alignment might be OK, but I'm not totally
convinced that it is.  It seems better to just leave the alignment of weak
globals alone.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145413 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-29 18:26:38 +00:00
Andrew Trick
ecb35ece5c SCEV fix. In general, Add/Mul expressions should not inherit NSW/NUW.
This reverts r139450, fixes r139453, and adds much needed comments and a
unit test.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145367 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-29 02:16:38 +00:00
Eli Friedman
ba78c883d4 Zap some completely ridiculous code. There's probably a miscompile here, but I don't really want to try to write a testcase involving an invoke returning a pointer to a varargs function...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145347 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-29 01:18:23 +00:00
Eli Friedman
54b92113e2 Add a missing safety check to ProcessUGT_ADDCST_ADD. Fixes PR11438.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145316 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-28 23:32:19 +00:00
Andrew Trick
ed38f1ca2e Remove the temporary flag -disable-unroll-scev and dead code.
SCEV should now be used for trip count analysis, not LoopInfo.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145262 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-28 19:22:09 +00:00
Nick Lewycky
bba40db072 Place the "cfg checksum" around a test. This was recently added in April 2011 to
gcc, though I thought it was older (my gcc 4.4 has it as a local patch. Whoops!)
This fixes PR10589.

Also add some debugging statements.

Remove GcnoFiles, the mapping from CompilationUnit to raw_ostream. Now that we
start by iterating over each CU and descending into them, there's no need to
maintain a mapping.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145208 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-27 23:22:20 +00:00
Benjamin Kramer
0861f5793a Move code into anonymous namespaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145154 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-26 23:01:57 +00:00
Kostya Serebryany
d2703dec27 [asan] do not instrument threadlocal globals, this is buggy
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145092 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-23 02:10:54 +00:00
Nick Lewycky
173862e546 Refactor code to use new attribute getters on CallSite for NoCapture and ByVal.
Suggested in code review by Eli.

That code in InstCombine looks kinda suspicious.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145013 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-20 19:09:04 +00:00
Kostya Serebryany
5a3a9c9371 [asan] workaround for reg alloc bug 11395: don't instrument functions with large chunks of inline assembler
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144962 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-18 01:41:06 +00:00
Kostya Serebryany
2e7fb2f736 quick fix: remove GlobalVariable::GlobalVariable mistakenly commited at r144933. For some reason this compiles on linux
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144936 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-17 23:37:53 +00:00
Andrew Trick
4f3052403c Fix an overly general check in SimplifyIndvar to handle useless phi cycles.
The right way to check for a binary operation is
cast<BinaryOperator>. The original check: cast<Instruction> &&
numOperands() == 2 would match phi "instructions", leading to an
infinite loop in extreme corner case: a useless phi with operands
[self, constant] that prior optimization passes failed to remove,
being used in the loop by another useless phi, in turn being used by an
lshr or udiv.

Fixes PR11350: runaway iteration assertion.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144935 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-17 23:36:35 +00:00
Kostya Serebryany
7cf2a04361 fall back to explicit list of allowed linkages when instrumenting globals in asan; add a test check that asan does not touch linkonce_odr
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144933 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-17 23:14:59 +00:00
Eli Friedman
9d434dbff3 Add support for custom names for library functions in TargetLibraryInfo. Add a custom name for fwrite and fputs on x86-32 OSX. Make SimplifyLibCalls honor the custom
names for fwrite and fputs.

Fixes <rdar://problem/9815881>.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144876 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-17 01:27:36 +00:00
Nick Lewycky
ae10dd2859 Merge isObjectPointerWithTrustworthySize with getPointerSize. Use it when
looking at the size of the pointee. Fixes PR11390!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144773 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-16 03:49:48 +00:00
Kostya Serebryany
800e03f598 AddressSanitizer, first commit (compiler module only)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144758 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-16 01:35:23 +00:00
Kostya Serebryany
a2a2d1fddd test commit to verify that commit access works (added blank line)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144748 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-16 01:14:38 +00:00
Nadav Rotem
de631128d6 Fix MSVC warnings by adding a cast.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144721 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-15 22:54:21 +00:00
Benjamin Kramer
b5ccb25bc2 StringRefize and simplify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144675 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-15 19:12:09 +00:00
Benjamin Kramer
a7b0cb7594 Remove all remaining uses of Value::getNameStr().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144648 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-15 16:27:03 +00:00
Benjamin Kramer
aa5354c3ba Make headers standalone, move a virtual method out of line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144536 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-14 17:22:45 +00:00
Daniel Dunbar
b8ebca83f4 build: Attempt to rectify inconsistencies between CMake and LLVMBuild versions of explicit dependencies.
- The hope is that we have a tool/test to verify these are accurate (and tight) soon.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144444 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-12 02:10:57 +00:00
Eli Friedman
75f69e3a3d Make sure scalarrepl picks the correct alloca when it rewrites a bitcast. Fixes PR11353.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144442 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-12 02:07:50 +00:00
Daniel Dunbar
8396893fa5 LLVMBuild: Alphabetize required_libraries lists.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144416 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-11 22:59:23 +00:00
Eli Friedman
b80f778bd3 Get rid of an optimization in SCCP which appears to have many issues. Specifically, it doesn't handle many cases involving undef correctly, and it is missing other checks which
lead to it trying to re-mark a value marked as a constant with a different value.  It also appears to trigger very rarely.

Fixes PR11357.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144352 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-11 01:16:15 +00:00
Pete Cooper
c7e5a6a2c6 Fixed bug in DeadStoreElimination commit r144239
Size of data being pointed to wasn't always being checked so some small writes were killing big writes

Fixes <rdar://problem/10426753>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144312 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-10 20:22:08 +00:00
Pete Cooper
5ccb0825ed DeadStoreElimination can now trim the size of a store if the end of the store is dead.
Currently checks alignment and killing stores on a power of 2 boundary as this is likely
to trim the size of the earlier store without breaking large vector stores into scalar ones.

Fixes <rdar://problem/10140300>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144239 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-09 23:07:35 +00:00
Pete Cooper
2d76a78462 LICM pass now understands invariant load metadata. Nothing generates this yet so it will currently never get used in real tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144107 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-08 19:30:00 +00:00
Pete Cooper
a29fc806fe InstCombine now optimizes vector udiv by power of 2 to shifts
Fixes r8429


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144036 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-07 23:04:49 +00:00
Bill Wendling
ac101e5848 Make sure we don't insert instructions before a landingpad instruction.
<rdar://problem/10405911>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144000 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-07 19:38:34 +00:00
Nick Lewycky
336b88dac8 Do simple cross-block DSE when we encounter a free statement. Fixes PR11240.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143808 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-05 10:48:42 +00:00
Daniel Dunbar
28eb1c5217 Speculatively revert "DeadStoreElimination can now trim the size of a store if
the end of it is dead.", which appears to break bootstrapping LLVM.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143668 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-04 00:48:26 +00:00
Daniel Dunbar
a3a2dfd4a2 build: Add initial cut at LLVMBuild.txt files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143634 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-03 18:53:17 +00:00
Pete Cooper
2d32b86543 DeadStoreElimination can now trim the size of a store if the end of it is dead.
Only currently done if the later store is writing to a power of 2 address or 
has the same alignment as the earlier store as then its likely to not break up
large stores into smaller ones

Fixes <rdar://problem/10140300>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143630 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-03 18:01:56 +00:00
Andrew Trick
d3714b60b5 Rewrite LinearFunctionTestReplace to handle pointer-type IVs.
We've been hitting asserts in this code due to the many supported
combintions of modes (iv-rewrite/no-iv-rewrite) and IV types. This
second rewrite of the code attempts to deal with these cases systematically.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143546 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-02 17:19:57 +00:00
Chandler Carruth
94dffd2bb0 Add parentheses to disambiguate the precedence of these operations and
silence -Wparentheses.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143534 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-02 05:43:44 +00:00
Andrew Trick
3129da8d1a Broaden an assert to handle enable-iv-rewrite=true following r143183.
Narrowest possible fix for PR11279.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143522 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-02 00:02:45 +00:00
Eli Friedman
049260d9e2 Make sure we use the right insertion point when instcombine replaces a PHI with another instruction. (Specifically, don't insert an arbitrary instruction before a PHI.) Fixes PR11275.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143437 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-01 04:49:29 +00:00
Devang Patel
2ad3f93b5f Add utility to append a function to the list of global constructors.
Patch by Kostya Serebryany.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143405 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-31 23:58:51 +00:00
Benjamin Kramer
59e43bde28 SimplifyLibCalls: Use IRBuilder.CreateGlobalString when creating a string for printf->puts, which correctly sets the unnamed_addr bit on the resulting GlobalVariable.
Fixes PR11264.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143289 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-29 19:43:31 +00:00
Andrew Trick
6f2dd7ebcf LFTR should avoid a type mismatch with null pointer IVs.
Fixes rdar://10359193 Indvar LinearFunctionTestReplace assertion


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143183 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-28 03:45:11 +00:00
Eli Friedman
8ecde6cbf8 It is not safe to sink an alloca into a stacksave/stackrestore pair, so don't do that. <rdar://problem/10352360>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143093 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-27 01:33:51 +00:00
Nick Lewycky
4a3935c27e A dead malloc, a free(NULL) and a free(undef) are all trivially dead
instructions.

This doesn't introduce any optimizations we weren't doing before (except
potentially due to pass ordering issues), now passes will eliminate them sooner
as part of their own cleanups.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142787 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-24 04:35:36 +00:00
Cameron Zwarich
90747e34e6 The element insertion code in scalar replacement doesn't handle incorrect
element types, even though the element extraction code does. It is surprising
that this bug has been here for so long. Fixes <rdar://problem/10318778>.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142740 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-23 07:02:10 +00:00
Nick Lewycky
4d882aae2a A non-escaping malloc in the entry block is not unlike an alloca. Do dead-store
elimination on them too.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142735 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-22 21:59:35 +00:00
Eli Friedman
4090e1ce91 Remap blockaddress correctly when inlining a function. Fixes PR10162.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142684 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-21 20:45:19 +00:00
Eli Friedman
8d992f5c2c Minor simplification: use ShuffleVectorInst::getMaskValue instead of a more expensive helper.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142672 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-21 19:11:34 +00:00
Eli Friedman
d2822e7572 Extend instcombine's shufflevector simplification to handle more cases where the input and output vectors have different sizes. Patch by Xiaoyi Guo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142671 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-21 19:06:29 +00:00
Eli Friedman
c66330504c Refactor code from inlining and globalopt that checks whether a function definition is unused, and enhance it so it can tell that functions which are only used by a blockaddress are in fact dead. This probably doesn't happen much on most code, but the Linux kernel's _THIS_IP_ can trigger this issue with blockaddress. (GlobalDCE can also handle the given tescase, but we only run that at -O3.) Found while looking at PR11180.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142572 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-20 05:23:42 +00:00
Devang Patel
9be72d4394 Initialze ScalarEvalution dependency.
Patch by Pranav Bhandarkar!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142556 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-19 23:56:07 +00:00
Dan Gohman
a974beaa1f Teach the ARC optimizer about the !clang.arc.copy_on_escape metadata
tag on objc_retainBlock calls, which indicates that they may be
optimized away. rdar://10211286.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142298 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-17 22:53:25 +00:00
Bill Wendling
76f267df17 Add support for the Objective-C personality function to the instruction
combining of the landingpad instruction. The ObjC personality function acts
almost identically to the C++ personality function. In particular, it uses
"null" as a "catch-all" value.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142256 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-17 21:20:24 +00:00
Dan Gohman
90b8bcd33a Suppress partial retain+release elimination when there's a
possibility that it will span multiple CFG diamonds/triangles which
could have different controlling predicates.  rdar://10282956


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142222 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-17 18:48:25 +00:00
Bill Wendling
3c5e60994f Correct over-zealous removal of hack.
Some code want to check that *any* call within a function has the 'returns
twice' attribute, not just that the current function has one.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142221 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-17 18:43:40 +00:00
Bill Wendling
728662f9e8 Now that we have the ReturnsTwice function attribute, this method is
obsolete. Check the attribute instead.
<rdar://problem/8031714>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142212 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-17 18:22:52 +00:00
Michael J. Spencer
9904056a70 Fix CMake build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142204 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-17 17:50:39 +00:00
Devang Patel
827454e6e2 svn mv Target/ARM/ARMGlobalMerge.cpp Transforms/Scalar/GlobalMerge.cpp
There is no reason to have simple IR level pass in lib/Target.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142200 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-17 17:17:43 +00:00
Chandler Carruth
602650c988 Add a routine to swap branch instruction operands, and update any
profile metadata at the same time. Use it to preserve metadata attached
to a branch when re-writing it in InstCombine.

Add metadata to the canonicalize_branch InstCombine test, and check that
it is tranformed correctly.

Reviewed by Nick Lewycky!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142168 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-17 01:11:57 +00:00
Chandler Carruth
5820d62803 Add a proper LLVM banner to this file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142162 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-16 22:15:07 +00:00
Nick Lewycky
36c7e6c36c When looking for dependencies on the src pointer, scan the src pointer. Scanning
on the memcpy call will pull up other unrelated stuff. Fixes PR11142.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142150 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-16 20:13:32 +00:00
Duncan Sands
1673b15da2 Don't replace all dominated uses if there is only one use, since that
use can't be dominated, saving one domtree lookup.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142066 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-15 11:13:42 +00:00
Andrew Trick
513b1f47c1 Fix indvars randomness by removing iteration over a map.
I rewrote the algorithm a while back so it doesn't require map lookup,
but neglected to change the data structure. This was caught by
llvm-gcc self host, not because there's anything special about
llvm-gcc, but because it is the only test for nondeterminism we
currently have. Unit tests don't work well for everything; we should
always try to have a nondeterminism stress test running.

Fixes PR11133: llvm-gcc self host .o mismatch after enable-iv-rewrite=false


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142036 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-15 01:38:14 +00:00
Eli Friedman
dae36ba802 Avoid undefined behavior in negation in LSR. Patch by Ahmed Charles.
Someone more familiar with LSR should double-check that the extra cast is actually doing the right thing in the overflow cases; I'm not completely confident that's that case. 



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141916 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-13 23:48:33 +00:00
Eli Friedman
b414142036 Enhance the memdep interface so that users can tell the difference between a dependency which cannot be calculated and a path reaching the entry point of the function. This patch introduces isNonFuncLocal, which replaces isUnknown in some cases.
Patch by Xiaoyi Guo.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141896 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-13 22:14:57 +00:00
Eli Friedman
18ead6b587 Fix a couple hash functions so that they do not depend on undefined shifts. Based on patch by Ahmed Charles.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141820 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-12 22:00:26 +00:00
Nick Lewycky
865703e53a Add missing space.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141750 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-12 00:14:31 +00:00
Cameron Zwarich
c055a8782e Fix PR11106 by correcting a typo that has been in the code for over a year. This
would have never worked, since the element type of a vector type is never a
vector type. Also fix the conditional to be more direct in checking whether
EltTy is a vector type.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141713 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-11 21:26:40 +00:00
Cameron Zwarich
446d95224b Remove a lot of the fancy scalar replacement code for dealing with llvm-gcc's
lowering of NEON code. It provides little-to-no benefit now and only introduces
additional complexity.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141646 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-11 06:10:30 +00:00
Andrew Trick
a02bfced06 Add experimental -enable-lsr-phielim option.
I'm not sure we will need it in the long run, but the option is
currently useful for checking if the output of LSR is "clean".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141634 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-11 02:30:45 +00:00
Andrew Trick
204494149b Move replaceCongruentIVs into SCEVExapander and bias toward "expanded"
IVs.

Indvars previously chose randomly between congruent IVs. Now it will
bias the decision toward IVs that SCEVExpander likes to create. This
was not done to fix any problem, it's just a welcome side effect of
factoring code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141633 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-11 02:28:51 +00:00
Lang Hames
bb5b3f3359 Add a natural stack alignment field to TargetData, and prevent InstCombine from
promoting allocas to preferred alignments that exceed the natural
alignment. This avoids some potentially expensive dynamic stack realignments.

The natural stack alignment is set in target data strings via the "S<size>"
option. Size is in bits and must be a multiple of 8. The natural stack alignment
defaults to "unspecified" (represented by a zero value), and the "unspecified"
value does not prevent any alignment promotions. Target maintainers that care
about avoiding promotions should explicitly add the "S<size>" option to their
target data strings.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141599 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-10 23:42:08 +00:00
Andrew Trick
c570191060 LSR should only reuse phis that match its formula.
Fixes rdar://problem/5064068


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141442 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-07 23:46:21 +00:00
Duncan Sands
3f329cb781 Teach GVN to also propagate switch cases. For example, in this code
switch (n) {
    case 27:
      do_something(x);
    ...
  }
the call do_something(x) will be replaced with do_something(27).  In
gcc-as-one-big-file this results in the removal of about 500 lines of
bitcode (about 0.02%), so has about 1/10 of the effect of propagating
branch conditions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141360 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-07 08:29:06 +00:00
Eli Friedman
8540101252 Remove the old atomic instrinsics. autoupgrade functionality is included with this patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141333 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-06 23:20:49 +00:00
Eli Friedman
792860883e PR11061: Make simplifylibcalls fold strcmp("", x) correctly.
While I'm here, fix the related issue with strncmp, add some actual tests for strcmp and strncmp, and start using StringRef::compare for constant folding instead of using strcmp/strncmp so that the optimized IR isn't dependent on the host's implementation of strcmp.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141227 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-05 22:27:16 +00:00
Jim Grosbach
35d9da3d3b Re-commit 141203, but much more conservative.
Just pull the instruction name, but don't change the order of anything
else. That keeps --debug happy and non-crashing, but doesn't change
how the worklist gets built.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141210 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-05 20:53:43 +00:00
Jim Grosbach
e2999b4899 Revert 141203. InstCombine is looping on unit tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141209 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-05 20:44:29 +00:00
Jim Grosbach
30c1ff234d Update InstCombine worklist after instruction transform is complete.
When updating the worklist for InstCombine, the Add/AddUsersToWorklist
functions may access the instruction(s) being added, for debug output for
example. If the instructions aren't yet added to the basic block, this
can result in a crash. Finish the instruction transformation before
adjusting the worklist instead.

rdar://10238555


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141203 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-05 20:05:00 +00:00
Duncan Sands
02b5e72ac6 GVN does simple propagation of conditions: when it sees a conditional
branch "br i1 %x, label %if_true, label %if_false" then it replaces
"%x" with "true" in places only reachable via the %if_true arm, and
with "false" in places only reachable via the %if_false arm.  Except
that actually it doesn't: if value numbering shows that %y is equal
to %x then, yes, %y will be turned into true/false in this way, but
any occurrences of %x itself are not transformed.  Fix this.  What's
more, it's often the case that %x is an equality comparison such as
"%x = icmp eq %A, 0", in which case every occurrence of %A that is
only reachable via the %if_true arm can be replaced with 0.  Implement
this and a few other variations on this theme.  This reduces the number
of lines of LLVM IR in "GCC as one big file" by 0.2%.  It has a bigger
impact on Ada code, typically reducing the number of lines of bitcode
by around 0.4% by removing repeated compiler generated checks.  Passes
the LLVM nightly testsuite and the Ada ACATS testsuite.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141177 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-05 14:28:49 +00:00
Duncan Sands
452c58f4c4 Generalize GVN's conditional propagation logic slightly:
it's OK for the false/true destination to have multiple
predecessors as long as the extra ones are dominated by
the branch destination.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141176 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-05 14:17:01 +00:00
Andrew Trick
f143b79b78 LSR should avoid redundant edge splitting.
This handles the case in which LSR rewrites an IV user that is a phi and
splits critical edges originating from a switch.
Fixes <rdar://problem/6453893> LSR is not splitting edges "nicely"


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141059 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-04 03:50:44 +00:00
Andrew Trick
2aeb8027d6 whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141058 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-04 03:34:49 +00:00
Nick Lewycky
11357d4f40 Add a new icmp+select optz'n. Also shows off the load(cst) folding added in
r140966.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140969 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-02 10:37:37 +00:00
Nick Lewycky
267236ade3 Enhance a couple places where we were doing constant folding of instructions,
but not load instructions. Noticed by inspection.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140966 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-02 09:12:55 +00:00
Andrew Trick
b2ab2fa524 Inlining and unrolling heuristics should be aware of free truncs.
We want heuristics to be based on accurate data, but more importantly
we don't want llvm to behave randomly. A benign trunc inserted by an
upstream pass should not cause a wild swings in optimization
level. See PR11034. It's a general problem with threshold-based
heuristics, but we can make it less bad.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140919 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-01 01:39:05 +00:00
Andrew Trick
5c655413cf whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140916 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-01 01:27:56 +00:00
Jim Grosbach
68e05fb368 Don't modify constant in-place.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140875 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-30 19:58:46 +00:00
Jim Grosbach
cbf676b3ba float comparison to double 'zero' constant can just be a float 'zero.'
InstCombine was incorrectly considering the conversion of the constant
zero to be unsafe.

We want to transform:
define float @bar(float %x) nounwind readnone optsize ssp {
  %conv = fpext float %x to double
  %cmp = fcmp olt double %conv, 0.000000e+00
  %conv1 = zext i1 %cmp to i32
  %conv2 = sitofp i32 %conv1 to float
  ret float %conv2
}

Into:
define float @bar(float %x) nounwind readnone optsize ssp {
  %cmp = fcmp olt float %x, 0.000000e+00   ; <---- This
  %conv1 = zext i1 %cmp to i32
  %conv2 = sitofp i32 %conv1 to float
  ret float %conv2
}


rdar://10215914


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140869 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-30 18:45:50 +00:00
Jim Grosbach
0cc4a958f3 Tidy up. Trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140865 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-30 18:09:53 +00:00
Duncan Sands
0ad7b6e773 Inlining often produces landingpad instructions with repeated
catch or repeated filter clauses.  Teach instcombine a bunch
of tricks for simplifying landingpad clauses.  Currently the
code only recognizes the GNU C++ and Ada personality functions,
but that doesn't stop it doing a bunch of "generic" transforms
which are hopefully fine for any real-world personality function.
If these "generic" transforms turn out not to be generic, they
can always be conditioned on the personality function.  Probably
someone should add the ObjC++ personality function.  I didn't as
I don't know anything about it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140852 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-30 13:12:16 +00:00
Nick Lewycky
48105286cb Fold two identical set lookups into one. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140821 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-29 23:40:12 +00:00
Dan Gohman
27e0666725 When eliminating unnecessary retain+autorelease on return values,
handle the case where the retain is in a different basic block.
rdar://10210274.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140815 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-29 22:27:34 +00:00
Dan Gohman
597fece886 Don't eliminate objc_retainBlock calls on stack objects if the
objc_retainBlock call is potentially responsible for copying
the block to the heap to extend its lifetime. rdar://10209613.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140814 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-29 22:25:23 +00:00
Eli Friedman
bb5a7442e3 Clean up uses of switch instructions so they are not dependent on the operand ordering. Patch by Stepan Dyatkovskiy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140803 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-29 20:21:17 +00:00
Andrew Trick
5219f86a0b typo + pasto
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140769 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-29 01:53:08 +00:00
Andrew Trick
0c01bc385a LSR: rewrite inner loops only.
Rewriting the entire loop nest now requires -enable-lsr-nested.
See PR11035 for some performance data.
A few unit tests specifically test nested LSR, and are now under a flag.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140762 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-29 01:33:38 +00:00
Andrew Trick
909ef7db3d indvars should hoist [sz]ext because licm is not rerun.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140670 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-28 01:35:36 +00:00
Benjamin Kramer
a9390a4d5f Stop emitting instructions with the name "tmp" they eat up memory and have to be uniqued, without any benefit.
If someone prefers %tmp42 to %42, run instnamer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140634 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-27 20:39:19 +00:00
Bill Wendling
d5520987d1 Split the landing pad basic block with the correct function. Also merge the
split landingpad instructions into a PHI node.
PR11016


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140592 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-27 00:59:31 +00:00
Andrew Trick
80ef1b287f Disable LSR retry by default.
Disabling aggressive LSR saves compilation time, and with the new
indvars behavior usually improves performance.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140590 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-27 00:44:14 +00:00
Andrew Trick
25b689e067 LSR, one of the new Cost::isLoser() checks did not get merged in the previous checkin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140583 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-26 23:35:25 +00:00
Andrew Trick
7d11bd850f LSR cost metric minor fix and verification.
The minor bug heuristic was noticed by inspection. I added the
isLoser/isValid helpers because they will become more
important with subsequent checkins.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140580 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-26 23:11:04 +00:00
Andrew Trick
b5b7c96ce4 LSR minor bug fix in RateRegister.
No test case. Noticed by inspection and I doubt it ever affects the
outcome of the overall heuristic, let alone final codegen.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140431 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-23 23:05:19 +00:00
Eli Friedman
d102a03b36 PR10987: add a missed safety check to isSafePHIToSpeculate in scalarrepl.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140327 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-22 18:56:30 +00:00
Eli Friedman
79782fc864 Make sure IPSCCP never marks a tracked call as overdefined in SCCPSolver::ResolvedUndefsIn. If we do, we can end up in a situation where a function is resolved to return a constant, but the caller is marked overdefined, which confuses the code later.
<rdar://problem/9956541> (again).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140210 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-20 23:28:51 +00:00
Bill Wendling
f0dc257a8f Relax this condition.
Some passes require breaking critical edges before they're called. Don't
segfault because of that.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140196 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-20 22:28:17 +00:00
Bill Wendling
b7e807f9a9 Place the check for an exit landing pad where it will be run on both code paths through the if-then-else.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140195 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-20 22:27:16 +00:00
Bill Wendling
84b6706d90 Omit extracting a loop if one of the exits is a landing pad.
The landing pad must accompany the invoke when it's extracted. However, if it
does, then the loop isn't properly extracted. I.e., the resulting extraction has
a loop in it. The extracted function is then extracted, etc. resulting in an
infinite loop.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140193 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-20 22:23:09 +00:00
Bill Wendling
8c93d5b602 Check the terminator, not the basic block.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140176 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-20 20:20:50 +00:00
Bill Wendling
2f1cd85598 When extracting a basic block that ends in an 'invoke' instruction, we need to
extract its associated landing pad block as well. However, that landing pad
block may have more than one predecessor. So split the landing pad block so that
individual landing pads have only one predecessor.

This type of transformation may produce a false positive with bugpoint.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140173 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-20 19:10:24 +00:00
Bill Wendling
9e7013a506 Use ArrayRef instead of an explicit 'const std::vector &'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140172 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-20 19:05:04 +00:00
Devang Patel
680018ff89 If simple ownership works then friendship is not required.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140169 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-20 18:48:56 +00:00
Bill Wendling
51bae90289 Use ArrayRef instead of 'const std::vector' to pass around the list of basic blocks to extract.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140168 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-20 18:42:07 +00:00
Devang Patel
16c19a155c Update GCOVLines to provide interfaces to write line table and calculate complete length.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140167 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-20 18:35:00 +00:00
Bill Wendling
b6777eae58 Fix comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140164 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-20 18:24:46 +00:00
Devang Patel
29d9610f23 Update comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140156 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-20 18:05:45 +00:00
Devang Patel
68155d31cd Use StringRef instead of std::string.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140154 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-20 17:55:19 +00:00
Devang Patel
865375ca7f Eliminate unnecessary copy of FileName from GCOVLines.
GCOVLines is always accessed through a StringMap where the key is FileName.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140151 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-20 17:43:14 +00:00
Devang Patel
ec6f2559fe There is no need to write a local utility routine to find subprogram info if the utility routine is already available in DebugInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140145 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-20 15:57:19 +00:00
Bill Wendling
a846585050 Revert r140083 and r140084 until buildbots can be fixed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140094 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-19 23:30:41 +00:00
Bill Wendling
ad027053fe If we are extracting a basic block that ends in an invoke call, we must also
extract the landing pad block. Otherwise, there will be a situation where the
invoke's unwind edge lands on a non-landing pad.

We also forbid the user from extracting the landing pad block by itself. Again,
this is not a valid transformation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140083 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-19 23:00:52 +00:00
Eli Friedman
c6b8ba8673 Fix an infinite loop where a transform in InstCombiner::visitAnd claims a construct is changed when it is not. (See included testcase.)
Patch by Xiaoyi Guo.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140072 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-19 21:58:15 +00:00
Andrew Trick
24f48ece52 [indvars] Fix PR10946: SCEV cannot handle Vector IVs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140026 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-19 17:54:39 +00:00
Andrew Trick
b0598b14aa Reapply r139759. Disable IV rewriting by default. See PR10916.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139842 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-15 20:58:37 +00:00
Eli Friedman
c82751dd67 Make demanded-elt simplification for shufflevector slightly stronger. Spotted by inspection.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139768 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-15 01:14:29 +00:00
Dan Gohman
1d2fd75e3b Don't mark objc_retainBlock as nounwind. It calls user copy constructors
which could theoretically throw.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139710 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-14 18:33:34 +00:00
Dan Gohman
211048286b objc_retainBlock is not NoModRef because it can update forwarding pointers
in memory relevant to the optimizer. rdar://10050579.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139708 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-14 18:13:00 +00:00
Andrew Trick
effb647154 [indvars] Revert r139579 until 401.bzip -arch i386 miscompilation is fixed. PR10920.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139583 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-13 05:23:49 +00:00
Andrew Trick
dd9d758a31 Disable IV rewriting by default. See PR10916.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139579 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-13 03:23:21 +00:00
Andrew Trick
94f2c23d24 [indvars] Fix bugs in floating point IV range checks noticed by inspection.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139574 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-13 01:59:32 +00:00
Eli Friedman
1582e7f1e2 Add comment to clarify the behavior of a helper in DSE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139571 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-13 01:28:59 +00:00
Eli Friedman
5ac7c7da3e Correct grammar.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139565 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-13 00:44:16 +00:00
Eli Friedman
2bc3d52b9a Change a bunch of isVolatile() checks to check for atomic load/store as well.
No tests; these changes aren't really interesting in the sense that the logic is the same for volatile and atomic.

I believe this completes all of the changes necessary for the optimizer to handle loads and stores correctly.  I'm going to try and come up with some additional testing, though.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139533 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-12 20:23:13 +00:00
Andrew Trick
f21bdf4f42 Rename -disable-iv-rewrite to -enable-iv-rewrite=false in preparation for default change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139517 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-12 18:28:44 +00:00
Andrew Trick
20151da8c3 [disable-iv-rewrite] Allow WidenIV to handle NSW/NUW operations
better.

Don't immediately give up when an add operation can't be trivially
sign/zero-extended within a loop. If it has NSW/NUW flags, generate a
new expression with sign extended (non-recurrent) operand. As before,
if SCEV says that all sign extends are loop invariant, then we can
widen the operation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139453 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-10 01:24:17 +00:00
Andrew Trick
39d7802224 Comment formatting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139375 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-09 17:35:10 +00:00
Andrew Trick
75ebc0ec20 Add -verify-indvars for imperfect SCEV trip count verification after indvars.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139169 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-06 20:20:38 +00:00
Devang Patel
2048c379dd Use IRBuilder.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139156 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-06 18:49:53 +00:00
Owen Anderson
81856f7313 Try again at r138809 (make DSE more aggressive in removing dead stores at the end of a function), now with less deleting stores before memcpy's.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139150 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-06 18:14:09 +00:00
Duncan Sands
4a544a79bd Split the init.trampoline intrinsic, which currently combines GCC's
init.trampoline and adjust.trampoline intrinsics, into two intrinsics
like in GCC.  While having one combined intrinsic is tempting, it is
not natural because typically the trampoline initialization needs to
be done in one function, and the result of adjust trampoline is needed
in a different (nested) function.  To get around this llvm-gcc hacks the
nested function lowering code to insert an additional parent variable
holding the adjust.trampoline result that can be accessed from the child
function.  Dragonegg doesn't have the luxury of tweaking GCC code, so it
stored the result of adjust.trampoline in the memory GCC set aside for
the trampoline itself (this is always available in the child function),
and set up some new memory (using an alloca) to hold the trampoline.
Unfortunately this breaks Go which allocates trampoline memory on the
heap and wants to use it even after the parent has exited (!).  Rather
than doing even more hacks to get Go working, it seemed best to just use
two intrinsics like in GCC.  Patch mostly by Sanjoy Das.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139140 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-06 13:37:06 +00:00
Duncan Sands
ad99ef8bf5 Delete trivial landing pads that just continue unwinding the caught
exception.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139117 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-05 12:57:57 +00:00
Bill Wendling
a268468d50 Use Duncan's patch to delete the instructions in reverse order (minus the landingpad and terminator).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139090 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-04 09:43:36 +00:00
Bill Wendling
9dc31e8705 Update comments to reflect reality.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139023 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-02 18:43:33 +00:00
Andrew Trick
12d1ebe943 Enable SCEV-based unrolling by default.
This changes loop unrolling to use the same mechanism for trip count
computation as indvars. This is a stronger check that tends to unroll
more loops. A very common side-effect is that many single iteration
loops will be removed sooner. The real goal was simply to remove
dependence on canonical IVs.

x86 is break even.
ARM performance changes to expect (+ is good):
External/SPEC/CFP2000/183.equake/183.equake +13%
SingleSource/Benchmarks/Dhrystone/fldry     +21%
MultiSource/Applications/spiff/spiff         +3%
SingleSource/Benchmarks/Stanford/Puzzle     -14%

The Puzzle regression is actually an improvement in loop optimization
that defeats GVN: rdar://problem/10065079.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139009 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-02 17:26:28 +00:00
Jakub Staszak
8cec759339 Compare type size instead of type _store_ size to make sure that BitCastInst
will be valid. This fixes PR10820.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139005 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-02 14:57:37 +00:00
Bill Wendling
6bb4e7e8e8 Reduce indentation. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138968 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-01 21:29:49 +00:00
Bill Wendling
c8c0fd3993 Change worklist driven deletion to be an iterative process.
Duncan noticed this!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138967 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-01 21:28:33 +00:00
Eli Friedman
86b5db8c01 Fix an issue with the IR sink pass found by inspection. (I'm not sure anyone is actually using this, but might as well fix it since I found the issue.)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138965 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-01 21:21:24 +00:00
Bill Wendling
a8d1393093 Resubmit with fix. Properly remove the instructions except for landingpad, which should be removed only when its invokes are.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138932 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-01 01:28:11 +00:00
Bill Wendling
c1b4cd6c11 Submitted this too early.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138931 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-01 01:18:33 +00:00
Bill Wendling
1893cd3131 Don't DCE the landingpad instruction.
The landingpad instruction can be removed only when its invokes are removed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138930 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-01 01:16:58 +00:00
Bill Wendling
4f8aaa0928 Make sure we aren't deleting the landingpad instruction.
The landingpad instruction is required in the landing pad block. Because we're
not deleting terminating instructions, the invoke may still jump to here (see
Transforms/SCCP/2004-11-16-DeadInvoke.ll). Remove all uses of the landingpad
instruction, but keep it around until code-gen can remove the basic block.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138890 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-31 20:55:20 +00:00
Rafael Espindola
f940a1a869 Remove the old tail duplication pass. It is not used and is unable to update
ssa, so it has to be run really early in the pipeline. Any replacement
should probably use the SSAUpdater.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138841 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-30 23:03:45 +00:00
Owen Anderson
54c4735db3 Speculatively revert r138809 in an attempt to fix DragonEgg.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138829 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-30 21:11:06 +00:00
Owen Anderson
6e4be237b0 When walking backwards to eliminate final stores to allocas at the end of a function, encountering an unrelated store should not cause us to give up like encountering a load does.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138809 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-30 18:51:55 +00:00
Nadav Rotem
89879ec76b Fixes following the CR by Chris and Duncan:
Optimize chained bitcasts of the form A->B->A.
Undo r138722 and change isEliminableCastPair to allow this case.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138756 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-29 19:58:36 +00:00
Nadav Rotem
be6ceb6ebc Bitcasts are transitive. Bitcast-Bitcast-X becomes Bitcast-X.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138722 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-28 11:51:08 +00:00
Bill Wendling
2b18881185 Don't sink landingpad instructions during ind-var simplification.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138651 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-26 20:40:15 +00:00
Benjamin Kramer
9bb5488dbd Address review comments.
- Reword comments.
- Allow undefined behavior interfering with undefined behavior.
- Add address space checks.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138619 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-26 02:25:55 +00:00
Benjamin Kramer
98d6d2372f SimplifyCFG: If we have a PHI node that can evaluate to NULL and do a load or store to the address returned by the PHI node then we can consider this incoming value as dead and remove the edge pointing there, unless there are instructions that can affect control flow executed in between.
In theory this could be extended to other instructions, eg. division by zero, but it's likely that it will "miscompile" some code because people depend on div by zero not trapping. NULL pointer dereference usually leads to a crash so we should be on the safe side.

This shrinks the size of a Release clang by 16k on x86_64.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138618 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-26 01:22:29 +00:00
Bill Wendling
8b6af8a2a9 LSR wants to split the landing pad's critical edge. Let it do it, but use the
proper function to do it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138550 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-25 05:55:40 +00:00
Bill Wendling
89d4411cef When inserting new instructions, use getFirstInsertionPt instead of
getFirstNonPHI so that it will skip over the landingpad instructions as well.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138537 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-25 01:08:34 +00:00
Bill Wendling
a4c86ab073 Skip the landingpad instruction when determining the insertion point.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138481 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-24 21:06:46 +00:00
Bill Wendling
b05fdd6bab Use getFirstInsertionPt instead of getFirstNonPHI so that it skips to the proper
insertion place.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138473 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-24 20:28:43 +00:00
Rafael Espindola
605e2b5184 Fix a crashing bug in SplitBlock when it is called on a block with no
dominator information even though dominators were previously computed.

Patch by Nick Sumner.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138449 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-24 18:07:01 +00:00
Dan Gohman
d446460f42 Add a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138243 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-22 17:29:37 +00:00
Dan Gohman
1b31ea8f93 Constant pointers to objects don't need reference counting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138242 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-22 17:29:11 +00:00
Bill Wendling
94657b964f If we're splitting the landing pad block and assigning it only one predecessor,
then don't split it a second time, since that block will be dead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138153 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-19 23:46:30 +00:00
Bill Wendling
cbe003b243 The landingpad instruction isn't dead simply because it's value isn't used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138102 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-19 21:52:06 +00:00