Commit Graph

9019 Commits

Author SHA1 Message Date
Devang Patel 7771b7c621 If a instruction belongs to another function (and not current function) as per debug info attached with the instruction then ignore the dangling lexical scope of this instruction. Such scopes are unreachable.
llvm-svn: 93967
2010-01-20 02:05:23 +00:00
Dan Gohman 954f49014d Fold (add x, shl(0 - y, n)) -> sub(x, shl(y, n)), to simplify some code
that SCEVExpander can produce when running on behalf of LSR.

llvm-svn: 93949
2010-01-19 23:30:49 +00:00
Dan Gohman 221708d826 Make SCEVAddRecExpr's getType return a pointer type when the add
has a pointer member. This helps reduce unnecessary bitcasting
and uglygeps.

llvm-svn: 93939
2010-01-19 22:53:50 +00:00
Dan Gohman fb9bea7150 Add nounwinds.
llvm-svn: 93919
2010-01-19 21:51:51 +00:00
Jakob Stoklund Olesen bdc17f6840 Remove predicates when changing an add into an unpredicable mov.
Since the mov is executed unconditionally, make sure that the add didn't have
any predicate.

llvm-svn: 93909
2010-01-19 21:08:28 +00:00
Evan Cheng bf43525a29 Do not extend extension results beyond the use of a PHI instruction at the start of a use block. A PHI use is expected to kill its source values.
llvm-svn: 93895
2010-01-19 19:45:51 +00:00
Chris Lattner 4340cb3246 add an MCAsmStreamer::EmitFill specialization of EmitFill that
emits one directive instead of N.  Not doing this would be a
significant regression on the # bytes generated by .fill.

llvm-svn: 93889
2010-01-19 18:52:28 +00:00
Chris Lattner 18f49ce2d3 optimize ~(~X >>s Y) --> (X >>s Y), patch by Edmund Grimley
Evans!

llvm-svn: 93884
2010-01-19 18:16:19 +00:00
Chris Lattner a6368219ac don't let asm-verbose break the check-next lines in these tests.
llvm-svn: 93869
2010-01-19 06:39:54 +00:00
Chris Lattner 795bfb7207 only darwin has zerofill
llvm-svn: 93866
2010-01-19 06:21:23 +00:00
Chris Lattner c7a062d187 Now that we have everything nicely factored (e.g. asmprinter is not
doing global variable classification anymore) and hookized, sink almost
all target targets global variable emission code into AsmPrinter and out
of each target.

Some notes:

1. PIC16 does completely custom and crazy stuff, so it is not changed.
2. XCore has some custom handling for extra directives.  I'll look at it next.
3. This switches linux/ppc to use .globl instead of .global.  If .globl is
   actually wrong, let me know and I'll fix it.
4. This makes linux/ppc get a lot of random cases right which were obviously
   wrong before, it is probably now a bit healthier.
5. Blackfin will probably start getting .comm and other things that it didn't
   before.  If this is undesirable, it should explicitly opt out of these
   things by clearing the relevant fields of MCAsmInfo.

This leads to a nice diffstat:
 14 files changed, 127 insertions(+), 830 deletions(-)

llvm-svn: 93858
2010-01-19 05:38:33 +00:00
Bob Wilson 58d59fe394 Fix a crash in scalarrepl for memcpy/memmove where the source and destination
are the same.  I had already fixed a similar problem where the source and
destination were different bitcasts derived from the same alloca, but the
previous fix still did not handle the case where both operands are exactly
the same value.  Radar 7552893.

llvm-svn: 93848
2010-01-19 04:32:48 +00:00
Chris Lattner a986aa33eb fix a significant difference between llvm and gcc on ELF systems:
GCC would put weak zero initialized mutable data in the .bss section,
we would put it into a crasy '.gnu.linkonce.b.test,"aw",@nobits' 
section.  Fixing this will allow simplifications next up.

llvm-svn: 93844
2010-01-19 03:06:01 +00:00
Chris Lattner 024734e0f0 there is no need to emit a .section above .comm on linux.
llvm-svn: 93842
2010-01-19 02:46:56 +00:00
Evan Cheng 4668a3b935 Test case for r93758.
llvm-svn: 93824
2010-01-19 00:35:20 +00:00
Dale Johannesen 27d71d2d3a Reverting.
llvm-svn: 93819
2010-01-19 00:12:05 +00:00
Dale Johannesen 0c90d43b70 Enable code to emit dbg.declare as DEBUG_VALUE
comments (fast isel, X86).  This doesn't seem
to break any functionality, but will introduce
cases where -g affects the generated code.  I'll
be fixing that.

llvm-svn: 93811
2010-01-18 23:34:55 +00:00
Chris Lattner 43f2fa6201 my instcombine transformations to make extension elimination more
aggressive changed the canonical form from sext(trunc(x)) to ashr(lshr(x)),
make sure to transform a couple more things into that canonical form,
and catch a case where we missed turning zext/shl/ashr into a single sext.

llvm-svn: 93787
2010-01-18 22:19:16 +00:00
Chris Lattner 2b03aaafbf filecheckize this.
llvm-svn: 93776
2010-01-18 22:00:46 +00:00
Chris Lattner 51d64e2a10 filecheckize
llvm-svn: 93775
2010-01-18 21:58:32 +00:00
Chris Lattner 48b753ef9f remove a redundant test, filecheckize another.
llvm-svn: 93774
2010-01-18 21:55:43 +00:00
Evan Cheng 88b65bc835 Canonicalize -1 - x to ~x.
Instcombine does this but apparently there are situations where this pattern will escape the optimizer and / or created by isel. Here is a case that's seen in JavaScriptCore:
  %t1 = sub i32 0, %a
  %t2 = add i32 %t1, -1
The dag combiner pattern: ((c1-A)+c2) -> (c1+c2)-A
will fold it to -1 - %a.

llvm-svn: 93773
2010-01-18 21:38:44 +00:00
Devang Patel 696cb8d410 While mapping llvm.dbg.declare intrinsic manually map its operand, if possible,
because it points to an alloca instruction through metadata.

llvm-svn: 93757
2010-01-18 19:52:14 +00:00
Rafael Espindola adecf17587 Really fix this. I checked that on ARM I get
PASS: LLVM::FrontendC/pr5406.c (3463 of 5030)

and on X86 I get

XFAIL: LLVM::FrontendC/pr5406.c (3465 of 5030
llvm-svn: 93689
2010-01-17 19:20:45 +00:00
Chris Lattner 387c6b20cd reduce this test and convert to filecheck, hopefully the linux buildbot
will tell me something more useful.

llvm-svn: 93688
2010-01-17 19:09:12 +00:00
Bob Wilson 9349437c65 The Neon "vtst" instruction takes a suffix that is the element size alone --
adding an "i" to the suffix, indicating that the elements are integers, is
accepted but not part of the standard syntax.  This helps us pass a few more
of the Neon tests from gcc.

llvm-svn: 93677
2010-01-17 06:35:17 +00:00
Rafael Espindola 945b4b7bd9 Looks like XFAIL has to list every unsupported arch
llvm-svn: 93672
2010-01-17 05:40:41 +00:00
Rafael Espindola 7397d6c281 Add test for pr5406
llvm-svn: 93671
2010-01-17 04:44:55 +00:00
Bill Wendling 3fbf36d0b4 Reduce fsub-fadd.ll and merge it into fsub-fsub.ll. Rename fsub-fsub.ll to
fsub.ll and FileCheckify it.

llvm-svn: 93669
2010-01-17 00:21:21 +00:00
Kenneth Uildriks dd6ddd1aeb When checking for sret-demotion, it needs to use legal types. When using the return value of an sret-demoted call, it needs to use possibly illegal types that match the declared Type of the callee.
llvm-svn: 93667
2010-01-16 23:37:33 +00:00
Tobias Grosser b478d3e0fc Fix PR6047
Nodes that had children outside of the post dominator tree (infinite loops)
where removed from the post dominator tree. This seems to be wrong. Leave them
in the tree.

llvm-svn: 93633
2010-01-16 13:38:07 +00:00
Chris Lattner 08eff61eeb this teestcase takes a long time to crash, remove it. If someone cares about this, they should file a bug, it's not doing any good as an xfail.
llvm-svn: 93604
2010-01-16 00:53:22 +00:00
Bob Wilson 298cdac99c Run the pre-register allocation tail duplication pass by default. Remove
the -pre-regalloc-taildup command-line option, and add a new
-disable-early-taildup option.

llvm-svn: 93597
2010-01-16 00:29:50 +00:00
Daniel Dunbar 6d8f59e65f Fix llvm_supports_binding for lit, problem noticed by Bob!
llvm-svn: 93591
2010-01-16 00:00:20 +00:00
David Greene b0c0e6433f Fix PR6019. A load has more than one use if it feeds a bitconvert that
has more than one use.

llvm-svn: 93576
2010-01-15 23:23:41 +00:00
Jim Grosbach fd850837a3 add testcase for r93564
llvm-svn: 93567
2010-01-15 22:27:37 +00:00
Anton Korobeynikov 07e8171fcb Reenable tests
llvm-svn: 93555
2010-01-15 21:19:26 +00:00
Victor Hernandez b324e66f4c Improve llvm.dbg.declare intrinsic by referring directly to the storage in its first argument, via function-local metadata (instead of via a bitcast).
This patch also cleans up code that expects there to be a bitcast in the first argument and testcases that call llvm.dbg.declare.
It also strips old llvm.dbg.declare intrinsics that did not pass metadata as the first argument.

llvm-svn: 93531
2010-01-15 19:04:09 +00:00
Victor Hernandez 8d4904b639 Revert r93504 because older uses of llvm.dbg.declare intrinsics need to be auto-upgraded
llvm-svn: 93515
2010-01-15 17:36:47 +00:00
Jay Foad 306f155a84 Test case for http://llvm.org/PR6028.
llvm-svn: 93511
2010-01-15 11:29:26 +00:00
Victor Hernandez 5d6551816b Improve llvm.dbg.declare intrinsic by referring directly to the storage in its first argument, via function-local metadata (instead of via a bitcast).
This patch also cleans up code that expects there to be a bitcast in the first argument and testcases that call llvm.dbg.declare.

llvm-svn: 93504
2010-01-15 03:37:48 +00:00
Anton Korobeynikov 3a0b066d24 Temporary disable tests
llvm-svn: 93501
2010-01-15 02:09:27 +00:00
Devang Patel 89880c8224 Do not use AT_specification die for static variables. It confuses gdb.
llvm-svn: 93494
2010-01-15 01:12:22 +00:00
Devang Patel 01e2bfd79b new test case for r93485.
llvm-svn: 93486
2010-01-15 00:34:26 +00:00
Anton Korobeynikov fdf7031a1a Add variable-width shifts for MSP430
llvm-svn: 93468
2010-01-14 22:09:38 +00:00
Dan Gohman dd5286dc63 Fix a codegen abort seen in 483.xalancbmk.
llvm-svn: 93417
2010-01-14 03:08:49 +00:00
Evan Cheng 37463a7a58 Test for r93409.
llvm-svn: 93410
2010-01-14 02:24:50 +00:00
Victor Hernandez d2b4f36986 Extend testcase to also test llvm.dbg.value intrinsic
llvm-svn: 93408
2010-01-14 02:12:41 +00:00
Victor Hernandez b658d30b91 Now that LLParser, AsmWriter, BitcodeReader, and BitcodeWriter all correctly support function-local metadata, test it.
llvm-svn: 93406
2010-01-14 01:51:28 +00:00
Bill Wendling ad7a5b07a7 When the visitSub method was split into visitSub and visitFSub, this xform was
added to the FSub version. However, the original version of this xform guarded
against doing this for floating point (!Op0->getType()->isFPOrFPVector()).

This is causing LLVM to perform incorrect xforms for code like:

void func(double *rhi, double *rlo, double xh, double xl, double yh, double yl){
  double mh, ml;
  double c = 134217729.0;
  double up, u1, u2, vp, v1, v2;
        
  up = xh*c;
  u1 = (xh - up) + up;
  u2 = xh - u1;
        
  vp = yh*c;
  v1 = (yh - vp) + vp;
  v2 = yh - v1;
        
  mh = xh*yh;
  ml = (((u1*v1 - mh) + (u1*v2)) + (u2*v1)) + (u2*v2);
  ml += xh*yl + xl*yh;
        
  *rhi = mh + ml;
  *rlo = (mh - (*rhi)) + ml;
}

The last line was optimized away, but rl is intended to be the difference
between the infinitely precise result of mh + ml and after it has been rounded
to double precision.

llvm-svn: 93369
2010-01-13 23:23:17 +00:00