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

2560 Commits

Author SHA1 Message Date
Jim Grosbach
d35eaaeb6e 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

llvm-svn: 140869
2011-09-30 18:45:50 +00:00
Duncan Sands
14b9c222c6 Add forgotten tests that the cleanup flag is cleared if there
is a catch-all landingpad clause.

llvm-svn: 140858
2011-09-30 17:00:34 +00:00
Duncan Sands
b4c8b2d9fa 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.

llvm-svn: 140852
2011-09-30 13:12:16 +00:00
Dan Gohman
7dca165e93 When eliminating unnecessary retain+autorelease on return values,
handle the case where the retain is in a different basic block.
rdar://10210274.

llvm-svn: 140815
2011-09-29 22:27:34 +00:00
Dan Gohman
2df048a94b 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.

llvm-svn: 140814
2011-09-29 22:25:23 +00:00
Andrew Trick
5167b59724 Test case for r140670: indvars should hoist sext.
llvm-svn: 140671
2011-09-28 02:13:32 +00:00
Benjamin Kramer
355b353595 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.

llvm-svn: 140634
2011-09-27 20:39:19 +00:00
Bill Wendling
589336d854 Split the landing pad basic block with the correct function. Also merge the
split landingpad instructions into a PHI node.
PR11016

llvm-svn: 140592
2011-09-27 00:59:31 +00:00
Eli Friedman
56e68f7271 Convert more tests over to the new atomic instructions.
llvm-svn: 140559
2011-09-26 20:27:49 +00:00
Eli Friedman
ed450a3064 Upgrade a couple more tests to the new atomic instructions.
llvm-svn: 140558
2011-09-26 20:15:56 +00:00
Eli Friedman
6e15091fc6 PR10987: add a missed safety check to isSafePHIToSpeculate in scalarrepl.
llvm-svn: 140327
2011-09-22 18:56:30 +00:00
Eli Friedman
2599a202e2 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).

llvm-svn: 140210
2011-09-20 23:28:51 +00:00
Bill Wendling
296896eb2d Update this test to the new EH model.
Though I think it may be obsolete with the loop extract changes. And I couldn't
get the old version of LLVM to compile so that I could reduce this testcase.

llvm-svn: 140197
2011-09-20 22:29:43 +00:00
Bill Wendling
19257face9 Update to new EH model.
llvm-svn: 140177
2011-09-20 20:21:16 +00:00
Bill Wendling
58db2d7708 Update to the new EH syntax.
llvm-svn: 140103
2011-09-19 23:50:34 +00:00
Bill Wendling
86ea5a2df4 Dramatically reduce this testcase.
llvm-svn: 140101
2011-09-19 23:47:06 +00:00
Bill Wendling
a5db9cbefd Revert r140083 and r140084 until buildbots can be fixed.
llvm-svn: 140094
2011-09-19 23:30:41 +00:00
Bill Wendling
e54729ae4f Update test to remove the 'unwind' instruction.
llvm-svn: 140084
2011-09-19 23:01:11 +00:00
Bill Wendling
f1c054eace Replace uses of unwind with unreachable for the same effect.
llvm-svn: 140077
2011-09-19 22:16:15 +00:00
Bill Wendling
47fa03b39d Replace more uses of 'unwind' in the tests with calls to landingpad and
resume. Note that some of these tests were basically dead.

llvm-svn: 140076
2011-09-19 22:11:35 +00:00
Eli Friedman
9ed4ecaf4b 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.

llvm-svn: 140072
2011-09-19 21:58:15 +00:00
Bill Wendling
e821eb23cd This testcase is dead. It doesn't inline even if I add the 'alwaysinline'
attribute to the @foo function.

llvm-svn: 140067
2011-09-19 21:14:33 +00:00
Andrew Trick
856edc0ef5 [indvars] Fix PR10946: SCEV cannot handle Vector IVs.
llvm-svn: 140026
2011-09-19 17:54:39 +00:00
Andrew Trick
1dfb51c692 Reapply r139759. Disable IV rewriting by default. See PR10916.
llvm-svn: 139842
2011-09-15 20:58:37 +00:00
Eli Friedman
2109f34467 Make demanded-elt simplification for shufflevector slightly stronger. Spotted by inspection.
llvm-svn: 139768
2011-09-15 01:14:29 +00:00
Dan Gohman
223fdfc56f objc_retainBlock is not NoModRef because it can update forwarding pointers
in memory relevant to the optimizer. rdar://10050579.

llvm-svn: 139708
2011-09-14 18:13:00 +00:00
Andrew Trick
2e22ddc364 [indvars] Revert r139579 until 401.bzip -arch i386 miscompilation is fixed. PR10920.
llvm-svn: 139583
2011-09-13 05:23:49 +00:00
Andrew Trick
2bfa2824c6 Disable IV rewriting by default. See PR10916.
llvm-svn: 139579
2011-09-13 03:23:21 +00:00
Andrew Trick
3faad5fc36 Generalize test case to handle multiple indvars modes.
llvm-svn: 139578
2011-09-13 03:17:25 +00:00
Andrew Trick
2cc8637af2 [indvars] Fix bugs in floating point IV range checks noticed by inspection.
llvm-svn: 139574
2011-09-13 01:59:32 +00:00
Andrew Trick
cc7f5a609a Conditionalize indvars test that relies on SCEV expansion of geps,
which is only relevant with canonical IVs

llvm-svn: 139556
2011-09-12 23:13:57 +00:00
Andrew Trick
a3c28142a5 indvars test only relevant for -enable-iv-rewrite.
Otherwise this case is now covered by no-iv-rewrite.ll.

llvm-svn: 139552
2011-09-12 22:59:00 +00:00
Andrew Trick
bf1bc9a077 Conditionalize indvars tests that rely on SCEV expansion of geps,
which is relevant with canonical IVs. Anything else being checked by
these tests is already covered by early CSE.

llvm-svn: 139535
2011-09-12 20:26:34 +00:00
Andrew Trick
efe8cdcf20 Removing indvars tests that directly test canonical IVs and nothing else.
llvm-svn: 139518
2011-09-12 18:33:08 +00:00
Andrew Trick
09cf4287c2 Rename -disable-iv-rewrite to -enable-iv-rewrite=false in preparation for default change.
llvm-svn: 139517
2011-09-12 18:28:44 +00:00
Andrew Trick
19f9e653cd Test case for r139453, WidenIV::GetExtendedOperandRecurrence.
llvm-svn: 139504
2011-09-12 17:20:57 +00:00
Duncan Sands
6fc4c521c9 Mark the eh.typeid.for intrinsic as being 'const', which it is inside
any given function.  As pointed out by John McCall, this is needed to
have redundant eh.typeid.for tests be eliminated in the presence of
cleanups.

llvm-svn: 139360
2011-09-09 07:50:37 +00:00
Duncan Sands
b027f19035 When inlining exception handling code into another function, ensure that
duplicate tests are eliminated (for example if the two functions both have
a catch clause catching the same type, ensure the redundant one is removed).
Note that it would probably be safe to say that eh.typeid.for is 'const',
but since two calls to it with the same argument can give different results
(but only if the calls are in different functions), it seems more correct to
mark it only 'pure'; this doesn't get in the way of the optimization.

llvm-svn: 139236
2011-09-07 16:44:14 +00:00
Duncan Sands
ccd8b589f7 Forgot to add this trampoline testcase.
llvm-svn: 139229
2011-09-07 09:21:38 +00:00
Owen Anderson
ca0326a423 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.
llvm-svn: 139150
2011-09-06 18:14:09 +00:00
Duncan Sands
6939ae53ac 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.

llvm-svn: 139140
2011-09-06 13:37:06 +00:00
Benjamin Kramer
ec933b857e InstSimplify: Don't try to replace an extractvalue/insertvalue pair with the original value if types don't match.
Fixes clang selfhost.

llvm-svn: 139120
2011-09-05 18:16:19 +00:00
Duncan Sands
d883f9f371 Delete trivial landing pads that just continue unwinding the caught
exception.

llvm-svn: 139117
2011-09-05 12:57:57 +00:00
Duncan Sands
a74d10bb60 Add some simple insertvalue simplifications, for the purpose of cleaning
up do-nothing exception handling code produced by dragonegg.

llvm-svn: 139113
2011-09-05 06:52:48 +00:00
Bill Wendling
145872a92c Try to eliminate the use of the 'unwind' instruction.
llvm-svn: 139046
2011-09-02 22:41:11 +00:00
Andrew Trick
f449c87835 Test case update for unroll-scev.
llvm-svn: 139037
2011-09-02 21:21:03 +00:00
Jakub Staszak
fef314417c Extra CHECK-NOT to make sure that GVN transform works properly.
llvm-svn: 139012
2011-09-02 17:40:39 +00:00
Andrew Trick
88877293d1 -unroll-scev flag removal
llvm-svn: 139010
2011-09-02 17:36:14 +00:00
Jakub Staszak
132e24bf28 ConstantVector returns arbitrary value for the wrong index.
This fixes PR10813.

llvm-svn: 139006
2011-09-02 15:43:43 +00:00
Jakub Staszak
b82758ae9b Compare type size instead of type _store_ size to make sure that BitCastInst
will be valid. This fixes PR10820.

llvm-svn: 139005
2011-09-02 14:57:37 +00:00