Commit Graph

11519 Commits

Author SHA1 Message Date
Daniel Dunbar
5d067fe158 TargetRegistry: Fix create{AsmInfo,MCDisassembler} to return non-const objects.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99097 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-20 22:36:22 +00:00
Gabor Greif
654c06f645 Add a setCalledFunction member to InvokeInst (like in CallInst)
and use this (as well as getCalledValue) to access the callee,
instead of {g|s}etOperand(0).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99084 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-20 21:00:25 +00:00
Dan Gohman
472fdf7090 Clear the SCEVExpander's insertion point after making deletions,
so that the SCEVExpander doesn't retain a dangling pointer as its
insert position. The dangling pointer in this case wasn't ever used
to insert new instructions, but it was causing trouble with
SCEVExpander's code for automatically advancing its insert position
past debug intrinsics.

This fixes use-after-free errors that valgrind noticed in
test/Transforms/IndVarSimplify/2007-06-06-DeleteDanglesPtr.ll and
test/Transforms/IndVarSimplify/exit_value_tests.ll.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99036 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-20 03:53:53 +00:00
Dan Gohman
6c7ed6b549 Fix more places to more thoroughly ignore debug intrinsics. This fixes
use-before-def errors in SCEVExpander-produced code in sqlite3 when debug
info with optimization is enabled, though the testcases for this are
dependent on use-list order.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99001 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 21:51:03 +00:00
Kevin Enderby
b46b03b36f Fixed the encoding problems of the crc32 instructions. All had the Operand size
override prefix and only the r/m16 forms should have had that.  Also for variant
one, the AT&T syntax, added suffixes to all forms.  Also added the missing
64-bit form for 'CRC32 r64, r/m8'.  Plus added test cases for all forms and
tweaked one test case to add the needed suffixes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98980 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 20:04:42 +00:00
Bob Wilson
80d23705e6 Stop trying to merge identical jump tables. This had been inadvertently
disabled for several months (since svn r88806) and no one noticed.  My fix
for pr6543 yesterday reenabled it, but broke the ARM port's code for using
TBB/TBH.  Rather than adding a target hook to disable merging for Thumb2 only,
I'm just taking this out.  It is not common to have identical jump tables,
the code we used to merge them was O(N^2), and it only helps code size, not
performance.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98977 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 19:05:41 +00:00
Douglas Gregor
d4d4a90a8c Acccess control is lame
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98962 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 15:36:58 +00:00
Douglas Gregor
1a07bc5cf4 struct -> class, to silence a Clang warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98961 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 15:31:09 +00:00
Gabor Greif
cc52ed0c4f back out r98957, it broke http://smooshlab.apple.com:8010/builders/clang-x86_64-darwin10-fnt/builds/703 in the nightly test suite
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98958 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 13:50:02 +00:00
Gabor Greif
f4f10e3779 Recommit r80858 again (which has been backed out in r80871).
This time I did a self-hosted bootstrap on Linux x86-64,
with no problems. Let's see how darwin 64-bit self-hosting
goes. At the first sign of failure I'll back this out.

Maybe the valgrind bots give me a hint of what may be wrong
(it at all).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98957 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 11:55:53 +00:00
Daniel Dunbar
1a9158c301 MC: Add TargetAsmBackend::createObjectWriter.
- MCAssembler is now object-file independent, although we will surely need more work to fully support ELF/COFF.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98955 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 10:43:26 +00:00
Daniel Dunbar
b36052f0e4 MCCodeEmitter: Add target independent fixup flag for is-pc-relative.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98954 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 10:43:23 +00:00
Daniel Dunbar
cf871e5abf MC: Sink code emitter into MCAssembler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98953 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 10:43:18 +00:00
Daniel Dunbar
2df4ceba15 MC/Mach-O: Move to MachObjectWriter.{h,cpp}.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98952 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 10:43:15 +00:00
Daniel Dunbar
cc5b84c6fb MC: Add TargetAsmBackend::isVirtualSection hook.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98950 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 09:29:03 +00:00
Daniel Dunbar
53b2338a1d MC: Split MCObjectWriter out of MCAssembler.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98949 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 09:28:59 +00:00
Daniel Dunbar
87190c473c MCAssembler: Move ApplyFixup to the TargetAsmBackend, this is a target specific not object writer specific task.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98947 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 09:28:12 +00:00
Daniel Dunbar
b1e98945e4 MC/Mach-O: Lift the fixup evaluation and application up (to the same place), and eliminate MCAsmFixup::FixedValue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98944 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 07:09:47 +00:00
Daniel Dunbar
bacba99778 MC/Mach-O: Factor out ExecutePostLayoutBinding, to separate the post-layout changes the object writer may need to make to the assembler from the actual .o writing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98943 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 07:09:33 +00:00
Chris Lattner
4c42a6de9f fix an MCInstPrinter leak that jyasskin pointed out:
createAsmStreamer now takes ownership of the instprinter.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98939 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 05:48:53 +00:00
Chris Lattner
e8cabf3c2e add a new SDNPVariadic SDNP node flag, and use it in
dag isel gen instead of instruction properties.  This
allows the oh-so-useful behavior of matching a variadic
non-root node.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98934 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 05:07:09 +00:00
Daniel Dunbar
8ad0dccbf2 MC/Mach-O/x86_64: Add getAtom[ForAddress].
- These find the defining symbol which identifies the containing atom for a symbol or address. They are currently very slow, but will be eliminated eventually.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98925 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 03:18:15 +00:00
Daniel Dunbar
2386985663 MC/Mach-O: Factor out isSymbolLinkerVisible method; "linker visible" is a made up term to refer to non-temporary labels + temporary labels in sections-which-require symbols. For Darwin, it corresponds to symbols which effectively define an atom.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98923 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 03:18:09 +00:00
Chris Lattner
09a2769a7f use ins/outs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98867 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-18 20:55:31 +00:00
Daniel Dunbar
8cc9c0c487 MC/AsmMatcher: Add support for target specific "instruction cleanup" functions,
to allow custom post-processing of matched instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98857 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-18 20:05:56 +00:00
Dan Gohman
debbef20ee offsetof always has type size_t.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98854 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-18 19:37:35 +00:00
Benjamin Kramer
d720712f67 Fix a name clash that was breaking MSVC builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98852 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-18 19:34:06 +00:00
Dan Gohman
aea1b501ce Explicitly cast std::min's arguments to avoid type mismatches.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98851 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-18 19:01:12 +00:00
Dan Gohman
9553188fcc Define placement new wrappers for BumpPtrAllocator and
RecyclingAllocator to allow client code to be simpler, and
simplify several clients.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98847 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-18 18:49:47 +00:00
Bob Wilson
d1ec31dca5 Fix pr6543: svn r88806 changed MachineJumpTableInfo::getJumpTableIndex() to
always create a new jump table.  The intention was to avoid merging jump
tables in SelectionDAGBuilder, and to wait for the branch folding pass to
merge tables.  Unfortunately, the same getJumpTableIndex() method is also
used to merge tables in branch folding, so as a result of this change
branch tables are never merged.  Worse, the branch folding code is expecting
getJumpTableIndex to always return the index of an existing table, but with
this change, it never does so.  In at least some cases, e.g., pr6543, this
creates references to non-existent tables.

I've fixed the problem by adding a new createJumpTableIndex function, which
will always create a new table, and I've changed getJumpTableIndex to only
look at existing tables.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98845 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-18 18:42:41 +00:00
Dan Gohman
74cdc75313 Fix a bug found by inspection; in the __GNUC__ code, the alignment
doesn't apply to the type, only to the variable, so subsequent uses
of U which expect it to be aligned weren't actually aligned.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98843 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-18 18:40:47 +00:00
Andrew Lenharth
8bba4dd9bc Nick wants these alphabetized
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98840 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-18 18:18:00 +00:00
Dan Gohman
c93b4cff89 Add the ability to "intern" FoldingSetNodeID data into a
BumpPtrAllocator-allocated region to allow it to be stored in a more
compact form and to avoid the need for a non-trivial destructor call.

Use this new mechanism in ScalarEvolution instead of
FastFoldingSetNode to avoid leaking memory in the case where a
FoldingSetNodeID uses heap storage, and to reduce overall memory
usage.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98829 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-18 16:16:38 +00:00
Dan Gohman
f9e64729af Reapply r98755 with a thinko which miscompiled gengtype fixed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98793 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-18 01:17:13 +00:00
Daniel Dunbar
9a1d20042f MCValue: Change to holding MCSymbolRefExprs instead of MCSymbols, we will need this for accessing to symbol modifiers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98791 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-18 00:59:10 +00:00
Daniel Dunbar
daf9733369 Add MCSymbol::isInSection.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98790 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-18 00:59:02 +00:00
Daniel Dunbar
0682951b4f MC/Darwin: Add a new target hook for whether the target uses "reliable" symbol differences, basically whether the assembler should attempt to understand atoms when using scattered symbols.
Also, avoid some virtual call overhead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98789 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-18 00:58:53 +00:00
Dan Gohman
ebf78f18df Revert 98755, which may be causing trouble.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98762 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-17 19:54:53 +00:00
Dan Gohman
0afc29c3e6 Change SCEVNAryExpr's operand array from a SmallVector to a plain
pointer and length, and allocate the arrays in ScalarEvolution's
BumpPtrAllocator, so that they get released when their owning
SCEV gets released. SCEVs are immutable, so they don't need to worry
about operand array resizing. This fixes a memory leak reported
in PR6637.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98755 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-17 18:51:01 +00:00
Bob Wilson
f9cf8b35bb Remove an unnecessary (and misspelled) typedef. Tweak whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98753 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-17 18:43:25 +00:00
Andrew Lenharth
7e1b037edd missing include
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98752 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-17 18:33:00 +00:00
Chris Lattner
77e7694026 fix GetOrCreateTemporarySymbol to require a name, clients
should use CreateTempSymbol() if they don't care about the
name.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98712 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-17 05:41:18 +00:00
Chris Lattner
b095ba439d remove dead variable, patch by Nathan Howell!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98704 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-17 01:45:17 +00:00
Chris Lattner
730f743c01 work around an MSVC2010 bug, PR6504
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98653 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-16 19:07:05 +00:00
Gabor Greif
138acfe353 fix PR6589
adjusted unittest

I have added some doxygen to OptionalOperandTraits,
so hopefully there will be no confusion in the future.

Incidentally OptionalOperandTraits is not used any more (IIUC),
but the obvious client would be BranchInstr, and I plan
to rearrange it that way.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98624 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-16 10:59:48 +00:00
Chris Lattner
999aee24c7 Fix the third (and last known) case of code update problems due
to LLVM IR changes with addr label weirdness.  In the testcase, we
generate references to the two bb's when codegen'ing the first
function:

_test1:                                 ## @test1
	leaq	Ltmp0(%rip), %rax
..
	leaq	Ltmp1(%rip), %rax

Then continue to codegen the second function where the blocks
get merged.  We're now smart enough to emit both labels, producing
this code:

_test_fun:                              ## @test_fun
## BB#0:                                ## %entry
Ltmp1:                                  ## Block address taken
Ltmp0:
## BB#1:                                ## %ret
	movl	$-1, %eax
	ret

Rejoice.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98595 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-16 00:29:39 +00:00
Daniel Dunbar
4e815f8a8c MC: Allow modifiers in MCSymbolRefExpr, and eliminate X86MCTargetExpr.
- Although it would be nice to allow this decoupling, the assembler needs to be able to reason about MCSymbolRefExprs in too many places to make this viable. We can use a target specific encoding of the variant if this becomes an issue.
 - This patch also extends llvm-mc to support parsing of the modifiers, as opposed to lumping them in with the symbol.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98592 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-15 23:51:06 +00:00
Daniel Dunbar
d6e59084d0 MC/Mach-O/x86_64: Temporary labels in cstring sections require symbols (and external relocations, but we don't have x86_64 relocations yet).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98583 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-15 21:56:50 +00:00
Daniel Dunbar
99d22adcad MC/Mach-O: Add MCSectionMachO::getType()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98582 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-15 21:56:38 +00:00
Chris Lattner
9cc0da9c29 Implement support for the case when a reference to a addr-of-bb
label is generated, but then the block is deleted.  Since the
value is undefined, we just emit the label right after the entry 
label of the function.  It might matter that the label is in the
same section as the function was afterall.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98579 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-15 20:39:00 +00:00