Commit Graph

59809 Commits

Author SHA1 Message Date
Dan Gohman 0ebddbe1d9 Move getType() and getCaller() into CallSiteBase so that
ImmutableCallSite can use them too.

llvm-svn: 101279
2010-04-14 20:28:44 +00:00
Evan Cheng 9e100384cb Trim tests and convert to FileCheck.
llvm-svn: 101277
2010-04-14 20:22:17 +00:00
Dan Gohman c87b74d913 Delete unneeeded arguments.
llvm-svn: 101276
2010-04-14 20:17:22 +00:00
Dan Gohman a3918ecdf5 Delete unused arguments.
llvm-svn: 101275
2010-04-14 20:05:00 +00:00
Dan Gohman 7deb447781 Factor out EH landing pad code into a separate function, and constify
a bunch of stuff to support it.

llvm-svn: 101273
2010-04-14 19:53:31 +00:00
Dan Gohman c2c08d19b8 Reset the debug location even if the instruction was a terminator.
llvm-svn: 101272
2010-04-14 19:30:02 +00:00
Dan Gohman a0e9a7285e Fix a missing #include.
llvm-svn: 101270
2010-04-14 18:57:18 +00:00
Dan Gohman cacd4f2401 Refine #includes.
llvm-svn: 101269
2010-04-14 18:49:17 +00:00
Dan Gohman d313a05a16 Split ISD::NodeType and a few related items out of SelectionDAGNodes.h
into a separate header to allow clients to use them without pulling in
SelectionDAG-specific declarations.

llvm-svn: 101268
2010-04-14 18:44:34 +00:00
Dan Gohman 8ebcbe949a Pull utility routines with no SelectionDAG dependence out of
SelectionDAGBuilder. FunctionLoweringInfo isn't an ideal place for
them to live, but it's better than SelectionDAGBuilder for now.

llvm-svn: 101267
2010-04-14 18:31:02 +00:00
Dan Gohman f5cca35750 Fix typos in comments.
llvm-svn: 101266
2010-04-14 18:24:06 +00:00
Gabor Greif fefdd42644 performance: cache the dereferenced use_iterator
llvm-svn: 101265
2010-04-14 18:13:29 +00:00
Dan Gohman fea9ba18ff Delete an obsolete comment.
llvm-svn: 101264
2010-04-14 17:40:25 +00:00
Dan Gohman 3215eae4a3 Delete an unused function.
llvm-svn: 101263
2010-04-14 17:22:02 +00:00
Dan Gohman 094fc7b09e Clear the FunctionLoweringInfo object before doing other things that
don't need it.

llvm-svn: 101262
2010-04-14 17:13:16 +00:00
Dan Gohman ad0b3ea3cc Move this assert out of SelectionDAGISel into FunctionLoweringInfo, and
drop the redundant #ifndef NDEBUG.

llvm-svn: 101261
2010-04-14 17:11:23 +00:00
Dan Gohman 0f405c8d73 Add a comment.
llvm-svn: 101260
2010-04-14 17:09:37 +00:00
Dan Gohman 2ca8fb229c Move the code for initialing the entry block livein set out of
SelectionDAGISel.

llvm-svn: 101258
2010-04-14 17:05:00 +00:00
Dan Gohman 4bfb437ec9 Reorgnaize this code to be more tidy and readable.
llvm-svn: 101256
2010-04-14 17:02:07 +00:00
Dan Gohman 1939b5f130 Trim #includes.
llvm-svn: 101255
2010-04-14 16:54:39 +00:00
Dan Gohman 2b79ee8bc8 Move the code for emitting livein copies out of SelectionDAGISel.
llvm-svn: 101254
2010-04-14 16:51:49 +00:00
Gabor Greif c08e5df836 performance: cache the dereferenced use_iterator
llvm-svn: 101253
2010-04-14 16:48:56 +00:00
Dan Gohman 69e8e322d9 Sink landing-pad marking code out of
SelectionDAGISel::runOnMachineFunction into FunctionLowering.

llvm-svn: 101252
2010-04-14 16:32:56 +00:00
Dan Gohman f57117d166 It's not necessary to recompute EB here.
llvm-svn: 101251
2010-04-14 16:30:40 +00:00
Gabor Greif a49686fa3e performance: cache the dereferenced use_iterator
llvm-svn: 101250
2010-04-14 16:13:56 +00:00
Dan Gohman 65de3d140d Add a comment.
llvm-svn: 101248
2010-04-14 16:08:56 +00:00
Dan Gohman 4083e9afaf Fix whitespace, comments.
llvm-svn: 101247
2010-04-14 15:59:02 +00:00
Dan Gohman 8a616ea9a9 Add explicit keywords.
llvm-svn: 101246
2010-04-14 15:50:02 +00:00
Dan Gohman 7947f03a07 Use C++, not C++-standard-library-internals-ese.
llvm-svn: 101245
2010-04-14 15:41:50 +00:00
Dan Gohman f1f0c9ded8 Make SuccIterator's private parts private too.
llvm-svn: 101244
2010-04-14 15:38:15 +00:00
Dan Gohman 6177386b05 Make helper utility members private.
llvm-svn: 101243
2010-04-14 15:33:04 +00:00
Benjamin Kramer a050255103 EDis: Don't include inttypes.h. We support compilers which don't provide it. It was unused anyways.
llvm-svn: 101241
2010-04-14 13:56:38 +00:00
Nick Lewycky cc924c7483 Enable RTTI again. While this works fine for LLVM, it creates an ABI
incompatibility with some clients covered by the buildbots, such as llvm-gcc.

llvm-svn: 101237
2010-04-14 05:51:59 +00:00
Nick Lewycky 80ee5e299c Don't forget cmake!
llvm-svn: 101234
2010-04-14 05:35:20 +00:00
Nick Lewycky 81f8f03dc9 Turn off RTTI for VMCore. Yay!
llvm-svn: 101233
2010-04-14 05:30:13 +00:00
Nick Lewycky 163a743b51 I don't know how, but I managed to goof the revert. Remove function that should
have been removed in r101231.

llvm-svn: 101232
2010-04-14 05:03:50 +00:00
Nick Lewycky ca615eb0d6 Revert r101213.
llvm-svn: 101231
2010-04-14 04:51:58 +00:00
Nick Lewycky c37b45bd2d Remove accidentally committed cruft.
llvm-svn: 101230
2010-04-14 04:46:11 +00:00
Nick Lewycky 7cd1aa31ac Fix 80 column ruler.
llvm-svn: 101229
2010-04-14 04:40:35 +00:00
Nick Lewycky 7c167954e2 Bugpoint no longer uses exceptions.
llvm-svn: 101228
2010-04-14 04:40:31 +00:00
Chris Lattner 6b55cb9cd8 implement mc asmparser support for '.', which gets the
current PC.  rdar://7834775

We now produce an identical .o file compared to the cctools
assembler for something like this:

_f0:
L0:
        jmp L1
        .long . - L0
L1:
        jmp A
        .long . - L1

        .zerofill __DATA,_bss,A,0

llvm-svn: 101227
2010-04-14 04:40:28 +00:00
Nick Lewycky 087d59cf25 Remove tab.
llvm-svn: 101223
2010-04-14 04:19:05 +00:00
Nick Lewycky 8408f33deb Commit testcase for r101213.
llvm-svn: 101214
2010-04-14 03:46:42 +00:00
Nick Lewycky 3cdae269f0 While DAE can't modify the function signature of an externally visible function,
it can check whether the visible direct callers are passing in parameters to
dead arguments and replace those with undef.

This reinstates r94322 with bugs fixed.

llvm-svn: 101213
2010-04-14 03:38:11 +00:00
Dan Gohman 5f40d34958 Generalize this code to handle Instructions in addition to ConstantExprs.
llvm-svn: 101210
2010-04-14 02:33:23 +00:00
Dan Gohman 9162fb07be Reorder the methods of this class to be a little more organized.
llvm-svn: 101206
2010-04-14 02:09:45 +00:00
Johnny Chen 48bbf4910e Fixed another assert exposed by fuzzing. Now, when an encoding error occurs
involing getBFCInvMask() where lsb <= msb does not hold true, the disassembler
just returns false, instead of assert, to indicate disassembly error.

llvm-svn: 101205
2010-04-14 02:05:29 +00:00
Devang Patel b7eadda495 Clear MachineInstr->MCSymbol maps at the end of a function.
llvm-svn: 101202
2010-04-14 01:18:28 +00:00
Johnny Chen 82c3cadad6 Fixed an assert() exposed by fuzzing. Now, instead of assert when an invalid
instruction encoding is encountered, we just return a NULL ARMBasicMCBuilder
instance and the client just returns false to indicate disassembly error.

llvm-svn: 101201
2010-04-14 01:17:37 +00:00
Daniel Dunbar 780792dc86 Fix -Asserts warnings.
llvm-svn: 101191
2010-04-13 23:34:11 +00:00
Devang Patel c48b976c08 XFAIL this test for powerpc.
This test relies on iSel lowering dbg_declare intrinsic when CodeGen::OptLevel is None. On PPC side, CodeGen::OptLevel stays to default when -O0 is used on the command line.

llvm-svn: 101190
2010-04-13 23:23:09 +00:00
Douglas Gregor 9078f954bf Unbreak CMake build by improving the EnhancedDisassembly makefile a
bit (we're not trying to build a shared library yet) and generating
the X86GenEDInfo.inc and ARMGenEDInfo.inc files as necessary.

llvm-svn: 101188
2010-04-13 22:47:43 +00:00
Evan Cheng 87585d72a5 Fast path implicit_def check.
llvm-svn: 101183
2010-04-13 22:13:34 +00:00
Evan Cheng 6c35893aa6 Add test for post-ra machine licm.
llvm-svn: 101182
2010-04-13 22:10:03 +00:00
Bob Wilson 699bdf7adf Handle a v2f64 formal parameter that is split between registers and memory
such that the entire second half is in memory.  Radar 7855014.

llvm-svn: 101181
2010-04-13 22:03:22 +00:00
Sean Callanan 9b6772c43a Quick fix for build errors caused by undefined
NULL.

llvm-svn: 101180
2010-04-13 21:36:35 +00:00
Sean Callanan 814e69b171 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.

llvm-svn: 101179
2010-04-13 21:21:57 +00:00
Ted Kremenek 8af6f765f5 Add CMake support for 'edis'.
llvm-svn: 101177
2010-04-13 20:52:50 +00:00
Johnny Chen 44d7d183fa 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.

llvm-svn: 101172
2010-04-13 20:35:16 +00:00
Devang Patel 12d150ea43 Do not include types without any definition in pubtypes list.
llvm-svn: 101171
2010-04-13 20:35:04 +00:00
Evan Cheng cce672c172 Avoid variable shadowing.
llvm-svn: 101170
2010-04-13 20:25:29 +00:00
Evan Cheng 89e74792b6 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.
llvm-svn: 101167
2010-04-13 20:21:05 +00:00
Jakob Stoklund Olesen 20b71e28cc 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.

llvm-svn: 101165
2010-04-13 19:06:14 +00:00
Evan Cheng 4d89dd8353 Fix test on non-x86 hosts.
llvm-svn: 101163
2010-04-13 18:54:04 +00:00
Evan Cheng 4ca4bc6f95 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.
llvm-svn: 101162
2010-04-13 18:50:27 +00:00
Chris Lattner 6b2b064d7a Make the disassembler respect the assembler dialect when printing instructions,
patch by Marius Wachtler!

llvm-svn: 101160
2010-04-13 18:41:17 +00:00
Eric Christopher d67f66dc0c Temporarily revert r101075, it's causing invalid iterator assertions
in a nightly tester.

llvm-svn: 101158
2010-04-13 18:37:58 +00:00
Evan Cheng 0a2aff2d12 Teach postra machine licm to hoist more obvious invariants, e.g. instructions with no source operands.
llvm-svn: 101154
2010-04-13 18:16:00 +00:00
Dan Gohman 8a2dae57e2 Add a few comments.
llvm-svn: 101148
2010-04-13 17:07:06 +00:00
Dan Gohman 9d2d053e11 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.

llvm-svn: 101147
2010-04-13 16:57:55 +00:00
Dan Gohman dcacef3188 Rename MachineFrameInfo variables to MFI, for consistency with
the rest of CodeGen.

llvm-svn: 101146
2010-04-13 16:56:45 +00:00
Dan Gohman 6b1b1e4358 Move MachineRegisterInfo's isLiveIn and isLiveOut out of line.
llvm-svn: 101145
2010-04-13 16:55:37 +00:00
Dan Gohman a1cf9fef70 Use MachineBasicBlock::isLiveIn.
llvm-svn: 101144
2010-04-13 16:53:51 +00:00
Dan Gohman 39305067ad Delete an unused member variable.
llvm-svn: 101143
2010-04-13 16:51:39 +00:00
Dan Gohman 7ef0dc2163 Teach ScalarEvolution to simplify smax and umax when it can prove
that one operand is always greater than another.

llvm-svn: 101142
2010-04-13 16:51:03 +00:00
Dan Gohman fe4b29180b Minor code micro-optimizations.
llvm-svn: 101141
2010-04-13 16:49:23 +00:00
Eric Christopher 4016dcd625 Actually... return after the check for invalid input.
llvm-svn: 101139
2010-04-13 16:41:29 +00:00
Benjamin Kramer 55cfaa37de BumpPtrAllocator::Reset() doesn't need to allocate anything. (Thanks, Jakob)
llvm-svn: 101138
2010-04-13 16:38:06 +00:00
Benjamin Kramer 5d8eb779d5 Update unittest for allocator laziness.
llvm-svn: 101131
2010-04-13 15:01:26 +00:00
Benjamin Kramer 5b0650bf6e 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.

llvm-svn: 101130
2010-04-13 14:41:51 +00:00
Owen Anderson b516f1c6cc Remove SCCVN from the CMake build system.
llvm-svn: 101125
2010-04-13 08:33:09 +00:00
Chris Lattner 069711865f checkpoint.
llvm-svn: 101118
2010-04-13 06:37:00 +00:00
Owen Anderson 9ed6abfe0b SCCVN, we hardly knew ye!
llvm-svn: 101117
2010-04-13 05:24:08 +00:00
Chris Lattner 33154c1fc6 Fix PR6826: GraphWriter delete the generated file before "dotty" load it,
patch by 'ether'.

llvm-svn: 101116
2010-04-13 04:35:39 +00:00
Bob Wilson af7674cbd4 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.

llvm-svn: 101114
2010-04-13 02:11:48 +00:00
Dan Gohman 5867a56db8 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.

llvm-svn: 101113
2010-04-13 01:46:36 +00:00
Daniel Dunbar d33749b4a9 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.

llvm-svn: 101111
2010-04-13 01:39:07 +00:00
Daniel Dunbar e0a355af5d IRBuilder: Add Create{Shl,LShr,And,Or,Xor} methods from uin64_t and APInt constants.
llvm-svn: 101110
2010-04-13 01:38:57 +00:00
Chris Lattner 5b212a31a2 add llvm codegen support for -ffunction-sections and -fdata-sections,
patch by Sylvere Teissier!

llvm-svn: 101106
2010-04-13 00:36:43 +00:00
Sean Callanan d75c8a0813 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.

llvm-svn: 101095
2010-04-12 23:55:28 +00:00
Dan Gohman ebbd05f8ce Micro-optimize a few hot spots.
llvm-svn: 101086
2010-04-12 23:08:18 +00:00
Evan Cheng d0d8e3343a Use .set expression for x86 pic jump table reference to reduce assembly relocation. rdar://7738756
llvm-svn: 101085
2010-04-12 23:07:17 +00:00
Dan Gohman 11862a6ed3 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.

llvm-svn: 101083
2010-04-12 23:03:26 +00:00
Bill Wendling caaf445a01 Third time's a charm...
llvm-svn: 101081
2010-04-12 22:43:21 +00:00
Bill Wendling 4fc5a4d8b8 Genericize the label test.
llvm-svn: 101079
2010-04-12 22:40:37 +00:00
Bill Wendling 4627917b9a Correct test to test what I mean it to test.
llvm-svn: 101077
2010-04-12 22:25:42 +00:00
Bill Wendling b02bbe416f 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;
}

llvm-svn: 101075
2010-04-12 22:19:57 +00:00
Dan Gohman 3cdcc3f728 Simplify this code.
llvm-svn: 101074
2010-04-12 22:12:29 +00:00
Sean Callanan 393c4df342 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.

llvm-svn: 101072
2010-04-12 21:55:49 +00:00
Dan Gohman 4a645b88ef 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.

llvm-svn: 101068
2010-04-12 21:13:43 +00:00
Sean Callanan deee643b95 Bug fix: made the enhanced disassembler's link
flags work properly when EDIS_VERSION is defined

llvm-svn: 101063
2010-04-12 20:23:08 +00:00
Sean Callanan b2134e6968 Bug fix: included System/Types.h instead of
inttypes.h to allow building on Windows.

llvm-svn: 101062
2010-04-12 20:21:56 +00:00
Sean Callanan 2d03d3a8a7 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.

llvm-svn: 101058
2010-04-12 19:43:00 +00:00
Johnny Chen fc93503c59 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) $ 

llvm-svn: 101053
2010-04-12 18:46:53 +00:00
Dan Gohman e4148978b8 Remove a #include.
llvm-svn: 101043
2010-04-12 16:26:03 +00:00
Tobias Grosser 4885db6f52 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.

llvm-svn: 101038
2010-04-12 15:32:55 +00:00
Tobias Grosser 6a5eef4067 Remove dead code in the dotty dominance tree printer.
This template is not needed anymore as it was replaced by the
DOTGraphTraitsViewer.

llvm-svn: 101036
2010-04-12 15:02:19 +00:00
Benjamin Kramer 1f336da54f Boolify.
llvm-svn: 101035
2010-04-12 12:22:19 +00:00
Benjamin Kramer d0b5c6cbed Plug trivial leak.
llvm-svn: 101034
2010-04-12 11:38:35 +00:00
Dan Gohman 27c8e79839 Delete this code, which is no longer needed.
llvm-svn: 101033
2010-04-12 08:00:22 +00:00
Dan Gohman 07f6563e81 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.

llvm-svn: 101032
2010-04-12 07:56:56 +00:00
Dan Gohman 6635bb26a6 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.

llvm-svn: 101030
2010-04-12 07:49:36 +00:00
Dan Gohman f76210ead8 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.

llvm-svn: 101028
2010-04-12 07:39:33 +00:00
Dan Gohman 15f90c294c 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.

llvm-svn: 101027
2010-04-12 07:29:15 +00:00
Evan Cheng 250283916d Enable post regalloc machine licm by default.
llvm-svn: 101023
2010-04-12 06:25:28 +00:00
Nick Lewycky 6ba630b077 Remove use of exceptions from bugpoint. No deliberate functionality change!
llvm-svn: 101013
2010-04-12 05:08:25 +00:00
Eric Christopher 1f272f7fd8 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.

llvm-svn: 101011
2010-04-12 04:48:00 +00:00
Dan Gohman ecd40a34e2 Remove unnecessary parens.
llvm-svn: 101010
2010-04-12 02:24:01 +00:00
Dan Gohman f1e40e60d3 Minor code simplification.
llvm-svn: 101009
2010-04-12 02:22:30 +00:00
Dan Gohman fa5ad797e3 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.

llvm-svn: 101008
2010-04-12 02:21:50 +00:00
Chris Lattner 3d2a36277e whether we enable dylibs or not depends on the host, not the target.
llvm-svn: 101007
2010-04-12 02:21:38 +00:00
Dan Gohman c0f1efaf8d Revert 101000, which is breaking self-host builds.
llvm-svn: 101002
2010-04-12 00:17:10 +00:00
Dan Gohman 068b793614 Fix indentation.
llvm-svn: 101001
2010-04-11 23:44:58 +00:00
Dan Gohman af4ab1b681 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.

llvm-svn: 101000
2010-04-11 23:10:12 +00:00
Dan Gohman 07591698ce Enhance ScalarEvolution::isKnownPredicate with support for
loop conditions which are invariants.

llvm-svn: 100995
2010-04-11 22:16:48 +00:00
Dan Gohman f7f28511a9 Minor code simplification.
llvm-svn: 100994
2010-04-11 22:13:11 +00:00
Dan Gohman ae4a4148ba 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.

llvm-svn: 100993
2010-04-11 22:12:18 +00:00
Dan Gohman 2352dd7ee0 Fix a comment.
llvm-svn: 100992
2010-04-11 22:07:56 +00:00
Dan Gohman 008a38b1d6 Add a cast to void to show that the return value is being
intentionally ignored.

llvm-svn: 100984
2010-04-11 19:30:19 +00:00
Dan Gohman 7841a6ecd2 Delete a dead check.
llvm-svn: 100983
2010-04-11 19:29:41 +00:00
Dan Gohman 2532856704 Delete dead code.
llvm-svn: 100981
2010-04-11 19:28:47 +00:00
Dan Gohman 93cd0f1278 Fix a #include.
llvm-svn: 100980
2010-04-11 19:27:52 +00:00
Dan Gohman b50349a979 Rename isLoopGuardedByCond to isLoopEntryGuardedByCond, to emphasise
that it's only testing for the entry condition, not full loop-invariant
conditions.

llvm-svn: 100979
2010-04-11 19:27:13 +00:00
Benjamin Kramer fedd987f4b utostr isn't going away too soon, try to make it slightly smaller.
llvm-svn: 100977
2010-04-11 19:00:03 +00:00
Nick Lewycky 3e24f7e632 Remove dead argument and clean whitespace. No functionality change.
llvm-svn: 100954
2010-04-10 23:18:13 +00:00
Chris Lattner 4568ed7893 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!

llvm-svn: 100944
2010-04-10 19:12:44 +00:00
Daniel Dunbar 4e06a5b8b3 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.

llvm-svn: 100941
2010-04-10 18:56:24 +00:00
Chris Lattner 9ae28b141f fix PR6743, a case where we'd delete an instruction before using it
in some cases.

llvm-svn: 100937
2010-04-10 18:26:57 +00:00
Chris Lattner b9801ffcb5 fix PR6760, a missing check in heap SRoA.
llvm-svn: 100936
2010-04-10 18:19:22 +00:00
Chris Lattner f60b74806f 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.

llvm-svn: 100934
2010-04-10 18:01:25 +00:00
Chris Lattner 3a747aef96 improve haiku portability, patch by Paul Davey.
llvm-svn: 100933
2010-04-10 17:54:51 +00:00
Chris Lattner 2694145e2e add attributes and module level asm to the ocaml bindings,
patch by Patrick Walton!

llvm-svn: 100932
2010-04-10 17:52:58 +00:00
Sean Callanan a4ae4e7693 Updated the edis build mechanism to allow for builds
that do not build some (or all) of the targets that
edis supports.

llvm-svn: 100910
2010-04-10 00:48:10 +00:00
Dan Gohman 70e572e740 Fix a typo and some indentation.
llvm-svn: 100908
2010-04-09 22:47:25 +00:00
Dan Gohman 607e02b33a 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.

llvm-svn: 100906
2010-04-09 22:07:05 +00:00
Bob Wilson 67dd3a4464 Tidy whitespace.
llvm-svn: 100904
2010-04-09 21:38:26 +00:00
Johnny Chen 4e8bd58001 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.

llvm-svn: 100899
2010-04-09 21:01:02 +00:00
Chris Lattner 74e2ef68b9 suck the propagating "has dynamic libs" check into a single makefile
variable TARGET_HAS_DYNAMIC_LIBS

llvm-svn: 100896
2010-04-09 20:51:47 +00:00
Chris Lattner c86cdc7d47 add minix support, patch by Kees van Reeuwijk! PR6797
llvm-svn: 100895
2010-04-09 20:45:04 +00:00
Chris Lattner 5c289f217b clean this up, fix std::min ambiguity on some platforms.
llvm-svn: 100894
2010-04-09 20:43:54 +00:00
Wesley Peck a2ca3fa781 Adding IPSCCP and Internalize passes to the C-bindings
llvm-svn: 100893
2010-04-09 20:43:20 +00:00
Bob Wilson 0106063556 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.

llvm-svn: 100892
2010-04-09 20:41:18 +00:00
Ted Kremenek bfe98e644b Move 'Optional' class from Clang to LLVM/ADT.
llvm-svn: 100889
2010-04-09 20:25:54 +00:00
Johnny Chen 298a122fb4 ARM decoder emitter should print out useful information unconditionally when it
encounters decoding conflicts, instead of wrapping it inside the DEBUG() macro. 

llvm-svn: 100886
2010-04-09 19:31:33 +00:00
Dan Gohman 3295a6e5bc 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.

llvm-svn: 100884
2010-04-09 19:14:31 +00:00
Dan Gohman 42ec4eb351 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.

llvm-svn: 100883
2010-04-09 19:12:34 +00:00
Benjamin Kramer 7e4a475929 Make sure this test tests something.
llvm-svn: 100879
2010-04-09 19:03:31 +00:00
Bob Wilson 35e856a8ed Fix a grammaro.
llvm-svn: 100877
2010-04-09 18:39:54 +00:00
Bob Wilson 030591320d Add a testcase for svn r100568.
llvm-svn: 100876
2010-04-09 18:29:29 +00:00
Chris Lattner 1ef9826ff8 "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!

llvm-svn: 100875
2010-04-09 18:27:03 +00:00
Dan Gohman 394b624215 Add a comment.
llvm-svn: 100874
2010-04-09 18:20:03 +00:00
Bob Wilson b618912206 Fix up header comments to match the comment fixups I made in r100849.
llvm-svn: 100869
2010-04-09 16:24:49 +00:00
Devang Patel 541019ddec Clear InsnsBeginScopeSet and InsnsEndScopeSet at the end of function.
llvm-svn: 100867
2010-04-09 16:04:20 +00:00
Gabor Greif ef60190a00 performance: cache result of looking up user
llvm-svn: 100862
2010-04-09 15:18:34 +00:00
Dan Gohman d23fa7d90d Merge a few fast-isel tests.
llvm-svn: 100860
2010-04-09 15:03:55 +00:00
Dan Gohman 0a8175d1db Minor code simplification.
llvm-svn: 100859
2010-04-09 14:53:59 +00:00
Dan Gohman 87f8207c97 Delete this obsolete comment.
llvm-svn: 100858
2010-04-09 14:12:01 +00:00
Gabor Greif ce6dd889ec const-ize a predicate
llvm-svn: 100856
2010-04-09 10:57:00 +00:00
Chandler Carruth 825989ab63 Add a missing dependency to this library when building with CMake.
llvm-svn: 100852
2010-04-09 05:55:25 +00:00
Bob Wilson d8eeb12120 Use getNumImplicitDefs() and getNumImplicitUses().
llvm-svn: 100850
2010-04-09 04:46:43 +00:00
Bob Wilson 406f270148 Fix up some comments.
llvm-svn: 100849
2010-04-09 04:34:03 +00:00
Chris Lattner 55ddc30f07 revert r100842 which broke several of the build bots.
llvm-svn: 100848
2010-04-09 04:24:20 +00:00
Daniel Dunbar c1ba0c96e3 lit: Add support to OneCommandPerFileTest format to take input directory from input path.
llvm-svn: 100846
2010-04-09 02:15:10 +00:00
Dan Gohman d2df643ddb Refactor the code for computing the insertion point for an expression into
a separate function.

llvm-svn: 100845
2010-04-09 02:00:38 +00:00
Sean Callanan 844a7febd3 Added a tester for the enhanced disassembler,
integrated into the llvm-mc testing tool.

llvm-svn: 100842
2010-04-09 01:43:16 +00:00
Dan Gohman 9ba08a4631 Add several more lint checks.
llvm-svn: 100841
2010-04-09 01:39:53 +00:00
Dan Gohman ee6451dca1 Fix a bug in IVUsers which was permitting non-affine addrecs to
be sent to LSR, which it isn't prepared to handle.

llvm-svn: 100839
2010-04-09 01:22:56 +00:00
Dan Gohman 9c3d160039 Don't use reserved identifiers.
llvm-svn: 100838
2010-04-09 01:19:28 +00:00
Chris Lattner c6c153be45 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

llvm-svn: 100837
2010-04-09 01:14:31 +00:00
Sean Callanan 48b1804e79 Bugfixes for edis. Code to initialize instruction
state was being executed too lazily, and the LLVM
assembly syntax for the disassembler was not being
written into the proper disassembler state variable.

llvm-svn: 100830
2010-04-09 00:11:15 +00:00
Dan Gohman 9b5d0bb774 Avoid allocating a value of zero in a register if the initial formula
inputs happen to negate each other.

llvm-svn: 100828
2010-04-08 23:36:27 +00:00
Dan Gohman 7808d490d3 Add a few more lint checks.
llvm-svn: 100825
2010-04-08 23:05:57 +00:00
Dan Gohman 4ce1fb1448 Add variants of ult, ule, etc. which take a uint64_t RHS, for convenience.
llvm-svn: 100824
2010-04-08 23:03:40 +00:00
Chris Lattner 80c345927e delete a forwarding function.
llvm-svn: 100815
2010-04-08 21:34:17 +00:00
Chris Lattner 5418dd5fda move elf section uniquing to MCContext. Along the way
merge XCore's section into MCSectionELF

llvm-svn: 100812
2010-04-08 21:26:26 +00:00
Johnny Chen 75f82345c4 Now that Evan Cheng has fixed the coalescer bug (r100804), the workaround code
to avoid memcpy() call is no longer necessary.

llvm-svn: 100811
2010-04-08 21:23:54 +00:00
Chris Lattner 433d40695b remove the TargetLoweringObjectFileMachO::getMachoSection
api and update clients to use MCContext instead.

llvm-svn: 100808
2010-04-08 20:40:11 +00:00
Chris Lattner 2073112fc0 move macho section uniquing from MCParser and TLOF to MCContext where
the compiler and asmparser now unique to the same sections.  This fixes
rdar://7835021.

llvm-svn: 100807
2010-04-08 20:30:37 +00:00
Evan Cheng b083c47c21 Coalescer should not delete copy instructions whose defs are partially dead. e.g.
%RDI<def,dead> = MOV64rr %RAX<kill>, %EDI<imp-def>

llvm-svn: 100804
2010-04-08 20:02:37 +00:00
Ted Kremenek 7ffb294c5b Update CMake build.
llvm-svn: 100802
2010-04-08 18:52:18 +00:00
Ted Kremenek d87bd77586 Fix -Wsign-compare warning (issued by clang++).
llvm-svn: 100799
2010-04-08 18:49:30 +00:00
Dan Gohman 98bc4371c7 Add a -lint pass which checks for common sources of undefined or likely
unintended behavior.

llvm-svn: 100798
2010-04-08 18:47:09 +00:00
Devang Patel 359b013129 Rename a function.
llvm-svn: 100797
2010-04-08 18:43:56 +00:00
Chris Lattner 294a90d87a implicit defs get added to the end of machine instrs sometimes. Scan the whole instruction for the metadata operand instead of assuming it will be at the end of the instruction.
llvm-svn: 100792
2010-04-08 18:20:52 +00:00
Dan Gohman cb45bd9cb3 Pointers to zero-sized objects don't point to overlapping objects.
llvm-svn: 100789
2010-04-08 18:11:50 +00:00
Dan Gohman 386e01e879 Print empty structs as {} rather than { }.
llvm-svn: 100787
2010-04-08 18:03:05 +00:00
Dan Gohman b6c29c27da Fix a comment.
llvm-svn: 100783
2010-04-08 17:41:04 +00:00
Jeffrey Yasskin 96f8a4a82f Touch configure so it regenerates Disassemblers.def to include ARM so
people stop seeing a broken build in EDDisassembler.cpp

llvm-svn: 100782
2010-04-08 17:19:20 +00:00
Devang Patel 3ebd8931fb One instruction may start (or end) multiple lexical scopes.
There is no need to remember labels identifying regions marked by such instructions in each scope.

llvm-svn: 100781
2010-04-08 16:50:29 +00:00
Gabor Greif 64d8d1a022 clean up algorithm and remove operand order assumptions
llvm-svn: 100780
2010-04-08 16:46:24 +00:00