Commit Graph

32070 Commits

Author SHA1 Message Date
Chris Lattner
687bc9bfde remove a turd
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81186 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-08 03:47:41 +00:00
Chris Lattner
4cb81bdd56 instcombine transforms vector loads that are only used by
extractelement operations into a bitcast of the pointer,
then a gep, then a scalar load.  Disable this when the vector
only has one element, because it leads to infinite loops in
instcombine (PR4908).

This transformation seems like a really bad idea to me, as it
will likely disable CSE of vector load/stores etc and can be
better done in the code generator when profitable.  This
goes all the way back to the first days of packed types,
r25299 specifically.

I'll let those people who care about the performance of vector
code decide what to do with this.





git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81185 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-08 03:44:51 +00:00
Nick Lewycky
4b6af8aa5b Simplify from my last change. Assert1 is a macro that makes its caller return,
so "Assert1(isa<>); cast<>" is a valid idiom.

Actually check the PHI node's odd-numbered operands for BasicBlock-ness, like
the comment said.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81182 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-08 02:02:39 +00:00
Dan Gohman
ed48caf5e7 Fix an abort on a store of an empty struct member. getValue returns
null in the case of an empty struct, so don't try to call getNumValues
on it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81180 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-08 01:44:02 +00:00
Nick Lewycky
49072473ba Verify types. Invalid types can be constructed when assertions are off.
Make the verifier more robust by avoiding unprotected cast<> calls. Notably,
Assert1(isa<>); cast<> is not safe as Assert1 does not terminate the program.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81179 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-08 01:23:52 +00:00
Chris Lattner
ff1e98c72a Fix PR4882, by making MemCpyOpt not dereference removed stores to get the
context for the newly created operations.
 
Patch by Jakub Staszak!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81175 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-08 00:27:14 +00:00
Chris Lattner
b9a4ddbbcd fix ComputeMaskedBits handling of zext/sext/trunc to work with vectors.
This fixes PR4905


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81174 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-08 00:13:52 +00:00
Chris Lattner
cf5128ec01 add some comments to describe the invariants.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81173 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-08 00:06:16 +00:00
Dan Gohman
f8dbee7cea Reappy r80998, now that the GlobalOpt bug that it exposed on MiniSAT is fixed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81172 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-07 23:54:19 +00:00
Dan Gohman
fd06aa7c07 Fix a thinko: When lowering fneg with xor, bitcast the operands
from floating-point to integer first, and bitcast the result
back to floating-point. Previously, this test was passing by
falling back to SelectionDAG lowering. The resulting code isn't
as nice, but it's correct and CodeGen now stays on the fast path.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81171 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-07 23:47:14 +00:00
Dan Gohman
80bdc967e9 Don't commit stores with addresses that have indices that are not
compile-time constant integers or that are out of bounds for their
corresponding static array types. These can cause aliasing that
GlobalOpt assumes won't happen.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81165 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-07 22:44:55 +00:00
Dan Gohman
ce5de5b527 Don't commit addresses of aggregate values. This avoids problems with
an aggregate store overlapping a different aggregate store, despite
the stores having distinct addresses.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81164 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-07 22:42:05 +00:00
Dan Gohman
c62482d4ed Fix GlobalOpt to avoid committing a store if the address getelementptr
is missing the inbounds flag. This is slightly conservative, but it
avoids problems with two constants pointing to the same address but
getting distinct entries in the Memory DenseMap.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81163 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-07 22:40:13 +00:00
Dan Gohman
4a7e6b7a15 Preserve the InBounds flag when evaluating a getelementptr instruction
into a getelementptr ConstantExpr.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81162 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-07 22:34:43 +00:00
Dan Gohman
fd54a898be Simplify this code by using hasDefinitiveInitializer().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81161 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-07 22:31:26 +00:00
Nick Lewycky
a9b7738d13 Express this in the canonical way.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81157 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-07 21:50:24 +00:00
Nick Lewycky
29ef6599ee Homogenize whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81156 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-07 20:44:51 +00:00
Duncan Sands
3429c5e153 Using a signal handler that does nothing should be
equivalent to SIG_IGN.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81144 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-07 05:58:25 +00:00
Daniel Dunbar
d34b0b1cda Disable MDNode uniquing.
- Hopefully this unbreaks some llvm-gcc bootstraps.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81141 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-07 04:05:49 +00:00
Eric Christopher
f61f89ae14 Fix comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81138 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-06 22:20:54 +00:00
Anton Korobeynikov
6c4025773a Do not create calls via PLT in compilation callback - this is higly platform
dependent. Hopefully, this will fix PR3801.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81132 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-06 20:21:48 +00:00
Duncan Sands
f7f4ba6c1f Do not try to override non-virtual methods, especially
when the new method gives the same result as the original
(as far as I can see).  This will hopefully pacify icc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81131 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-06 20:02:00 +00:00
Duncan Sands
da9ad384af Remove a left over bit of code with no effect.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81128 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-06 19:29:07 +00:00
Duncan Sands
0268790ba4 Avoid warnings if assertions are off.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81127 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-06 19:28:38 +00:00
Duncan Sands
33ef807145 Remove unreachable code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81126 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-06 19:27:53 +00:00
Duncan Sands
5149852975 Simplify. Testing shows that this is not equivalent to BBI = CR.CaseBB + 1.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81124 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-06 18:03:32 +00:00
Duncan Sands
875f4ae789 Avoid an unused variable warning when assertions are
disabled.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81122 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-06 16:27:34 +00:00
Duncan Sands
18f13c66bf Mark more constants unsigned, as warned about by icc (#68).
Patch by Erick Tryzelaar.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81116 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-06 12:56:52 +00:00
Duncan Sands
c2d98bc0d6 Remove some not-really-used variables, as warned
about by icc (#593, partial).  Patch by Erick Tryzelaar.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81115 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-06 12:41:19 +00:00
Benjamin Kramer
8b3594afdb More MSVC warning fixes:
1. DUPMAX is defined in regcomp.c, no need to redefine it in regutils.
2. MSVC doesn't like snprintf, use _snprintf instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81114 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-06 12:26:28 +00:00
Duncan Sands
613c581b81 Remove strange 'const' qualifiers, as warned about by icc
(#411).  Patch by Erick Tryzelaar.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81113 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-06 12:16:26 +00:00
Benjamin Kramer
be441c0f34 It's a bool, so treat it like one. Fixes a MSVC warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81112 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-06 12:10:17 +00:00
Duncan Sands
740eb5323e Tweak code into an equivalent form for which icc
doesn't warn about unreachable instructions.  Patch
by Erick Tryzelaar (#111).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81110 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-06 10:53:22 +00:00
Benjamin Kramer
5b7c3567a1 Remove splint hints to silence warnings from ICC and MSVC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81108 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-06 09:29:39 +00:00
Duncan Sands
59bf4fcc06 Public and private corrections, warned about by icc (#304).
Patch by Erick Tryzelaar.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81107 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-06 08:55:57 +00:00
Duncan Sands
b7c5bdf843 Remove some unused variables and methods warned about by
icc (#177, partial).  Patch by Erick Tryzelaar.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81106 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-06 08:33:48 +00:00
Daniel Dunbar
f94880b479 Fix a possible crash call setIsInBounds.
- I think there are more instances of this, but I think they are fixed in Dan's
   incoming patch. This one was preventing me from doing a bugpoint reduction
   though.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81103 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-06 02:31:36 +00:00
Evan Cheng
8f78a58e14 Revert r80926. It causes loop unswitch assertion and slow down some JIT tests significantly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81101 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-06 02:26:10 +00:00
Daniel Dunbar
92a97a9166 Revert "Include optional subclass flags, such as inbounds, nsw, etc., ...", this
breaks MiniSAT on x86_64.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81098 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-06 00:11:24 +00:00
Devang Patel
bd1d6a8ce1 Detect VLAs.
Do not use DenseMap operator[] because it inserts new entry if lookup fails. Use find() to check an entry in a DenseMap first.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81058 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-05 00:34:14 +00:00
Devang Patel
905cf5e0bd Ignore malformed global variable debug info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81055 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-04 23:59:07 +00:00
Devang Patel
68f195cc50 While replacing an MDNode elment, properly update MDNode's operand list.
MDNode's operand list does not include all elements.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81045 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-04 21:32:05 +00:00
Andreas Neustifter
31dcbc3b4a Prevent warnings on compilers for which its not clear that assert won't return.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81044 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-04 21:22:04 +00:00
Lang Hames
8651125d28 Replaces uses of unsigned for indexes in LiveInterval and VNInfo with
a new class, MachineInstrIndex, which hides arithmetic details from
most clients. This is a step towards allowing the register allocator
to update/insert code during allocation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81040 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-04 20:41:11 +00:00
Andreas Neustifter
e8d372e48d Cleaned up ProfileVerifierPass.
(See http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20090831/086219.html)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81007 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-04 17:15:10 +00:00
Andreas Neustifter
ed1ac4ae8e Converted MaximumSpanningTree algorithm to a generic template, this could go
into llvm/ADT.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81001 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-04 12:34:44 +00:00
Dan Gohman
859fff476d Include optional subclass flags, such as inbounds, nsw, etc., in the
Constant uniquing tables. This allows distinct ConstantExpr objects
with the same operation and different flags.

Even though a ConstantExpr "a + b" is either always overflowing or
never overflowing (due to being a ConstantExpr), it's still necessary
to be able to represent it both with and without overflow flags at
the same time within the IR, because the safety of the flag may
depend on the context of the use. If the constant really does overflow,
it wouldn't ever be safe to use with the flag set, however the use
may be in code that is never actually executed.

This also makes it possible to merge all the flags tests into a single test.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80998 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-04 12:08:11 +00:00
Duncan Sands
70327dabb4 Use delete[] to match new[] (found by valgrind).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80997 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-04 11:59:43 +00:00
Evan Cheng
030a0a0cdb Run branch folding if if-converter make some transformations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80994 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-04 07:47:40 +00:00
Evan Cheng
e93909185f Fix comment for consistency sake.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80993 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-04 07:46:30 +00:00
Jim Grosbach
e995221308 Whitespace cleanup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80978 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-04 01:38:51 +00:00
Eric Christopher
82f149d794 If there's a calling convention attach it to the rewind function call.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80976 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-04 01:14:14 +00:00
Evan Cheng
b3c2742896 Funky indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80971 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 23:54:22 +00:00
Daniel Dunbar
b5f25967d0 Revert "--- Reverse-merging r80908 into '.':", I already "fixed" this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80970 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 23:40:10 +00:00
Dan Gohman
6e7ad95868 Revert 80959. It isn't sufficient to solve the full problem. And it
introduced regressions in the Ocaml bindings tests.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80969 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 23:34:49 +00:00
Bill Wendling
1c5ffdf987 --- Reverse-merging r80908 into '.':
D    test/Analysis/Profiling

--- Reverse-merging r80907 into '.':
U    lib/Analysis/ProfileInfoLoaderPass.cpp

Attempt to remove failure in the self-hosting build bot.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80966 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 23:13:46 +00:00
Dan Gohman
3d45a853db LLVM currently represents floating-point negation as -0.0 - x. Fix
FastISel to recognize this pattern and emit a floating-point
negation using xor.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80963 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 22:53:57 +00:00
David Goodwin
4f7228f851 Don't crash when target has no itineraries.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80962 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 22:48:51 +00:00
Bill Wendling
eb3a766529 If we've pushed registers onto the stack, but aren't adjusting the stack pointer
(i.e., there are no local variables and stuff), we still need to output FDE
information for the pushed registers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80960 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 22:19:22 +00:00
Dan Gohman
e56a94ef91 Remove the API for creating ConstantExprs with the nsw, nuw, inbounds,
and exact flags. Because ConstantExprs are uniqued, creating an
expression with this flag causes all expressions with the same operands
to have the same flag, which may not be safe. Add, sub, mul, and sdiv
ConstantExprs are usually folded anyway, so the main interesting flag
here is inbounds, and the constant folder already knows how to set the
inbounds flag automatically in most cases, so there isn't an urgent need
for the API support.

This can be reconsidered in the future, but for now just removing these
API bits eliminates a source of potential trouble with little downside.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80959 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 22:17:40 +00:00
David Goodwin
5e41178a6e Create our own block initializer for kill fixups as the scheduling one wasn't doing the right thing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80958 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 22:15:25 +00:00
David Goodwin
e8d82c0e4f Calls clobber FPSCR.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80956 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 22:12:28 +00:00
Bob Wilson
cc80df92c1 Overhaul the TwoAddressInstructionPass to simplify the logic, especially
for the complicated case where one register is tied to multiple destinations.
This avoids the extra scan of instruction operands that was introduced by
my recent change.  I also pulled some code out into a separate
TryInstructionTransform method, added more comments, and renamed some
variables.

Besides all those changes, this takes care of a FIXME in the code regarding
an assumption about there being a single tied use of a register when
converting to a 3-address form.  I'm not aware of cases where that assumption
is violated, but the code now only attempts to transform an instruction,
either by commuting its operands or by converting to a 3-address form,
for the simple case where there is a single pair of tied operands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80945 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 20:58:42 +00:00
Dan Gohman
058db9287a Smallvectorize switchExitBlocks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80942 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 20:36:13 +00:00
Devang Patel
faf8fa5664 There is not any need to copy metadata while merging modules.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80941 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 20:35:57 +00:00
Dan Gohman
8d44b28bc6 Recognize more opportunities to use SSE min and max instructions,
swapping the operands if necessary.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80940 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 20:34:31 +00:00
Mon P Wang
efa422023f Fixed a few problems with vector shifts
- when transforming a vector shift of a non-immediate scalar shift amount, zero
    extend the i32 shift amount to i64 since the vector shift reads 64 bits
  - when transforming i16 vectors to use a vector shift, zero extend i16 shift amount
  - improve the code quality in some cases when transforming vectors to use a vector shift



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80935 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 19:56:25 +00:00
Dan Gohman
2f67df794a Add a -disable-16bit flag and associated support for experimenting with
disabling the use of 16-bit operations on x86. This doesn't yet work for
inline asms with 16-bit constraints, vectors with 16-bit elements,
trampoline code, and perhaps other obscurities, but it's enough to try
some experiments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80930 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 17:18:51 +00:00
Kevin Enderby
7b4608dfa0 Removed the non-target independent AsmToken::Register enum constant
from MCAsmLexer.h in preparation of supporting other targets.  Changed the
X86AsmParser code to reflect this by removing AsmLexer::LexPercent and looking
for AsmToken::Percent when parsing in places that used AsmToken::Register.
Then changed X86ATTAsmParser::ParseRegister to parse out registers as an
AsmToken::Percent followed by an AsmToken::Identifier.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80929 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 17:15:07 +00:00
Devang Patel
73b1ee857b Use WeakVH to hold dead mdnodes. Check use_empty() before deleting a node.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80928 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 17:03:47 +00:00
Dan Gohman
8fc5ad3369 Add a verifyAnalysis to LoopInfo, LoopSimplify, and LCSSA form that verify
that these passes are properly preserved.

Fix several transformation passes that claimed to preserve LoopSimplify
form but weren't.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80926 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 16:31:42 +00:00
Dan Gohman
f0608d829a Move getUniqueExitBlocks from LoopBase to Loop, since they depend on
LoopSimplify form, which is currently only available on Loops (and
not MachineLoops). Also, move the code out of the header file.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80923 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 16:10:48 +00:00
Dan Gohman
bccfc24c4e Change PHINode::hasConstantValue to have a DominatorTree argument
instead of a bool argument, and to do the dominator check itself.
This makes it eaiser to use when DominatorTree information is
available.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80920 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 15:34:35 +00:00
Dan Gohman
dd12de686c Don't try to verify a LoopPass analysis if the loop has been deleted.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80919 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 15:09:24 +00:00
Dan Gohman
e7125f4bab Remove references to expression "handles", which are no longer used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80918 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 15:00:26 +00:00
Benjamin Kramer
6d5f0f041f CppBackend: avoid printing unnecessary whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80917 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 14:58:24 +00:00
Duncan Sands
05cd03b335 Keep track of how many memmove calls were turned into
memcpy calls.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80915 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 13:37:16 +00:00
Andreas Neustifter
f0d568d38b Fix build warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80912 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 09:11:10 +00:00
Andreas Neustifter
3985943871 Code Cleanup.
Removed inverted flag form MaximumSpanningTree, also do not handle so much
information to MaximumSpanningTree.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80911 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 08:52:52 +00:00
Andreas Neustifter
4c2c53353e Code Cleanup.
(See http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20090831/086139.html)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80909 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 08:41:05 +00:00
Daniel Dunbar
0981a0a106 Remove undefined behavior when loading optimal edge profile info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80907 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 07:37:42 +00:00
Chris Lattner
47ad2d6e97 don't call getOffset() on jump tables, this fixes three failing olden benchmarks
with the new asmprinter.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80906 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 07:36:42 +00:00
Chris Lattner
975d7e0392 Implement support for X86II::MO_GOT_ABSOLUTE_ADDRESS. We get very
different formatting from the old asmprinter, but it should be 
semantically the same.  We used to get:

	popl	%eax
	addl	$_GLOBAL_OFFSET_TABLE_ + [.-.Lllvm$6.$piclabel], %eax
...

Now we get:

	popl	%eax
.Lpicbaseref6:
	addl	$(_GLOBAL_OFFSET_TABLE_ + (.Lpicbaseref6 - .Lllvm$6.$piclabel)), %eax
...




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80905 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 07:30:56 +00:00
Evan Cheng
63476a8040 Reference to hidden symbols do not have to go through non-lazy pointer in non-pic mode. rdar://7187172.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80904 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 07:04:02 +00:00
Nick Lewycky
8aa9fba7cb Remove VISIBILITY_HIDDEN from this file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80903 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 06:43:15 +00:00
Chris Lattner
aadb35f809 fix MCSymbol printing to exactly match the normal mangler rules so
we can diff .s files.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80894 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 05:57:47 +00:00
Chris Lattner
1fe02ffbec remove extraneous hack.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80893 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 05:54:00 +00:00
Daniel Dunbar
848113833f Make these functions static and local.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80892 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 05:47:34 +00:00
Chris Lattner
684c593d05 Thread an MCAsmInfo pointer through the various MC printing APIs,
and fix a few things using << on MCSymbols to use ->print(). No
functionality change other than unbreaking my previous patch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80890 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 05:46:51 +00:00
Chris Lattner
5c5ce5cef4 just use dump()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80889 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 05:39:09 +00:00
Chris Lattner
d87eb6454d inline insertion operators.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80888 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 05:33:01 +00:00
Chris Lattner
e9f9a7e10e In C++, code is not allowed to call main. In C it is, this
simplifylibcalls optimization is thus valid for C++ but not C.
It's not important enough to worry about for C++ apps, so just
remove it.

rdar://7191924



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80887 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 05:19:59 +00:00
Chris Lattner
47548d3365 merge globaladdress symbol processing stuff into other stuff. Now
all global variable operand flag processing stuff is shared between
different operand types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80886 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 05:06:07 +00:00
Evan Cheng
22f9144c9b Unbreak x86_64 build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80885 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 05:01:00 +00:00
Chris Lattner
e8c2780521 Split the "operand -> symbol" logic from the "get offset and other munging
from operand" logic.  GlobalAddress still todo.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80884 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 04:56:20 +00:00
Chris Lattner
118c27c6d4 implement lowering support for constant pool index operands, this gets a bunch more
olden programs working.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80881 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 04:44:53 +00:00
Evan Cheng
d0da6ff3ad X86JITInfo::getLazyResolverFunction() should not read cpu id to determine whether sse is available. Just use consult subtarget.
No functionality changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80880 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 04:37:05 +00:00
Chris Lattner
579531c61b output alignment value in hex so that we get:
.align 3, 0x90
instead of,
  .align 3, 144

suggested by eric.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80875 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 04:01:10 +00:00
Chris Lattner
ef6b2c05fd simplify this by using SmallString::str(), much nicer!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80874 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 03:54:02 +00:00
Lang Hames
3f2f3f5341 Fixed a test that ensures the LocalRewriter does not attempt to
avoid reloads by reusing clobbered registers.

This was causing issues in 256.bzip2 when compiled with PIC for
a while (starting at r78217), though the problem has since been masked. 



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80872 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 02:52:02 +00:00