Commit Graph

9619 Commits

Author SHA1 Message Date
Johnny Chen
bb6e9d8cf7 Fixed a crasher in arm disassembler within ARMInstPrinter.cpp after calling
ARM_AM::getSoImmVal(V) with a legitimate so_imm value: #245 rotate right by 2.
Introduce ARM_AM::getSOImmValOneOrNoRotate(unsigned Arg) which is called from
ARMInstPrinter.cpp's printSOImm() function, replacing ARM_AM::getSOImmVal(V).

[12:44:43] johnny:/Volumes/data/llvm/git/trunk (local-trunk) $ gdb Debug/bin/llvm-mc
GNU gdb 6.3.50-20050815 (Apple version gdb-1346) (Fri Sep 18 20:40:51 UTC 2009)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin"...Reading symbols for shared libraries ... done

(gdb) set args  -triple=arm-apple-darwin9 -debug-only=arm-disassembler --disassemble
(gdb) r
Starting program: /Volumes/data/llvm/git/trunk/Debug/bin/llvm-mc -triple=arm-apple-darwin9 -debug-only=arm-disassembler --disassemble
Reading symbols for shared libraries ++. done
0xf5 0x71 0xf0 0x53
Opcode=201 Name=MVNi Format=ARM_FORMAT_DPFRM(4)
 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10  9  8  7  6  5  4  3  2  1  0 
-------------------------------------------------------------------------------------------------
| 0: 1: 0: 1| 0: 0: 1: 1| 1: 1: 1: 1| 0: 0: 0: 0| 0: 1: 1: 1| 0: 0: 0: 1| 1: 1: 1: 1| 0: 1: 0: 1|
-------------------------------------------------------------------------------------------------

	mvnpls	r7, Assertion failed: (V != -1 && "Not a valid so_imm value!"), function printSOImm, file ARMInstPrinter.cpp, line 229.

Program received signal SIGABRT, Aborted.
0x00007fff88c65886 in __kill ()
(gdb) bt
#0  0x00007fff88c65886 in __kill ()
#1  0x00007fff88d05eae in abort ()
#2  0x00007fff88cf2ef0 in __assert_rtn ()
#3  0x000000010020e422 in printSOImm (O=@0x1010bdf80, V=-1, VerboseAsm=false, MAI=0x1020106d0) at ARMInstPrinter.cpp:229
#4  0x000000010020e5fe in llvm::ARMInstPrinter::printSOImmOperand (this=0x1020107e0, MI=0x7fff5fbfee70, OpNum=1, O=@0x1010bdf80) at ARMInstPrinter.cpp:254
#5  0x00000001001ffbc0 in llvm::ARMInstPrinter::printInstruction (this=0x1020107e0, MI=0x7fff5fbfee70, O=@0x1010bdf80) at ARMGenAsmWriter.inc:3236
#6  0x000000010020c27c in llvm::ARMInstPrinter::printInst (this=0x1020107e0, MI=0x7fff5fbfee70, O=@0x1010bdf80) at ARMInstPrinter.cpp:182
#7  0x000000010003cbff in PrintInsts (DisAsm=@0x10200f4e0, Printer=@0x1020107e0, Bytes=@0x7fff5fbff060, SM=@0x7fff5fbff078) at Disassembler.cpp:65
#8  0x000000010003c8b4 in llvm::Disassembler::disassemble (T=@0x1010c13c0, Triple=@0x1010b6798, Buffer=@0x102010690) at Disassembler.cpp:153
#9  0x000000010004095c in DisassembleInput (ProgName=0x7fff5fbff3f0 "/Volumes/data/llvm/git/trunk/Debug/bin/llvm-mc") at llvm-mc.cpp:347
#10 0x000000010003eefb in main (argc=4, argv=0x7fff5fbff298) at llvm-mc.cpp:374
(gdb) q
The program is running.  Exit anyway? (y or n) y
[13:36:26] johnny:/Volumes/data/llvm/git/trunk (local-trunk) $ 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101053 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-12 18:46:53 +00:00
Dan Gohman
27dead44e0 Generalize ScalarEvolution's PHI analysis to handle loops that don't
have preheaders or dedicated exit blocks, as clients may not otherwise
need to run LoopSimplify.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101030 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-12 07:49:36 +00:00
Evan Cheng
09010a30fd Enable post regalloc machine licm by default.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101023 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-12 06:25:28 +00:00
Eric Christopher
67a71b5306 Verify function prototypes before trying to optimize functions. We also
need TargetData, just return false if we don't have it.

Update testcases accordingly.

Fixes PR6807.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101011 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-12 04:48:00 +00:00
Dan Gohman
931e345e76 Re-apply r101000, with a fix: Don't eliminate an icmp which is part of
the loop exit test. This usually doesn't come up for a variety of
reasons, but it isn't impossible, so make IndVarSimplify handle it
conservatively.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101008 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-12 02:21:50 +00:00
Dan Gohman
ac3b9cdf15 Revert 101000, which is breaking self-host builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101002 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-12 00:17:10 +00:00
Dan Gohman
3fddbb337d Teach IndVarSimplify how to eliminate comparisons involving induction
variables. For example, with code like this:

  for (i=0;i<n;++i)
    if (i<n)
      x[i] = 0;

IndVarSimplify will now recognize that i is always less than n inside
the loop, and eliminate the if.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101000 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-11 23:10:12 +00:00
Chris Lattner
6f285d2105 fix PR6743, a case where we'd delete an instruction before using it
in some cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100937 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-10 18:26:57 +00:00
Chris Lattner
a2fb234b04 fix PR6760, a missing check in heap SRoA.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100936 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-10 18:19:22 +00:00
Dan Gohman
e5f76877ae When determining a canonical insert position, don't climb deeper
into adjacent loops. Also, ensure that the insert position is
dominated by the loop latch of any loop in the post-inc set which
has a latch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100906 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-09 22:07:05 +00:00
Dan Gohman
f8d0578e4c When emitting code for an add, don't force a SCEVUnknown wrapper around
a hoisted intermediate result if the intermediate result isn't an
Instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100884 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-09 19:14:31 +00:00
Benjamin Kramer
232c8b4d26 Make sure this test tests something.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100879 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-09 19:03:31 +00:00
Bob Wilson
f5c3f8cda5 Add a testcase for svn r100568.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100876 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-09 18:29:29 +00:00
Chris Lattner
dc8446330f "On SPU, variables in the .bss section that are allocated with the .lcomm directive are not aligned on 16 byte boundaries. This causes misaligned loads, as the generated assembly assumes this "default" alignment.
this patch disables .lcomm in favour of '.local .comm'

Patch by Kalle Raisklia!




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100875 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-09 18:27:03 +00:00
Dan Gohman
5ce1bf9531 Merge a few fast-isel tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100860 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-09 15:03:55 +00:00
Dan Gohman
be02b20a8f Add several more lint checks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100841 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-09 01:39:53 +00:00
Dan Gohman
b3cdb0ec31 Fix a bug in IVUsers which was permitting non-affine addrecs to
be sent to LSR, which it isn't prepared to handle.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100839 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-09 01:22:56 +00:00
Chris Lattner
8829cec25f fix a SCCP miscompilation that could happen when a
forced constant is changed to a constant, we would end
up adding the instruction to the wrong worklist, 
preventing it from being properly revisited.  This fixes
rdar://7832370


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100837 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-09 01:14:31 +00:00
Dan Gohman
dd98c4d185 Add a few more lint checks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100825 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-08 23:05:57 +00:00
Evan Cheng
a57fabe815 Coalescer should not delete copy instructions whose defs are partially dead. e.g.
%RDI<def,dead> = MOV64rr %RAX<kill>, %EDI<imp-def>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100804 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-08 20:02:37 +00:00
Dan Gohman
113902e9fb Add a -lint pass which checks for common sources of undefined or likely
unintended behavior.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100798 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-08 18:47:09 +00:00
Dan Gohman
b57b6f1575 Pointers to zero-sized objects don't point to overlapping objects.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100789 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-08 18:11:50 +00:00
Dan Gohman
29e13e0c18 Print empty structs as {} rather than { }.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100787 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-08 18:03:05 +00:00
Evan Cheng
c3b0c341e7 Avoid using f64 to lower memcpy from constant string. It's cheaper to use i32 store of immediates.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100751 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-08 07:37:57 +00:00
Dan Gohman
701a4aef7f When expanding expressions which are using post-inc mode for multiple loops,
ensure that the expansion is dominated by the increments of those loops.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100748 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-08 05:57:57 +00:00
Chris Lattner
d2075586c8 add newlines at the end of files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100705 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-07 22:53:17 +00:00
Dan Gohman
448db1cdef Generalize IVUsers to track arbitrary expressions rather than expressions
explicitly split into stride-and-offset pairs. Also, add the
ability to track multiple post-increment loops on the same expression.

This refines the concept of "normalizing" SCEV expressions used for
to post-increment uses, and introduces a dedicated utility routine for
normalizing and denormalizing expressions.

This fixes the expansion of expressions which are post-increment users
of more than one loop at a time. More broadly, this takes LSR another
step closer to being able to reason about more than one loop at a time.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100699 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-07 22:27:08 +00:00
Benjamin Kramer
447b19543b unXFAIL, arm disassembler was reenabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100692 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-07 21:19:41 +00:00
Dale Johannesen
b39b7e5ebf Split big test into multiple directories to cater to
those who don't build all targets.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100688 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-07 20:43:35 +00:00
Dale Johannesen
809948a998 Test that DEBUG_VALUE comments come out on a variety of targets.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100682 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-07 20:01:24 +00:00
Chris Lattner
b1ceecefac this has a pr!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100637 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-07 18:04:56 +00:00
Chris Lattner
24ad3ed71f fix a latent bug my inline asm stuff exposed:
MachineOperand::isIdenticalTo wasn't handling metadata operands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100636 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-07 18:03:19 +00:00
Sanjiv Gupta
06fd8fadc8 Remove XFAIL for vg_leak as the leaks are fixed by 100601.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100612 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-07 07:06:48 +00:00
Devang Patel
5f0940002a Do not emit specification DIE with DW_AT_specification attribute for member functions of a funcation local class. This trips gdb's partial scan of DIEs at load time. Fixes Radar 7833483.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100586 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-06 23:53:48 +00:00
Jakob Stoklund Olesen
e7b744fe64 Let that which does not matter truly slide.
This test only cares about alignment, so don't test for other cruft.
An upcoming llvm-gcc patch needs this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100584 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-06 23:44:44 +00:00
Stuart Hastings
639336e0bd Reverting 100530 & 100531 due to regressions in the GDB test suite.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100563 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-06 21:38:29 +00:00
Jakob Stoklund Olesen
8ba1c6ab87 Don't try to collapse DomainValues onto an incompatible SSE domain.
This fixes the Bullet regression on i386/nocona.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100553 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-06 19:48:56 +00:00
Stuart Hastings
983327b351 Revise debug info machinery to digest nested functions and classes.
A certain GDB testsuite case (local.cc) has a function nested inside a
class nested inside another function.  GCC presents the innermost
function to llvm-convert first.  Heretofore, the debug info mistakenly
placed the inner function at module scope.  This patch walks the GCC
context links and instantiates the outer class and function so the
debug info is properly nested.  Radar 7426545.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100530 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-06 17:19:32 +00:00
Evan Cheng
da72249ecb Add nounwind.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100482 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05 22:30:05 +00:00
Dan Gohman
c4ae94dee8 Don't do code sinking on unreachable blocks. It's unprofitable and hazardous.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100455 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05 19:17:22 +00:00
Evan Cheng
1b0194d646 Reverting 100265 to try to get buildbots green again. Lots of self-hosting buildbots started complaining since this commit. Also xfail ARM disassembly tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100378 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05 01:04:27 +00:00
Chris Lattner
af8df26495 resolve a fixme.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100346 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 19:28:59 +00:00
Mon P Wang
20adc9dc46 Reapply address space patch after fixing an issue in MemCopyOptimizer.
Added support for address spaces and added a isVolatile field to memcpy, memmove, and memset,
e.g., llvm.memcpy.i32(i8*, i8*, i32, i32) -> llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100304 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 03:10:48 +00:00
Chris Lattner
96fd76638b add integer overflow check for the fp induction variable
checker.  Amusingly, we already had tests that we should
have rejects because they would be miscompiled in the
testsuite.

The remaining issue with this is that we don't check that
the branch causes us to exit the loop if it fails, so we
don't actually know if we remain in bounds.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100284 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-03 07:18:48 +00:00
Chris Lattner
43b85273ee fix PR6761, a miscompilation due to the fp->int IV conversion
stuff.  More bugs remain though.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100282 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-03 06:30:03 +00:00
Chris Lattner
203bceb111 convert to filecheck
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100281 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-03 06:27:56 +00:00
Chris Lattner
cf9abd210d rename feature test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100279 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-03 06:24:28 +00:00
Chris Lattner
6aea48b81c actually just remove this, will move the real feature test here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100278 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-03 06:24:03 +00:00
Chris Lattner
415d754f53 rename test since it is a feature test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100277 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-03 06:22:52 +00:00
Chris Lattner
07aa76ad93 first half of a pass through IndVarSimplify::HandleFloatingPointIV,
this cleans up a bunch of code and also fixes several crashes and
miscompiles.  More to come unfortunately, this optimization
is quite broken.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100270 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-03 05:54:59 +00:00