Commit Graph

450 Commits

Author SHA1 Message Date
Chris Lattner 06462efb47 reduce vec_shuffle2 and merge into vec_shuffle.
llvm-svn: 83807
2009-10-11 22:54:48 +00:00
Chris Lattner 6373045e7d filecheckize vec_shuffle.ll and merge shuffle.ll into it.
llvm-svn: 83806
2009-10-11 22:52:15 +00:00
Chris Lattner 79a2f91f65 filecheckize
llvm-svn: 83805
2009-10-11 22:45:17 +00:00
Chris Lattner 8308fd9aab rename test
llvm-svn: 83804
2009-10-11 22:44:16 +00:00
Chris Lattner e660ee0a3b remove old testcase
llvm-svn: 83803
2009-10-11 22:42:06 +00:00
Chris Lattner 1fe15dbbbb merge test into shift.ll, this also eliminates awful grepping on -stats output
llvm-svn: 83802
2009-10-11 22:39:58 +00:00
Chris Lattner d7969a2796 convert to filecheck.
llvm-svn: 83801
2009-10-11 22:36:59 +00:00
Chris Lattner c6cdbfbfdd teach instcombine to simplify xor's harder, catching the
new testcase.

llvm-svn: 83799
2009-10-11 22:22:13 +00:00
Chris Lattner 7db5b7893d convert xor2 to filecheck, merge in a random regtest
llvm-svn: 83796
2009-10-11 21:42:08 +00:00
Chris Lattner fd27f8a5b3 generalize a transformation even more: we don't care whether the
input the the mul is a zext from bool, just that it is all zeros
other than the low bit.  This fixes some phase ordering issues
that would cause us to miss some xforms in mul.ll when the worklist
is visited differently.

llvm-svn: 83794
2009-10-11 21:29:45 +00:00
Chris Lattner 406cb75c6b simplify a transformation by making it more general.
llvm-svn: 83792
2009-10-11 21:22:21 +00:00
Chris Lattner e374382b8f implement rdar://7293527, a trivial instcombine that llvm-gcc
gets but clang doesn't, because it is implemented in GCC's
fold routine.

llvm-svn: 83761
2009-10-11 07:53:15 +00:00
Chris Lattner 463716d559 instcombine shouldn't delete all null checks for mallocs.
This fixes PR5130.

llvm-svn: 83290
2009-10-05 02:47:47 +00:00
Chris Lattner 0261b5d2d2 The select instruction is not neccesarily in the same block as the
phi nodes.  Make sure to phi translate from the right block. 

This fixes a llvm-building-llvm failure on GVN-PRE.cpp

llvm-svn: 82970
2009-09-28 06:49:44 +00:00
Chris Lattner ae289632ef Enhance the previous fix for PR4895 to allow more values than just
simple constants for the true/false value of the select.  We now
do phi translation etc.  This really fixes PR4895 :)

llvm-svn: 82917
2009-09-27 20:18:49 +00:00
Chris Lattner facb867af3 implement PR4895, by making FoldOpIntoPhi handle select conditions
that are phi nodes.  Also tighten up FoldOpIntoPhi to treat constantexpr
operands to phis just like other variables, avoiding moving constantexpr
computations around.

Patch by Daniel Dunbar.

llvm-svn: 82913
2009-09-27 19:57:57 +00:00
Nick Lewycky b56e1ab033 Filecheckify this one test.
llvm-svn: 82888
2009-09-27 06:25:05 +00:00
Dale Johannesen f6a987b784 Handle sqrt in CannotBeNegativeZero. absf and absl
appear to be misspellings, removed in favor of fabs*.

llvm-svn: 82796
2009-09-25 20:54:50 +00:00
Victor Hernandez e6ff7662b6 Revert 82694 "Auto-upgrade malloc instructions to malloc calls." because it causes regressions in the nightly tests.
llvm-svn: 82784
2009-09-25 18:11:52 +00:00
Victor Hernandez 46cd467310 Auto-upgrade malloc instructions to malloc calls.
Reviewed by Devang Patel.

llvm-svn: 82694
2009-09-24 17:47:49 +00:00
Dan Gohman e5acc61f03 Fix the comment in this test.
llvm-svn: 82051
2009-09-16 16:33:59 +00:00
Dan Gohman 3b7ce109ec Don't sink gep operators through phi nodes if the result would require
more than one phi, since that leads to higher register pressure on
entry to the phi. This is especially problematic when the phi is in
a loop header, as it increases register pressure throughout the loop.

llvm-svn: 81993
2009-09-16 02:01:52 +00:00
Dan Gohman 1880092722 Change tests from "opt %s" to "opt < %s" so that opt doesn't see the
input filename so that opt doesn't print the input filename in the
output so that grep lines in the tests don't unintentionally match
strings in the input filename.

llvm-svn: 81537
2009-09-11 18:01:28 +00:00
Dan Gohman 21c6216c87 Teach lib/VMCore/ConstantFold.cpp how to set the inbounds keyword and
how to fold notionally-out-of-bounds array getelementptr indices instead
of just doing these in lib/Analysis/ConstantFolding.cpp, because it can
be done in a fairly general way without TargetData, and because not all
constants are visited by lib/Analysis/ConstantFolding.cpp. This enables
more constant folding.

Also, set the "inbounds" flag when the getelementptr indices are
one-past-the-end.

llvm-svn: 81483
2009-09-11 00:04:14 +00:00
Dan Gohman 7190d48075 Factor out the code for checking that all indices in a getelementptr are
within the notional bounds of the static type of the getelementptr (which
is not the same as "inbounds") from GlobalOpt into a utility routine,
and use it in ConstantFold.cpp to check whether there are any mis-behaved
indices.

llvm-svn: 81478
2009-09-10 23:37:55 +00:00
Dan Gohman c466e31309 Use "opt < %s" instead of "opt %s" to keep the testname away from the grep.
llvm-svn: 81299
2009-09-09 00:22:49 +00:00
Dan Gohman c8054d90fb Eliminate more uses of llvm-as and llvm-dis.
llvm-svn: 81293
2009-09-09 00:09:15 +00:00
Dan Gohman 22f339010c Use "opt < %s" instead of "opt %s" so that opt doesn't print the test
filename in the output, which interferes with the tests' grep lines.

llvm-svn: 81263
2009-09-08 22:57:49 +00:00
Dan Gohman 4f2527cd6d Convert a few more opt | llvm-dis to opt -S.
llvm-svn: 81261
2009-09-08 22:41:33 +00:00
Dan Gohman 72a13d2476 Use opt -S instead of piping bitcode output through llvm-dis.
llvm-svn: 81257
2009-09-08 22:34:10 +00:00
Chris Lattner 9ce1781ef4 remove an extremely dubious instcombine transformation of
extractelement(load).

llvm-svn: 81239
2009-09-08 18:48:01 +00:00
Dan Gohman 9737a63ed8 Change these tests to feed the assembly files to opt directly, instead
of using llvm-as, now that opt supports this.

llvm-svn: 81226
2009-09-08 16:50:01 +00:00
Chris Lattner d3210e1a20 instcombine transforms vector loads that are only used by
extractelement operations into a bitcast of the pointer,
then a gep, then a scalar load.  Disable this when the vector
only has one element, because it leads to infinite loops in
instcombine (PR4908).

This transformation seems like a really bad idea to me, as it
will likely disable CSE of vector load/stores etc and can be
better done in the code generator when profitable.  This
goes all the way back to the first days of packed types,
r25299 specifically.

I'll let those people who care about the performance of vector
code decide what to do with this.

llvm-svn: 81185
2009-09-08 03:44:51 +00:00
Chris Lattner 0cdbc7a2ca fix ComputeMaskedBits handling of zext/sext/trunc to work with vectors.
This fixes PR4905

llvm-svn: 81174
2009-09-08 00:13:52 +00:00
Daniel Dunbar 7fcfc4fc31 Don't depend on Tcl behavior of redirecting stderr for all commands in a
pipeline.

llvm-svn: 81153
2009-09-07 19:26:02 +00:00
Daniel Dunbar b9ea94c990 Eliminate uses of %prcontext.
- I'd appreciate it if someone else eyeballs my changes to make sure I captured
   the intent of the test.

llvm-svn: 81083
2009-09-05 11:35:16 +00:00
Chris Lattner 64b5842986 fix PR4837, some bugs folding vector compares. These
return a vector of i1, not i1 itself.

llvm-svn: 80761
2009-09-02 05:12:37 +00:00
Chris Lattner 4e3e930743 fix a bug I introduced with my 'instcombine builder' refactoring
changes: SimplifyDemandedBits can't use the builder yet because it
has the wrong insertion point.  This fixes a crash building
MultiSource/Benchmarks/PAQ8p

llvm-svn: 80537
2009-08-31 04:36:22 +00:00
Chris Lattner 9e371f4b8b suck a bunch more gep tests into getelementptr.ll and filecheckize them all.
llvm-svn: 80517
2009-08-30 21:31:34 +00:00
Chris Lattner 89a9bb77e2 consolodate various GEP tests into getelementptr.ll using filecheck.
llvm-svn: 80514
2009-08-30 21:02:36 +00:00
Chris Lattner 2708a312db another huge testcase, this time from 'gs' in llvm-test.
llvm-svn: 80513
2009-08-30 21:02:02 +00:00
Chris Lattner 3e1b67f62f remove another poorly-reduced testcase which came from ldecod in llvm-test.
llvm-svn: 80512
2009-08-30 21:01:14 +00:00
Chris Lattner 8a2905e132 this testcase is 500 lines long and is distilled from bzip2, just
remove it.

llvm-svn: 80511
2009-08-30 21:00:11 +00:00
Chris Lattner 4698e19cba convert to filecheck
llvm-svn: 80510
2009-08-30 20:48:15 +00:00
Chris Lattner 73913f4cd3 Fix PR4748: don't fold gep(bitcast(x)) into bitcast(gep) when x
is itself a bitcast.  Since we have gep(bitcast(bitcast(y))) in this
case, just wait for the two bitcasts to get zapped.  This prevents
instcombine from confusing some aliasing stuff, and allows it to
directly eliminate the load in the testcase.

llvm-svn: 80508
2009-08-30 20:38:21 +00:00
Dan Gohman 0d4bbf2c4a Remove obsolete -f flags.
llvm-svn: 79992
2009-08-25 15:38:29 +00:00
Dan Gohman 23e62c532c Change getelementptr folding to use APInt instead of uint64_t for
offset computations. This fixes a truncation bug on targets that
don't have 64-bit pointers.

llvm-svn: 79639
2009-08-21 16:52:54 +00:00
Dan Gohman c59ba42b0f Fix a bug in the over-index constant folding. When over-indexing an
array member of a struct, it's possible to land in an arbitrary position
inside that struct, such that attempting to find further getelementptr
indices will fail. In such cases, folding cannot be done.

llvm-svn: 79485
2009-08-19 22:46:59 +00:00
Dan Gohman 81ce842ecf Canonicalize indices in a constantexpr GEP. If Indices exceed the
static extents of the static array type, it causes GlobalOpt and
other passes to be more conservative. This canonicalization also
allows the constant folder to add "inbounds" to GEPs.

llvm-svn: 79440
2009-08-19 18:18:36 +00:00
Mon P Wang a95379d165 When InstCombine simplifies a load -> extract element to gep -> load, place
the new load by the old load instead of by the extract element because
a store could have occurred between the load and extract element.

llvm-svn: 78891
2009-08-13 05:12:13 +00:00