oota-llvm.git
14 years agoEliminate MachineBasicBlock::const_livein_iterator and make
Dan Gohman [Tue, 13 Apr 2010 16:57:55 +0000 (16:57 +0000)]
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

14 years agoRename MachineFrameInfo variables to MFI, for consistency with
Dan Gohman [Tue, 13 Apr 2010 16:56:45 +0000 (16:56 +0000)]
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

14 years agoMove MachineRegisterInfo's isLiveIn and isLiveOut out of line.
Dan Gohman [Tue, 13 Apr 2010 16:55:37 +0000 (16:55 +0000)]
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

14 years agoUse MachineBasicBlock::isLiveIn.
Dan Gohman [Tue, 13 Apr 2010 16:53:51 +0000 (16:53 +0000)]
Use MachineBasicBlock::isLiveIn.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101144 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDelete an unused member variable.
Dan Gohman [Tue, 13 Apr 2010 16:51:39 +0000 (16:51 +0000)]
Delete an unused member variable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101143 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoTeach ScalarEvolution to simplify smax and umax when it can prove
Dan Gohman [Tue, 13 Apr 2010 16:51:03 +0000 (16:51 +0000)]
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

14 years agoMinor code micro-optimizations.
Dan Gohman [Tue, 13 Apr 2010 16:49:23 +0000 (16:49 +0000)]
Minor code micro-optimizations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101141 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoActually... return after the check for invalid input.
Eric Christopher [Tue, 13 Apr 2010 16:41:29 +0000 (16:41 +0000)]
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

14 years agoBumpPtrAllocator::Reset() doesn't need to allocate anything. (Thanks, Jakob)
Benjamin Kramer [Tue, 13 Apr 2010 16:38:06 +0000 (16:38 +0000)]
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

14 years agoUpdate unittest for allocator laziness.
Benjamin Kramer [Tue, 13 Apr 2010 15:01:26 +0000 (15:01 +0000)]
Update unittest for allocator laziness.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101131 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoLet BumpPtrAllocator lazily allocate the first slab.
Benjamin Kramer [Tue, 13 Apr 2010 14:41:51 +0000 (14:41 +0000)]
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

14 years agoRemove SCCVN from the CMake build system.
Owen Anderson [Tue, 13 Apr 2010 08:33:09 +0000 (08:33 +0000)]
Remove SCCVN from the CMake build system.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101125 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agocheckpoint.
Chris Lattner [Tue, 13 Apr 2010 06:37:00 +0000 (06:37 +0000)]
checkpoint.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101118 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSCCVN, we hardly knew ye!
Owen Anderson [Tue, 13 Apr 2010 05:24:08 +0000 (05:24 +0000)]
SCCVN, we hardly knew ye!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101117 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix PR6826: GraphWriter delete the generated file before "dotty" load it,
Chris Lattner [Tue, 13 Apr 2010 04:35:39 +0000 (04:35 +0000)]
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

14 years agoReplace r101053 with a fix for getSOImmValRotate() so that it will correctly
Bob Wilson [Tue, 13 Apr 2010 02:11:48 +0000 (02:11 +0000)]
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

14 years agoTeach IndVarSimplify how to eliminate remainder operators where the
Dan Gohman [Tue, 13 Apr 2010 01:46:36 +0000 (01:46 +0000)]
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

14 years agoVMCore: Add Type::getIntN[Ptr]Ty, which are the obvious generic forms of
Daniel Dunbar [Tue, 13 Apr 2010 01:39:07 +0000 (01:39 +0000)]
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

14 years agoIRBuilder: Add Create{Shl,LShr,And,Or,Xor} methods from uin64_t and APInt constants.
Daniel Dunbar [Tue, 13 Apr 2010 01:38:57 +0000 (01:38 +0000)]
IRBuilder: Add Create{Shl,LShr,And,Or,Xor} methods from uin64_t and APInt constants.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101110 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoadd llvm codegen support for -ffunction-sections and -fdata-sections,
Chris Lattner [Tue, 13 Apr 2010 00:36:43 +0000 (00:36 +0000)]
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

14 years agoBuild system fix to make llvm-mc properly build
Sean Callanan [Mon, 12 Apr 2010 23:55:28 +0000 (23:55 +0000)]
Build system fix to make llvm-mc properly build
after edis.  Really, there ought to be some
mechanism to ensure that PARALLEL_DIRS get built
after DIRS.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101095 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMicro-optimize a few hot spots.
Dan Gohman [Mon, 12 Apr 2010 23:08:18 +0000 (23:08 +0000)]
Micro-optimize a few hot spots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101086 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoUse .set expression for x86 pic jump table reference to reduce assembly relocation...
Evan Cheng [Mon, 12 Apr 2010 23:07:17 +0000 (23:07 +0000)]
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

14 years agoAdd fast paths to ScalarEvolution::getSizeOf and getOffsetOf, as
Dan Gohman [Mon, 12 Apr 2010 23:03:26 +0000 (23:03 +0000)]
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

14 years agoThird time's a charm...
Bill Wendling [Mon, 12 Apr 2010 22:43:21 +0000 (22:43 +0000)]
Third time's a charm...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101081 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoGenericize the label test.
Bill Wendling [Mon, 12 Apr 2010 22:40:37 +0000 (22:40 +0000)]
Genericize the label test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101079 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoCorrect test to test what I mean it to test.
Bill Wendling [Mon, 12 Apr 2010 22:25:42 +0000 (22:25 +0000)]
Correct test to test what I mean it to test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101077 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMicro-optimization:
Bill Wendling [Mon, 12 Apr 2010 22:19:57 +0000 (22:19 +0000)]
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

14 years agoSimplify this code.
Dan Gohman [Mon, 12 Apr 2010 22:12:29 +0000 (22:12 +0000)]
Simplify this code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101074 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoBuild system fixes. llvm-mc depends on
Sean Callanan [Mon, 12 Apr 2010 21:55:49 +0000 (21:55 +0000)]
Build system fixes.  llvm-mc depends on
libEnhancedDisassembly, so we now build the
static library in all cases (although the shared
library is only built when requested/possible).

Also, fixed a bug where edis wasn't properly
initializing the targets it uses.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101072 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSuppress LinearFunctionTestReplace when the computed backedge-taken
Dan Gohman [Mon, 12 Apr 2010 21:13:43 +0000 (21:13 +0000)]
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

14 years agoBug fix: made the enhanced disassembler's link
Sean Callanan [Mon, 12 Apr 2010 20:23:08 +0000 (20:23 +0000)]
Bug fix: made the enhanced disassembler's link
flags work properly when EDIS_VERSION is defined

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101063 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoBug fix: included System/Types.h instead of
Sean Callanan [Mon, 12 Apr 2010 20:21:56 +0000 (20:21 +0000)]
Bug fix: included System/Types.h instead of
inttypes.h to allow building on Windows.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101062 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSecond try at integrating the edis tester. This
Sean Callanan [Mon, 12 Apr 2010 19:43:00 +0000 (19:43 +0000)]
Second try at integrating the edis tester.  This
time I use the LIBS variable, which is not subject
to a %.a -> -l% transformation, to link llvm-mc
against libEnhancedDisassembly.

llvm-mc -edis works the same as llvm-mc
-disassemble, but outputs tokens and operands.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101058 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFixed a crasher in arm disassembler within ARMInstPrinter.cpp after calling
Johnny Chen [Mon, 12 Apr 2010 18:46:53 +0000 (18:46 +0000)]
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

14 years agoRemove a #include.
Dan Gohman [Mon, 12 Apr 2010 16:26:03 +0000 (16:26 +0000)]
Remove a #include.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101043 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRemove unneeded debug in PostDominator runOnFunction()
Tobias Grosser [Mon, 12 Apr 2010 15:32:55 +0000 (15:32 +0000)]
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

14 years agoRemove dead code in the dotty dominance tree printer.
Tobias Grosser [Mon, 12 Apr 2010 15:02:19 +0000 (15:02 +0000)]
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

14 years agoBoolify.
Benjamin Kramer [Mon, 12 Apr 2010 12:22:19 +0000 (12:22 +0000)]
Boolify.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101035 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoPlug trivial leak.
Benjamin Kramer [Mon, 12 Apr 2010 11:38:35 +0000 (11:38 +0000)]
Plug trivial leak.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101034 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDelete this code, which is no longer needed.
Dan Gohman [Mon, 12 Apr 2010 08:00:22 +0000 (08:00 +0000)]
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

14 years agoMove the EliminateIVUsers call back out to its original location. Now that
Dan Gohman [Mon, 12 Apr 2010 07:56:56 +0000 (07:56 +0000)]
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

14 years agoGeneralize ScalarEvolution's PHI analysis to handle loops that don't
Dan Gohman [Mon, 12 Apr 2010 07:49:36 +0000 (07:49 +0000)]
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

14 years agoRewrite the overflow checking in the get{Signed,Unsigned}Range code for
Dan Gohman [Mon, 12 Apr 2010 07:39:33 +0000 (07:39 +0000)]
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

14 years agoUse RecursivelyDeleteTriviallyDeadInstructions in EliminateIVComparisons,
Dan Gohman [Mon, 12 Apr 2010 07:29:15 +0000 (07:29 +0000)]
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

14 years agoEnable post regalloc machine licm by default.
Evan Cheng [Mon, 12 Apr 2010 06:25:28 +0000 (06:25 +0000)]
Enable post regalloc machine licm by default.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101023 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRemove use of exceptions from bugpoint. No deliberate functionality change!
Nick Lewycky [Mon, 12 Apr 2010 05:08:25 +0000 (05:08 +0000)]
Remove use of exceptions from bugpoint. No deliberate functionality change!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101013 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoVerify function prototypes before trying to optimize functions. We also
Eric Christopher [Mon, 12 Apr 2010 04:48:00 +0000 (04:48 +0000)]
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

14 years agoRemove unnecessary parens.
Dan Gohman [Mon, 12 Apr 2010 02:24:01 +0000 (02:24 +0000)]
Remove unnecessary parens.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101010 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMinor code simplification.
Dan Gohman [Mon, 12 Apr 2010 02:22:30 +0000 (02:22 +0000)]
Minor code simplification.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101009 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRe-apply r101000, with a fix: Don't eliminate an icmp which is part of
Dan Gohman [Mon, 12 Apr 2010 02:21:50 +0000 (02:21 +0000)]
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

14 years agowhether we enable dylibs or not depends on the host, not the target.
Chris Lattner [Mon, 12 Apr 2010 02:21:38 +0000 (02:21 +0000)]
whether we enable dylibs or not depends on the host, not the target.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101007 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRevert 101000, which is breaking self-host builds.
Dan Gohman [Mon, 12 Apr 2010 00:17:10 +0000 (00:17 +0000)]
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

14 years agoFix indentation.
Dan Gohman [Sun, 11 Apr 2010 23:44:58 +0000 (23:44 +0000)]
Fix indentation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101001 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoTeach IndVarSimplify how to eliminate comparisons involving induction
Dan Gohman [Sun, 11 Apr 2010 23:10:12 +0000 (23:10 +0000)]
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

14 years agoEnhance ScalarEvolution::isKnownPredicate with support for
Dan Gohman [Sun, 11 Apr 2010 22:16:48 +0000 (22:16 +0000)]
Enhance ScalarEvolution::isKnownPredicate with support for
loop conditions which are invariants.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100995 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMinor code simplification.
Dan Gohman [Sun, 11 Apr 2010 22:13:11 +0000 (22:13 +0000)]
Minor code simplification.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100994 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoWhen creating a ConstantRange for [n,UINT_MAX], special case n == 0, because
Dan Gohman [Sun, 11 Apr 2010 22:12:18 +0000 (22:12 +0000)]
When creating a ConstantRange for [n,UINT_MAX], special case n == 0, because
ConstantRange(0, 0) creates an empty range rather than a full one.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100993 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix a comment.
Dan Gohman [Sun, 11 Apr 2010 22:07:56 +0000 (22:07 +0000)]
Fix a comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100992 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd a cast to void to show that the return value is being
Dan Gohman [Sun, 11 Apr 2010 19:30:19 +0000 (19:30 +0000)]
Add a cast to void to show that the return value is being
intentionally ignored.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100984 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDelete a dead check.
Dan Gohman [Sun, 11 Apr 2010 19:29:41 +0000 (19:29 +0000)]
Delete a dead check.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100983 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDelete dead code.
Dan Gohman [Sun, 11 Apr 2010 19:28:47 +0000 (19:28 +0000)]
Delete dead code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100981 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix a #include.
Dan Gohman [Sun, 11 Apr 2010 19:27:52 +0000 (19:27 +0000)]
Fix a #include.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100980 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRename isLoopGuardedByCond to isLoopEntryGuardedByCond, to emphasise
Dan Gohman [Sun, 11 Apr 2010 19:27:13 +0000 (19:27 +0000)]
Rename isLoopGuardedByCond to isLoopEntryGuardedByCond, to emphasise
that it's only testing for the entry condition, not full loop-invariant
conditions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100979 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoutostr isn't going away too soon, try to make it slightly smaller.
Benjamin Kramer [Sun, 11 Apr 2010 19:00:03 +0000 (19:00 +0000)]
utostr isn't going away too soon, try to make it slightly smaller.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100977 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRemove dead argument and clean whitespace. No functionality change.
Nick Lewycky [Sat, 10 Apr 2010 23:18:13 +0000 (23:18 +0000)]
Remove dead argument and clean whitespace. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100954 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoImplement support for varargs functions without any fixed
Chris Lattner [Sat, 10 Apr 2010 19:12:44 +0000 (19:12 +0000)]
Implement support for varargs functions without any fixed
parameters in the CBE by implicitly adding a fixed argument.
This allows eliminating a work-around from DAE.  Patch by
Sylvere Teissier!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100944 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoconfigure: Fix default value for optimize_option, I messed up the test condition
Daniel Dunbar [Sat, 10 Apr 2010 18:56:24 +0000 (18:56 +0000)]
configure: Fix default value for optimize_option, I messed up the test condition
in r86005 and unintentionally changed the default from -O3 to -O2.

 - It's odd the things automated perf testing turns up! :)

 - Also, the configure diff is messed up slightly. It looks like someone either
   didn't regenerate configure correctly (or I didn't), or autoconf has some
   funnyness in it. Eric, any ideas?

This has been at -O2 for so long, that I am slightly nervous that this change
will uncover miscompiles of LLVM on other systems. If that is the case, I think
we should just set the default universally at -O3, and let developers/vendors
use -O3 if they want it and have tested it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100941 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agofix PR6743, a case where we'd delete an instruction before using it
Chris Lattner [Sat, 10 Apr 2010 18:26:57 +0000 (18:26 +0000)]
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

14 years agofix PR6760, a missing check in heap SRoA.
Chris Lattner [Sat, 10 Apr 2010 18:19:22 +0000 (18:19 +0000)]
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

14 years agoturn an assert into a proper check, fixing crash on invalid here:
Chris Lattner [Sat, 10 Apr 2010 18:01:25 +0000 (18:01 +0000)]
turn an assert into a proper check, fixing crash on invalid here:

$ llvm-as t.ll
llvm-as: t.ll:1:6: error: expected 'type' after '='
%0 = = type { i32, float, float, double }
     ^

PR6810.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100934 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoimprove haiku portability, patch by Paul Davey.
Chris Lattner [Sat, 10 Apr 2010 17:54:51 +0000 (17:54 +0000)]
improve haiku portability, patch by Paul Davey.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100933 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoadd attributes and module level asm to the ocaml bindings,
Chris Lattner [Sat, 10 Apr 2010 17:52:58 +0000 (17:52 +0000)]
add attributes and module level asm to the ocaml bindings,
patch by Patrick Walton!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100932 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoUpdated the edis build mechanism to allow for builds
Sean Callanan [Sat, 10 Apr 2010 00:48:10 +0000 (00:48 +0000)]
Updated the edis build mechanism to allow for builds
that do not build some (or all) of the targets that
edis supports.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100910 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix a typo and some indentation.
Dan Gohman [Fri, 9 Apr 2010 22:47:25 +0000 (22:47 +0000)]
Fix a typo and some indentation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100908 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoWhen determining a canonical insert position, don't climb deeper
Dan Gohman [Fri, 9 Apr 2010 22:07:05 +0000 (22:07 +0000)]
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

14 years agoTidy whitespace.
Bob Wilson [Fri, 9 Apr 2010 21:38:26 +0000 (21:38 +0000)]
Tidy whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100904 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoIf all the bit positions are not specified; do not decode the instructions.
Johnny Chen [Fri, 9 Apr 2010 21:01:02 +0000 (21:01 +0000)]
If all the bit positions are not specified; do not decode the instructions.
We are bound to fail!  For proper disassembly, the well-known encoding bits
of the instruction must be fully specified.

This also removes pseudo instructions from considerations of disassembly,
which is a better design and less fragile than the name matchings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100899 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agosuck the propagating "has dynamic libs" check into a single makefile
Chris Lattner [Fri, 9 Apr 2010 20:51:47 +0000 (20:51 +0000)]
suck the propagating "has dynamic libs" check into a single makefile
variable TARGET_HAS_DYNAMIC_LIBS

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100896 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoadd minix support, patch by Kees van Reeuwijk! PR6797
Chris Lattner [Fri, 9 Apr 2010 20:45:04 +0000 (20:45 +0000)]
add minix support, patch by Kees van Reeuwijk!  PR6797

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100895 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoclean this up, fix std::min ambiguity on some platforms.
Chris Lattner [Fri, 9 Apr 2010 20:43:54 +0000 (20:43 +0000)]
clean this up, fix std::min ambiguity on some platforms.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100894 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdding IPSCCP and Internalize passes to the C-bindings
Wesley Peck [Fri, 9 Apr 2010 20:43:20 +0000 (20:43 +0000)]
Adding IPSCCP and Internalize passes to the C-bindings

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100893 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoProvide versions of the ARM eh_sjlj_setjmp instructions for non-VFP subtargets
Bob Wilson [Fri, 9 Apr 2010 20:41:18 +0000 (20:41 +0000)]
Provide versions of the ARM eh_sjlj_setjmp instructions for non-VFP subtargets
such that the non-VFP versions have no implicit defs of VFP registers.
If any callee-saved VFP registers are marked as having been defined, the
prologue/epilogue code will try to save and restore them.
Radar 7770432.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100892 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMove 'Optional' class from Clang to LLVM/ADT.
Ted Kremenek [Fri, 9 Apr 2010 20:25:54 +0000 (20:25 +0000)]
Move 'Optional' class from Clang to LLVM/ADT.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100889 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoARM decoder emitter should print out useful information unconditionally when it
Johnny Chen [Fri, 9 Apr 2010 19:31:33 +0000 (19:31 +0000)]
ARM decoder emitter should print out useful information unconditionally when it
encounters decoding conflicts, instead of wrapping it inside the DEBUG() macro.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100886 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoWhen emitting code for an add, don't force a SCEVUnknown wrapper around
Dan Gohman [Fri, 9 Apr 2010 19:14:31 +0000 (19:14 +0000)]
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

14 years agoWhen looking for loop-invariant users, look through no-op instructions,
Dan Gohman [Fri, 9 Apr 2010 19:12:34 +0000 (19:12 +0000)]
When looking for loop-invariant users, look through no-op instructions,
so that an unfortunately placed bitcast doesn't pin a value in a
register.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100883 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMake sure this test tests something.
Benjamin Kramer [Fri, 9 Apr 2010 19:03:31 +0000 (19:03 +0000)]
Make sure this test tests something.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100879 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix a grammaro.
Bob Wilson [Fri, 9 Apr 2010 18:39:54 +0000 (18:39 +0000)]
Fix a grammaro.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100877 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd a testcase for svn r100568.
Bob Wilson [Fri, 9 Apr 2010 18:29:29 +0000 (18:29 +0000)]
Add a testcase for svn r100568.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100876 91177308-0d34-0410-b5e6-96231b3b80d8

14 years ago"On SPU, variables in the .bss section that are allocated with the .lcomm directive...
Chris Lattner [Fri, 9 Apr 2010 18:27:03 +0000 (18:27 +0000)]
"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

14 years agoAdd a comment.
Dan Gohman [Fri, 9 Apr 2010 18:20:03 +0000 (18:20 +0000)]
Add a comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100874 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix up header comments to match the comment fixups I made in r100849.
Bob Wilson [Fri, 9 Apr 2010 16:24:49 +0000 (16:24 +0000)]
Fix up header comments to match the comment fixups I made in r100849.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100869 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoClear InsnsBeginScopeSet and InsnsEndScopeSet at the end of function.
Devang Patel [Fri, 9 Apr 2010 16:04:20 +0000 (16:04 +0000)]
Clear InsnsBeginScopeSet and InsnsEndScopeSet at the end of function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100867 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoperformance: cache result of looking up user
Gabor Greif [Fri, 9 Apr 2010 15:18:34 +0000 (15:18 +0000)]
performance: cache result of looking up user

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100862 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMerge a few fast-isel tests.
Dan Gohman [Fri, 9 Apr 2010 15:03:55 +0000 (15:03 +0000)]
Merge a few fast-isel tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100860 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMinor code simplification.
Dan Gohman [Fri, 9 Apr 2010 14:53:59 +0000 (14:53 +0000)]
Minor code simplification.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100859 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDelete this obsolete comment.
Dan Gohman [Fri, 9 Apr 2010 14:12:01 +0000 (14:12 +0000)]
Delete this obsolete comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100858 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoconst-ize a predicate
Gabor Greif [Fri, 9 Apr 2010 10:57:00 +0000 (10:57 +0000)]
const-ize a predicate

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100856 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd a missing dependency to this library when building with CMake.
Chandler Carruth [Fri, 9 Apr 2010 05:55:25 +0000 (05:55 +0000)]
Add a missing dependency to this library when building with CMake.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100852 91177308-0d34-0410-b5e6-96231b3b80d8