Commit Graph

37886 Commits

Author SHA1 Message Date
Bob Wilson
6a234f07fa Handle a v2f64 formal parameter that is split between registers and memory
such that the entire second half is in memory.  Radar 7855014.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101181 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-13 22:03:22 +00:00
Sean Callanan
9899f70a74 Fixed a nasty layering violation in the edis source
code.  It used to #include the enhanced disassembly
information for the targets it supported straight
out of lib/Target/{X86,ARM,...} but now it uses a
new interface provided by MCDisassembler, and (so
far) implemented by X86 and ARM.

Also removed hacky #define-controlled initialization
of targets in edis.  If clients only want edis to
initialize a limited set of targets, they can set
--enable-targets on the configure command line.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101179 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-13 21:21:57 +00:00
Johnny Chen
8a87ffb925 Changed getSOImmValRotate()'s hunt retry logic to ignore the low order 6 bits,
instead of 7, because we are only looking for even rotate amount.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101172 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-13 20:35:16 +00:00
Devang Patel
50d80e394d Do not include types without any definition in pubtypes list.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101171 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-13 20:35:04 +00:00
Evan Cheng
c15d9135a8 Avoid variable shadowing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101170 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-13 20:25:29 +00:00
Evan Cheng
aeb2f4aa46 Expand postra machine licm's capability a little more. If an instruction's register operands are all loop invariants, then it's safe to hoist it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101167 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-13 20:21:05 +00:00
Jakob Stoklund Olesen
8d17160e2c Teach MachineSinking to handle easy critical edges.
Sometimes it is desirable to sink instructions along a critical edge:

x = ...
if (a && b) ...
else use(x);

The 'a && b' condition creates a critical edge to the else block, but we still
want to sink the computation of x into the block. The else block is dominated by
the parent block, so we are not pushing instructions into new code paths.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101165 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-13 19:06:14 +00:00
Evan Cheng
fc5a03e469 Re-apply 101075 and fix it properly. Just reuse the debug info of the branch instruction being optimized. There is no need to --I which can deref off start of the BB.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101162 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-13 18:50:27 +00:00
Eric Christopher
97e6992e3e Temporarily revert r101075, it's causing invalid iterator assertions
in a nightly tester.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101158 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-13 18:37:58 +00:00
Evan Cheng
5dc57ce533 Teach postra machine licm to hoist more obvious invariants, e.g. instructions with no source operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101154 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-13 18:16:00 +00:00
Dan Gohman
4183e31978 Add a few comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101148 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-13 17:07:06 +00:00
Dan Gohman
81bf03eb5c Eliminate MachineBasicBlock::const_livein_iterator and make
MachineBasicBlock::livein_iterator a const_iterator, because
clients shouldn't ever be using the iterator interface to
mutate the livein set.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101147 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-13 16:57:55 +00:00
Dan Gohman
9e9aa44d1a Rename MachineFrameInfo variables to MFI, for consistency with
the rest of CodeGen.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101146 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-13 16:56:45 +00:00
Dan Gohman
13e73f483e Move MachineRegisterInfo's isLiveIn and isLiveOut out of line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101145 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-13 16:55:37 +00:00
Dan Gohman
c5e43c958e Use MachineBasicBlock::isLiveIn.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101144 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-13 16:53:51 +00:00
Dan Gohman
5c982949bf Delete an unused member variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101143 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-13 16:51:39 +00:00
Dan Gohman
28287794d4 Teach ScalarEvolution to simplify smax and umax when it can prove
that one operand is always greater than another.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101142 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-13 16:51:03 +00:00
Dan Gohman
3ab131243e Minor code micro-optimizations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101141 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-13 16:49:23 +00:00
Eric Christopher
2a7cb9d9ce Actually... return after the check for invalid input.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101139 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-13 16:41:29 +00:00
Benjamin Kramer
b0322e6ddf BumpPtrAllocator::Reset() doesn't need to allocate anything. (Thanks, Jakob)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101138 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-13 16:38:06 +00:00
Benjamin Kramer
5e6a705985 Let BumpPtrAllocator lazily allocate the first slab.
We have some code in llvm and clang where a BumpPtrAllocator is declared in a
class but never used in the common case. Stop wasting memory there.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101130 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-13 14:41:51 +00:00
Owen Anderson
d5e624027a Remove SCCVN from the CMake build system.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101125 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-13 08:33:09 +00:00
Owen Anderson
fd64901579 SCCVN, we hardly knew ye!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101117 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-13 05:24:08 +00:00
Chris Lattner
7c57b7b808 Fix PR6826: GraphWriter delete the generated file before "dotty" load it,
patch by 'ether'.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101116 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-13 04:35:39 +00:00
Bob Wilson
b123b8bee0 Replace r101053 with a fix for getSOImmValRotate() so that it will correctly
recognize all the valid rotated immediates.  This fixes the disassembler
issue and will also help codegen for some unusual constant values.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101114 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-13 02:11:48 +00:00
Dan Gohman
a590b79ee2 Teach IndVarSimplify how to eliminate remainder operators where the
numerator is an induction variable. For example, with code like this:

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

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101113 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-13 01:46:36 +00:00
Daniel Dunbar
afc9a0c6b0 VMCore: Add Type::getIntN[Ptr]Ty, which are the obvious generic forms of
Type::getInt{1,8,...}[Ptr]Ty, so code can consistently use the methods on Type
without occasionally needed to call IntegerType::get.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101111 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-13 01:39:07 +00:00
Chris Lattner
43ac721e3b add llvm codegen support for -ffunction-sections and -fdata-sections,
patch by Sylvere Teissier!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101106 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-13 00:36:43 +00:00
Dan Gohman
bca091d561 Micro-optimize a few hot spots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101086 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-12 23:08:18 +00:00
Evan Cheng
82865a10f8 Use .set expression for x86 pic jump table reference to reduce assembly relocation. rdar://7738756
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101085 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-12 23:07:17 +00:00
Dan Gohman
6ab10f69a9 Add fast paths to ScalarEvolution::getSizeOf and getOffsetOf, as
they're used a lot by getNodeForGEP, which can be called a lot.
This speeds up -iv-users by around 15% on several testcases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101083 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-12 23:03:26 +00:00
Bill Wendling
2aae6ae572 Micro-optimization:
If we have this situation:

    jCC  L1
    jmp  L2
L1:
  ...
L2:
  ...

We can get a small performance boost by emitting this instead:

    jnCC L2
L1:
  ...
L2:
  ...

This testcase shows an example of this:

float func(float x, float y) {
    double product = (double)x * y;
    if (product == 0.0)
        return product;
    return product - 1.0;
}



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101075 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-12 22:19:57 +00:00
Dan Gohman
3b49063a83 Simplify this code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101074 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-12 22:12:29 +00:00
Dan Gohman
ca9b7037e2 Suppress LinearFunctionTestReplace when the computed backedge-taken
expression is a UDiv and it doesn't appear that the UDiv came from
the user's source.

ScalarEvolution has recently figured out how to compute a tripcount
expression for the inner loop in
SingleSource/Benchmarks/Shootout/sieve.c, using a udiv. Emitting a
udiv instruction dramatically slows down the enclosing loop.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101068 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-12 21:13:43 +00:00
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
8b3d6682a4 Remove a #include.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101043 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-12 16:26:03 +00:00
Tobias Grosser
63d3659a44 Remove unneeded debug in PostDominator runOnFunction()
The information is already available with "opt -analyze". The DominatorTree
does also not have this in its runOnFunction. So they behave now
more consistent.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101038 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-12 15:32:55 +00:00
Tobias Grosser
e7e08c39de Remove dead code in the dotty dominance tree printer.
This template is not needed anymore as it was replaced by the
DOTGraphTraitsViewer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101036 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-12 15:02:19 +00:00
Benjamin Kramer
678d9b7ed0 Plug trivial leak.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101034 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-12 11:38:35 +00:00
Dan Gohman
ef817ccec4 Delete this code, which is no longer needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101033 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-12 08:00:22 +00:00
Dan Gohman
d890f29ca6 Move the EliminateIVUsers call back out to its original location. Now that
a ScalarEvolution bug with overflow handling is fixed, the normal analysis
code will automatically decline to operate on the icmp instructions which
are responsible for the loop exit.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101032 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-12 07:56:56 +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
Dan Gohman
646e047765 Rewrite the overflow checking in the get{Signed,Unsigned}Range code for
AddRecs so that it checks for overflow in the computation that it is
performing, rather than just checking hasNo{Signed,Unsigned}Wrap, since
those flags are for a different computation. This fixes a bug that
impacts an upcoming change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101028 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-12 07:39:33 +00:00
Dan Gohman
dd842e34c8 Use RecursivelyDeleteTriviallyDeadInstructions in EliminateIVComparisons,
instead of deleting just the user. This makes it more consistent with
other code in IndVarSimplify, and theoretically can eliminate more users
earlier.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101027 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-12 07:29:15 +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
58c2587ed8 Remove unnecessary parens.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101010 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-12 02:24:01 +00:00
Dan Gohman
ce80051170 Minor code simplification.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101009 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-12 02:22:30 +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