Commit Graph

32127 Commits

Author SHA1 Message Date
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
Gabor Greif
03a5f139fb back out my recent commit (r80858), it seems to break self-hosting buildbot's stage 2 configure
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80871 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 02:02:59 +00:00
Devang Patel
5f4ac848d9 Now Bitcode reader bug is fixed. Reapply 80839.
Use CallbackVH, instead of WeakVH, to hold MDNode elements.
Use FoldingSetNode to unique MDNodes in a context.
Use CallbackVH hooks to update context's MDNodeSet appropriately.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80868 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 01:39:20 +00:00
Devang Patel
c0ff8c85dc Add new value for given index in MDValuePtrs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80867 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 01:38:02 +00:00
Daniel Dunbar
7096395d02 Improve llvm::getHostTriple for some cases where the LLVM_HOSTTRIPLE is not
reliable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80863 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 01:10:13 +00:00
Gabor Greif
190390b8d3 re-commit r66920 (which has been backed out in r66953) I may have more luck this time. I'll back out if needed...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80858 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 00:18:58 +00:00
Sean Callanan
9947bbb297 Added opaque 32-, 48-, and 80-bit memory operand types to the X86
instruction tables to support segmented addressing (and other objects
of obscure type).
Modified the X86 assembly printers to handle these new operand types.
Added JMP and CALL instructions that use segmented addresses.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80857 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 00:04:47 +00:00
Daniel Dunbar
6552478ee7 Show derived host triple in --version.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80855 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-02 23:52:38 +00:00
Devang Patel
8fc5576413 Revert 80839 for now. It causes test failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80841 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-02 21:49:26 +00:00
Devang Patel
d9489cbb0c Use CallbackVH, instead of WeakVH, to hold MDNode elements.
Use FoldingSetNode to unique MDNodes in a context.
Use CallbackVH hooks to update context's MDNodeSet appropriately.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80839 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-02 21:22:09 +00:00
Anton Korobeynikov
69d1c1aebf More missed vdup patterns
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80838 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-02 21:21:28 +00:00
Chris Lattner
3bd52827bd switch from std::string to SmallString + raw_svector_ostream.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80807 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-02 17:37:38 +00:00
Chris Lattner
522e9a0435 split mcinst lowering stuff out to its own file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80806 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-02 17:35:12 +00:00
Dan Gohman
2ec5fe524c Refactor common code from ParseAssemblyString and ParseAssemblyFile,
to expose a low-level interface for parsing from an existing MemoryBuffer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80803 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-02 17:18:19 +00:00
Bob Wilson
d163917fd8 Rearrange code to eliminate redundancy and avoid gotos.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80798 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-02 16:35:35 +00:00
Nuno Lopes
2b4f28e270 plug another leak in LLParser::PerFunctionState::SetInstName()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80792 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-02 15:02:57 +00:00
Nuno Lopes
531552aaa2 plug memory leak in LLParser::PerFunctionState::SetInstName() by deleting a value after replacing it
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80790 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-02 14:22:03 +00:00
Andreas Neustifter
2252d481d6 Sort edges in MaximumSpanningTree more stable in case of equal weight.
(See http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20090824/085890.html)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80789 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-02 14:03:11 +00:00
Andreas Neustifter
8f123b85c6 Changed set of BlocksToInstrument to set of InsertedBlocks that do not have to
be instrumented.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80788 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-02 13:59:05 +00:00
Andreas Neustifter
9341cdc217 Code cleanups and added comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80781 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-02 12:38:39 +00:00
Torok Edwin
254bb831d8 Opaque types didn't work if llvm_is_multithreaded().
AlwaysOpaqueTy is always NULL at this point, and it causes an assertion failure.
Fix it by using the just constructed tmp instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80780 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-02 12:23:05 +00:00
Torok Edwin
148843b0ce Fix DbgStopPointInst->getFileName/getDirectory, broken by the MDNodification in
r80406, and readd a -print-dbginfo test.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80778 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-02 11:13:56 +00:00
Sandeep Patel
65c3c8f323 Retype from unsigned to CallingConv::ID accordingly. Approved by Bob Wilson.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80773 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-02 08:44:58 +00:00
Chris Lattner
40ef630a46 fix PR4815: some cases where DeleteDeadInstruction can delete
the instruction BBI points to.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80768 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-02 06:31:02 +00:00
Chris Lattner
20a2faa980 clean up this code a bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80767 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-02 06:15:37 +00:00
Chris Lattner
3e8b6631e6 eliminate VISIBILITY_HIDDEN from Transforms/Scalar. PR4861
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80766 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-02 06:11:42 +00:00
Chris Lattner
5260097283 refactor select 'sched insertion' out to its own method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80764 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-02 05:57:00 +00:00
Chris Lattner
700841617a Add support for modeling whether or not the processor has support for
conditional moves as a subtarget feature.  This is the easy part of 
PR4841.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80763 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-02 05:53:04 +00:00
Chris Lattner
f19f9347b8 fix PR4848 an infinite loop when indexing down through a recursive gep
and we get the original pointer type.  This doesn't mean that we're
at the first pointer being indexed.  Correct the predicate.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80762 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-02 05:35:45 +00:00
Chris Lattner
9e17b632ec fix PR4837, some bugs folding vector compares. These
return a vector of i1, not i1 itself.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80761 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-02 05:12:37 +00:00
Chris Lattner
d3bd0821b0 revert my patch, duncan points out what is wrong with my logic. Add
a comment so that I don't change this in the future :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80760 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-02 04:39:04 +00:00
Chris Lattner
b8bcbd61a8 one more try at making this simpler, hopefully it won't break everything :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80759 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-02 04:34:06 +00:00
Duncan Sands
b3020d7a08 Complicate Chris's simplification, avoiding complaints
about singular iterators when building with expensive
checks turned on.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80757 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-02 03:48:41 +00:00
Sean Callanan
a09caa56d6 Fixed the asmstrings for 8-bit, 16-bit, and 32-bit ADD %rAX, imm instructions.
Added a 64-bit ADD %RAX, imm32 instruction.
Added all 4 forms for AND %rAX, imm and CMP %rAX, imm.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80746 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-02 00:55:49 +00:00
Evan Cheng
94f07d8137 Fix PR4845: r77946 completely broke x86_64 Darwin (or any situation where the
desired triplet is a sub-target, e.g. thumbv7 vs. arm host). Reverting the
patch isn't quite right either since the previous behavior does not allow the
triplet to be overridden with -march.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80742 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-02 00:19:03 +00:00
Devang Patel
3a29d2d327 For now disable MDNode uniquing. This fixes llvm-gcc bootstrap failure on certain Mac OS X 10.5. I am working on a proper fix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80738 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 23:56:42 +00:00
Bob Wilson
86f7cd786e Avoid calling removeVirtualRegisterKilled which iterates over the operands
to find the kill, since we already have the operand.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80736 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 23:18:46 +00:00
Bob Wilson
326f43812c Refactor some code into separate functions. No functional changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80733 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 22:51:08 +00:00
Bob Wilson
c08f5fe882 Move use of LV inside condition that guards for null LV.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80731 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 22:19:00 +00:00
Daniel Dunbar
6b382d5e5b Fix build warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80730 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 22:07:12 +00:00
Daniel Dunbar
0378b72609 Simplify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80729 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 22:07:06 +00:00
Daniel Dunbar
6b677b33c0 Fix what I believe is a copy-n-pasto introduced in r78129.
- Bruno, please check!!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80728 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 22:07:00 +00:00
Daniel Dunbar
4e8d5fe510 X86/Encoding: Support ExternalSymbol operands in emitDisplacementField (for consistency).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80727 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 22:06:53 +00:00
Daniel Dunbar
31e2c7b4c1 Remove Offset from ExternalSybmol MachineOperands, this is unused (and at least partly unsupported, in X86 encoding at least).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80726 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 22:06:46 +00:00
Chris Lattner
8bff7c960c debug intrinsics do not go in the callgraph, this fixes a couple
clang regtest failures.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80724 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 21:37:50 +00:00
Chris Lattner
44a18370e0 Fix a regression I introduced in r80708, found by llvm-test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80718 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 20:33:43 +00:00
Bruno Cardoso Lopes
0bb83860f9 Fix ELF Writter related memory leaks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80717 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 19:25:52 +00:00
Andreas Neustifter
da5ea94554 OptimalEdgeProfiling: Reading in Profiles.
This enables LLVM to read the OptimalEdgeProfiles.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80715 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 19:08:51 +00:00
Andreas Neustifter
f771dae69a OptimalEdgeProfiling: Creation of profiles.
This adds the instrumentation and runtime part of OptimalEdgeProfiling.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80712 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 19:03:44 +00:00
Andreas Neustifter
19531d113c Small fix in ProfileEstimator that eliminates duplicated code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80711 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 19:01:59 +00:00
Jim Grosbach
ee793a6c19 reduce size of SmallString to something more reasonable
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80710 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 18:55:08 +00:00
Chris Lattner
da230cb876 remove CallGraphNode::replaceCallSite, it is redundant with other APIs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80708 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 18:52:39 +00:00
Bob Wilson
8a3198b770 Add support for generating code for vst{234}lane intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80707 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 18:51:56 +00:00
Chris Lattner
7c8c1ba40c cleanup/simplify
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80706 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 18:50:55 +00:00
Jim Grosbach
c40d9f9bae Use raw_ostream instead of sstream
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80704 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 18:49:12 +00:00
Chris Lattner
81dfb38852 remove a bunch of explicit code previously needed to update the
callgraph.  This is now dead because RAUW does the job.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80703 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 18:44:06 +00:00
David Goodwin
1f15228398 Add hidden flags to allow binary search of post-RA scheduling errors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80702 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 18:34:03 +00:00
David Goodwin
ca01a8d4ab RRX reads CPSR.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80699 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 18:32:09 +00:00
Chris Lattner
5a6a363527 doxygenate RefreshCallGraph, add a new 'verification mode', and run it after
CGSCC passes make change to ensure they are updating the callgraph correctly
(when assertions are enabled).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80698 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 18:32:03 +00:00
Sean Callanan
4a93b71fe7 Added TEST %rAX, $imm instructions to the Intel tables. These are required for the X86 disassembler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80696 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 18:14:18 +00:00
Chris Lattner
17146b867f simpler solution to iterator invalidation "problem" found
by expensive checking.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80695 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 18:13:40 +00:00
Chris Lattner
f41eaacee4 enhance memcpy opt to turn memmoves into memcpy when the src/dest
don't alias.  Remove an old and poorly reduced testcase that fails
with this transform for reasons unrelated to the original test.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80693 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 17:56:32 +00:00
Bruno Cardoso Lopes
c517cb0065 Reapply 80278
Add MO flags to simplify the printing of relocations.
Remove the support for printing large code model relocs (which
aren't supported anyway).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80691 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 17:27:58 +00:00
Jim Grosbach
33668c0f1a revert inadvertant change from previous commit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80689 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 17:19:13 +00:00
Chris Lattner
61c6ba8571 random code cleanups, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80682 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 17:09:55 +00:00
Ted Kremenek
eed51b04e3 Update CMake files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80680 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 17:01:02 +00:00
Jim Grosbach
a01d34676f Simply LSDA lable emission to use a direct special-case output instead of
EmitLabel()

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80677 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 16:43:35 +00:00
Duncan Sands
c142bb294b Do not manipulate invalid iterators. This fixes the
llvm-gcc build when expensive checking is turned on.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80671 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 15:13:02 +00:00
Sanjiv Gupta
72f9ab030e Further refactoring of PIC16 Obj file code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80670 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 10:47:31 +00:00
Benjamin Kramer
6818863940 Update CMakeLists.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80669 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 10:24:10 +00:00
Andreas Neustifter
62353a8d13 Preparation for Optimal Edge Profiling:
Add statistics for regular edge profiling, this enables the comparation of the
number of edges inserted by regular and optimal edge profiling.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80668 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 10:08:39 +00:00
Andreas Neustifter
e885af9fb7 Preparation for Optimal Edge Profiling:
Optimal edge profiling is only possible when blocks with no predecessors get an
virtual edge (BB,0) that counts the execution frequencies of this
function-exiting blocks.
This patch makes the necessary changes before actually enabling optimal edge profiling.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80667 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 10:06:05 +00:00
Andreas Neustifter
e7ddcfdebe Preparation for Optimal Edge Profiling:
This adds a pass to verify the current profile against the flow conditions.
This is very helpful when later on trying to perserve the profiling information
during all passes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80666 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 08:48:42 +00:00
Chris Lattner
a541b0fde2 Change CallGraphNode to maintain it's Function as an AssertingVH
for sanity.  This didn't turn up any bugs.

Change CallGraphNode to maintain its "callsite" information in the 
call edges list as a WeakVH instead of as an instruction*.  This fixes
a broad class of dangling pointer bugs, and makes CallGraph have a number
of useful invariants again.  This fixes the class of problem indicated
by PR4029 and PR3601.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80663 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 06:31:31 +00:00
Bob Wilson
243fcc5a69 Generate code for vld{234}_lane intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80656 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 04:26:28 +00:00
Bob Wilson
71124f698b Fix pr4843: When an instruction has multiple destination registers that are
tied to different source registers, the TwoAddressInstructionPass needs to
be smarter.  Change it to check before replacing a source register whether
that source register is tied to a different destination register, and if so,
defer handling it until a subsequent iteration.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80654 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 04:18:40 +00:00
Daniel Dunbar
efbb5330b8 llvm-mc: Store MCSymbolData value as a pointer (to make MSVC happy).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80652 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 04:09:03 +00:00
Jim Grosbach
27830e39c4 Fix compiler warnings
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80650 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 02:05:03 +00:00
Jim Grosbach
3fb2b1ede3 Clean up LSDA name generation and use for SJLJ exception handling. This
makes an eggregious hack somewhat more palatable. Bringing the LSDA forward
and making it a GV available for reference would be even better, but is
beyond the scope of what I'm looking to solve at this point.

Objective C++ code could generate function names that broke the previous
scheme. This fixes that.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80649 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 01:57:56 +00:00
Devang Patel
f98d8fee3c Introduce DILocation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80648 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 01:14:15 +00:00
Devang Patel
82dfc0cd8c Subprogram is a scope. Derive DISubprogram from DIScope.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80637 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 22:47:13 +00:00
Devang Patel
5e005d814f Rename DIBlock as DILexicalBlock.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80633 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 22:00:15 +00:00
Dan Gohman
a5505cb9c9 Don't use an iterator which is potentially invalidated.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80632 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 21:58:28 +00:00
Bob Wilson
4344979ba9 Use early exit and reduce indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80631 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 21:54:55 +00:00
Bob Wilson
d4034b2825 If the tied registers are already the same, there is no need to change
them.  Move the code to make that change inside the conditional.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80630 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 21:54:16 +00:00
Richard Osborne
768f1dd48f Add triple parsing support for XCore.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80629 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 21:51:36 +00:00
Devang Patel
c9f322d9a6 Derive DICompileUnit from DIScope.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80627 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 21:34:44 +00:00
Caroline Tice
dc8f6049d1 Add flag to mark structs for Apple Block "byref" variables; also add code to
modify the type and location debug information for these variables to match the
programmer's expectations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80625 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 21:19:37 +00:00
Dan Gohman
4221489908 Extend the ValuesAtScope cache to cover all expressions, not just
SCEVUnknowns, as the non-SCEVUnknown cases in the getSCEVAtScope code
can also end up repeatedly climing through the same expression trees,
which can be unusably slow when the trees are very tall.

Also, add a quick check for SCEV pointer equality to the main
SCEV comparison routine, as the full comparison code can be expensive
in the case of large expression trees.

These fix compile-time problems in some pathlogical cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80623 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 21:15:23 +00:00
David Goodwin
a3251db21a Don't mark a register live at an undef use.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80621 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 20:47:02 +00:00
Devang Patel
43d98b3c4e Introduce DIScope.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80620 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 20:44:45 +00:00
Devang Patel
5a68509b17 Oops. Fix inverted logic in assertion check.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80618 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 20:27:49 +00:00
Evan Cheng
029599bf01 Remove .n suffix for some 16-bit opcodes now that Darwin assembler is fixed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80615 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 20:14:07 +00:00
Daniel Dunbar
ec2e4679fd X86/exp-asm-printer: Lower MachineOperand::MO_JumpTableIndex to MCOperand.
- Down to 7 failures on 403.gcc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80605 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 19:14:05 +00:00
Daniel Dunbar
d2a0b272fe Stop printing old asm printing code inline with -experimental-asm-printer (this allows diffing and assembling the .s)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80604 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 19:13:56 +00:00
Daniel Dunbar
64926be847 Avoid unnecessary +0 in experimental-asm-printer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80603 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 19:13:47 +00:00
Devang Patel
6ceea33c5e Simplify isDerivedType() and other predicate interface.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80602 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 18:49:10 +00:00
Bill Wendling
049e98d641 Output a hex value, because all of the others are hex.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80601 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 18:26:48 +00:00
Chris Lattner
2038cf3168 cleanups pointed out by duncan
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80595 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 17:08:30 +00:00
Duncan Sands
c69d74a5d4 Revert commit 80428. It completely broke exception
handling on x86-32 linux.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80592 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 16:45:16 +00:00
Torok Edwin
2cd5155c0e Free the constants that have no uses in ~LLVMContext.
This fixes leaks from LLVMContext in multithreaded apps.
Since constants are only deleted if they have no uses, it is safe to not delete
a Module on shutdown, as many single-threaded tools do.
Multithreaded apps should however delete the Module before destroying the
Context to ensure that there are no leaks (assuming they use a different context
for each thread).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80590 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 16:14:59 +00:00
Torok Edwin
72ddf7b555 Fix ExplicitSymbols leak.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80589 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 16:12:29 +00:00
Benjamin Kramer
b4f770b68a Normalize makefile comments and sort cmake file lists.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80584 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 13:05:24 +00:00
Daniel Dunbar
821e3334ed llvm-mc: Pass values to MCStreamer as MCExprs, not MCValues.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80578 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 08:09:28 +00:00
Daniel Dunbar
e2ace509fc llvm-mc: Simplify EmitAssignment ('.set' is identical to '=').
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80577 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 08:09:09 +00:00
Daniel Dunbar
8c2eebe407 llvm-mc: Switch MCInst to storing an MCExpr* instead of an MCValue.
Also, use MCInst::print instead of custom code in MCAsmPrinter.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80575 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 08:08:38 +00:00
Daniel Dunbar
cb579b3338 llvm-mc: Make MCSymbolData symbol member const.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80573 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 08:08:06 +00:00
Daniel Dunbar
a03a368acc llvm-mc: Add MCContext to MCAssembler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80572 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 08:07:55 +00:00
Daniel Dunbar
87392fde1f llvm-mc: Add MCExpr::{dump,print}.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80570 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 08:07:33 +00:00
Daniel Dunbar
9643ac5514 llvm-mc: Switch MCExpr construction to using static member functions, and taking the MCContext (which now owns all MCExprs).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80569 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 08:07:22 +00:00
Daniel Dunbar
28c251b54b llvm-mc: Move AsmExpr into MC lib (as MCExpr).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80567 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 08:06:59 +00:00
Chris Lattner
be577659d3 Step #1 to giving Callgraph some sane invariants. The problems with callgraph
stem from the fact that we have two types of passes that need to update it:

1. callgraphscc and module passes that are explicitly aware of it
2. Functionpasses (and loop passes etc) that are interlaced with CGSCC passes
   by the CGSCC Passmgr.

In the case of #1, we can reasonably expect the passes to update the call
graph just like any analysis.  However, functionpasses are not and generally
should not be CG aware.  This has caused us no end of problems, so this takes
a new approach.  Logically, the CGSCC Pass manager can rescan every function 
after it runs a function pass over it to see if the functionpass made any 
updates to the IR that affect the callgraph.  This allows it to catch new calls
introduced by the functionpass.

In practice, doing this would be slow.  This implementation keeps track of
whether or not the current scc is dirtied by a function pass, and, if so, 
delays updating the callgraph until it is actually needed again.  This was
we avoid extraneous rescans, but we still have good invariants when the
callgraph is needed.

Step #2 of the "give Callgraph some sane invariants" is to change CallGraphNode
to use a CallBackVH for the callsite entry of the CallGraphNode.  This way
we can immediately remove entries from the callgraph when a FunctionPass is
active instead of having dangling pointers.  The current pass tries to tolerate
these dangling pointers, but it is just an evil hack.

This is related to PR3601/4835/4029.  This also reverts r80541, a hack working
around the sad lack of invariants.





git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80566 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 07:23:46 +00:00
Chris Lattner
b0b822c449 fix some cases where instcombine would change hte IR but not return true
from runOnFunction


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80562 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 06:57:37 +00:00
Chris Lattner
f3a1c15b75 cleanups, factor some code out to a helper function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80542 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 06:01:21 +00:00
Chris Lattner
46ca76f6bb fix a crash building SPASS by tolerating a callsite that doesn't exist
in the callgraph, see the big comment at the top of the testcase.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80541 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 05:46:59 +00:00
Chris Lattner
d43d5e832f comment and simplify some code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80540 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 05:34:32 +00:00
Chris Lattner
a3512bd589 add -debug output
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80539 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 05:22:48 +00:00
Chris Lattner
931f8f3d12 improve -debug output, so that -debug is more likely to print when
instcombine is changing stuff.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80538 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 05:17:58 +00:00
Chris Lattner
95afdfee82 fix a bug I introduced with my 'instcombine builder' refactoring
changes: SimplifyDemandedBits can't use the builder yet because it
has the wrong insertion point.  This fixes a crash building
MultiSource/Benchmarks/PAQ8p


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80537 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 04:36:22 +00:00
Chris Lattner
98a27ce03f simplify some code by making the SCCNodes set contain Function*'s
instead of CallGraphNode*'s.  This also papers over a callgraph
problem where a pass (in this case, MemCpyOpt) introduces a new
function into the module (llvm.memset.i64) but doesn't add it to
the call graph (nor should it, since it is a function pass).

While it might be a good idea for MemCpyOpt to not synthesize 
functions in a runOnFunction(), there is no need for FunctionAttrs
to be boneheaded, so fix it there.  This fixes an assertion building
176.gcc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80535 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 04:09:04 +00:00
Chris Lattner
b374b90e81 Fix PR4834, a tricky case where the inliner would resolve an
indirect function pointer, inline it, then go to delete the body.
The problem is that the callgraph had other references to the function,
though the inliner had no way to know it, so we got a dangling pointer
and an invalid iterator out of the deal.

The fix to this is pretty simple: stop the inliner from deleting the
function by knowing that there are references to it.  Do this by making
CallGraphNodes contain a refcount.  This requires moving deletion of 
available_externally functions to the module-level cleanup sweep where
it belongs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80533 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 03:15:49 +00:00
Chris Lattner
2adb8306e2 use an accessor instead of poking internals of a node.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80532 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 02:24:20 +00:00
Jim Grosbach
0bb61c56bc PR4747
Shared landing pads run into trouble with SJLJ, as the dispatch table is
mapped to call sites, and merging the pads will throw that off. There needs
to be a one-to-one mapping of landing pad exception table entries to invoke
call points.

Detecting the shared pad during lowering of SJLJ info insn't sufficient, as
the dispatch function may still need separate destinations to properly
handle phi-nodes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80530 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 01:35:03 +00:00
Chris Lattner
5095e3d1d1 Fix some nasty callgraph dangling pointer problems in
argpromotion and structretpromote.  Basically, when replacing
a function, they used the 'changeFunction' api which changes
the entry in the function map (and steals/reuses the callgraph
node).

This has some interesting effects: first, the problem is that it doesn't
update the "callee" edges in any callees of the function in the call graph.
Second, this covers for a major problem in all the CGSCC pass stuff, which 
is that it is completely broken when functions are deleted if they *don't*
reuse a CGN.  (there is a cute little fixme about this though :).

This patch changes the protocol that CGSCC passes must obey: now the CGSCC 
pass manager copies the SCC and preincrements its iterator to avoid passes
invalidating it.  This allows CGSCC passes to mutate the current SCC.  However
multiple passes may be run on that SCC, so if passes do this, they are now
required to *update* the SCC to be current when they return.

Other less interesting parts of this patch are that it makes passes update
the CG more directly, eliminates changeFunction, and requires clients of
replaceCallSite to specify the new callee CGN if they are changing it.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80527 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 00:19:58 +00:00
Chris Lattner
23603a61c9 add a dump() method on callgraph.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80524 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-30 22:24:32 +00:00
Daniel Dunbar
12420d3a64 Fix some possible-use-of-uninitialized warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80515 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-30 21:13:58 +00:00
Chris Lattner
2de2319124 Fix PR4748: don't fold gep(bitcast(x)) into bitcast(gep) when x
is itself a bitcast.  Since we have gep(bitcast(bitcast(y))) in this
case, just wait for the two bitcasts to get zapped.  This prevents
instcombine from confusing some aliasing stuff, and allows it to
directly eliminate the load in the testcase.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80508 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-30 20:38:21 +00:00
Chris Lattner
963f4ba826 misc cleanup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80507 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-30 20:36:46 +00:00
Chris Lattner
8a67ac525e add getPointerAddressSpace() to GEP instruction, use the method
in a few scalar xforms to simplify things.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80506 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-30 20:06:40 +00:00
Chris Lattner
2345d1d22e eliminate InsertCastBefore, use the builder instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80505 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-30 20:01:10 +00:00
Chris Lattner
08142f2560 eliminate InsertBitCastBefore, just use the builder instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80504 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-30 19:47:22 +00:00
Anton Korobeynikov
d91aafd005 Add missed pattern
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80502 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-30 19:06:39 +00:00
Chris Lattner
f925cbd7e4 convert a bunch more calls to InsertNewInstBefore to use
the new Instcombine builder.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80501 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-30 18:50:58 +00:00
Chris Lattner
75551f748d fix typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80500 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-30 17:53:59 +00:00
Anton Korobeynikov
b00c03bb35 EXTRACT_VECTOR_ELEMENT can have result type different from element type.
Remove the assertion and generalize the code for ARM NEON stuff.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80498 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-30 17:14:54 +00:00
Torok Edwin
ce0c81e7dd Add regular expression matching support, based on OpenBSD regexec()/regcomp()
implementation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80493 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-30 08:24:09 +00:00
Chris Lattner
7438106207 give instcombine a custom IRBuilder that adds new instructions to the
workslist and is set to insert new instructions before the current one.
Convert a bunch of stuff that used to call InsertNewInstBefore over to
use it, greatly simplifying code and making it more natural.

There is still a lot more to go, but this is a good start.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80492 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-30 07:44:24 +00:00
Chris Lattner
3c4e38e411 add a new InstCombineWorklist::AddValue method that works even
if the operand is not an instruction.

Simplify most uses of AddOperandsToWorkList to use AddValue and
inline it into the one remaining callsite.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80488 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-30 06:27:41 +00:00
Chris Lattner
e5ecdb5a98 move AddUsersToWorkList to the worklist processing class, make the
argument stronger typed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80487 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-30 06:22:51 +00:00
Chris Lattner
c3a3e3682b rename AddUsesToWorkList -> AddOperandsToWorkList. The
former looks too much like AddUsersToWorkList and keeps
confusing me.

Remove AddSoonDeadInstToWorklist and change its two callers
to do the same thing in a simpler way.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80486 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-30 06:20:05 +00:00
Daniel Dunbar
df65eafe5e llvm-mc/X86: Encode constant MCValue's correctly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80485 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-30 06:17:49 +00:00
Daniel Dunbar
7092c7e1dc llvm-mc: MCStreamer cleanups. - Remove EmitLocalSymbol, this is unsupported for now.
- Switch Emit{CommonSymbol,Zerofill} to take alignment in bytes (for consistency).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80484 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-30 06:17:16 +00:00
Chris Lattner
7a1e924b9a inline the trivial AddToWorkList/RemoveFromWorkList methods
into their callers.  simplify ReplaceInstUsesWith.  Make
EraseInstFromFunction only add operands to the worklist if
there aren't too many of them (this was a scalability win
for crazy programs that was only infrequently enforced).
Switch more code to using EraseInstFromFunction instead of
duplicating it inline.  Change some fcmp/icmp optimizations
to modify fcmp/icmp in place instead of creating a new one
and deleting the old one just to change the predicate.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80483 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-30 06:13:40 +00:00
Chris Lattner
878daed2aa fix a bug I introduced in r80478 found by the build bot.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80482 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-30 05:56:44 +00:00