Commit Graph

37162 Commits

Author SHA1 Message Date
Jeffrey Yasskin
6b4c12db13 Free SavedLI even if SimpleRegisterCoalescing::JoinCopy() returns early.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99113 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-21 01:47:49 +00:00
Daniel Dunbar
f2de13f8d7 MC/X86: Fix an MCOperand link, when we parsing shrld $1,%eax and friends; I believe this fixes the last memory leaks under test/MC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99102 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-20 22:36:38 +00:00
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
Bob Wilson
c88d072293 pr6652: Use LDM to restore PC to the return address on ARMv4.
Patch by John Tytgat!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99096 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-20 22:20:40 +00:00
Bob Wilson
226036ee73 Re-commit r98683 ("remove redundant writeback flag from ARM address mode 6")
with changes to add a separate optional register update argument.  Change all
the NEON instructions with address register writeback to use it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99095 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-20 22:13:40 +00:00
Bob Wilson
d5fadaf56e Add instruction variants for VST2, VST3, and VST4 "store-lane" operations with
address register writeback.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99094 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-20 21:57:36 +00:00
Bob Wilson
4f4f93f9d6 Add variants of VST2, VST3 and VST4 with address register writeback, and
rewrite the existing VST3 and VST4 instructions to use the same classes as
the others.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99093 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-20 21:45:18 +00:00
Bob Wilson
068b18be0d Add instructions for double-spaced VST3 and VST4 without address register
writeback, and refactor the existing double-spaced VST2 instructions.
These are only for the disassembler since codegen doesn't use them, at
least for now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99090 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-20 21:15:48 +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
Bob Wilson
25eb5013d0 Add VST1 instructions with address register writeback.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99083 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-20 20:54:36 +00:00
Bob Wilson
a1023645f8 Add instruction variants for VLD2, VLD3, and VLD4 "load-lane" operations with
address register writeback.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99082 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-20 20:47:18 +00:00
Bob Wilson
41315282f9 Tidy some more comments and whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99081 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-20 20:39:53 +00:00
Bob Wilson
92cb9321a1 Add variants of VLD2, VLD3 and VLD4 with address register writeback, and
rewrite the existing VLD3 and VLD4 instructions to use the same classes as
the others.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99080 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-20 20:10:51 +00:00
Bob Wilson
667a13e1be Tidy some comments and whitespace for consistency.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99078 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-20 19:57:03 +00:00
Bob Wilson
95ffecd4fe Rename some instructions for consistency and sanity: use "_UPD" suffix for
load/stores with address register writeback, and use "odd" suffix to distinguish
instructions to access odd numbered registers (instead of "a" and "b").
No functional changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99066 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-20 18:35:24 +00:00
Bob Wilson
00bf1d93d7 Add instructions for double-spaced VLD3 and VLD4 without address register
writeback, and refactor the existing double-spaced VLD2 instructions.
These are only for the disassembler since codegen doesn't use them, at
least for now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99065 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-20 18:14:26 +00:00
Bob Wilson
99493b2b53 Add VLD1 instructions with address register writeback.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99062 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-20 17:59:03 +00:00
Benjamin Kramer
dd70cea00c PIC16: Simplify code by using a std::set<std::string> instead of a sorted & uniqued std::list of leaked char*.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99061 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-20 17:41:18 +00:00
Bob Wilson
55c9cb5a22 Revert the rest of 98679.
--- Reverse-merging r98679 into 'lib/Target/ARM/ARMInstrVFP.td':
U    lib/Target/ARM/ARMInstrVFP.td


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99049 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-20 06:34:02 +00:00
Bob Wilson
98330ff8e3 Fix a very bad typo. Since the register number was off by one, the ARM
load/store optimizer would incorrectly think that registers D26 and D28
were consecutive and would generate a VLDM instruction to load them.
The assembler was not convinced.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99043 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-20 06:05:13 +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
Evan Cheng
f5b9d6cc82 If call result is in ST0 and it is not being passed to the caller's
caller, then it is not safe to optimize the call into a sibcall since
the call result has to be popped off the x87 stack.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99032 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-20 02:58:15 +00:00
Daniel Dunbar
873decbb37 Better fix for r98994, MachObjectWriterImpl wasn't intended to be virtual.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99031 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-20 01:58:40 +00:00
Johnny Chen
caa608e97c Add NLdStFrm Format.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99014 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-20 00:17:00 +00:00
Johnny Chen
e86425f224 Revert r98679. The disassembler will be updated to depend on the existence of
IndexModeUpd and then populates the Inst{21}=1 while populating the instructions
for disassembly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99013 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 23:50:27 +00:00
Bob Wilson
76a312b7d1 Revert this change, since it was causing ARM performance regressions.
--- Reverse-merging r98889 into '.':
U    lib/Target/ARM/ARMInstrNEON.td
U    lib/Target/ARM/ARMISelLowering.h
U    lib/Target/ARM/ARMInstrInfo.td
U    lib/Target/ARM/ARMInstrVFP.td
U    lib/Target/ARM/ARMISelLowering.cpp
U    lib/Target/ARM/ARMInstrFormats.td


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99010 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 22:51:32 +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
Chris Lattner
99521af212 remove the patterns that I commented out in r98930, Dan verified
that they are dead.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99000 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 21:43:36 +00:00
Rafael Espindola
a407fa830a Fix -Wnon-virtual-dtor warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98994 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 21:26:46 +00:00
Devang Patel
608f5a6d48 call void @llvm.dbg.declare(metadata !{i32* null}, metadata !1)
is valid, but not useful, when variable  identified by !1 is optimized away by the optimizer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98986 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 21:06:24 +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
Daniel Dunbar
602b40f0d0 MC/Mach-O/x86_64: Add relocation support.
- This is "extraordinarily" Darwin 'as' compatible. See the litany of FIXMEs littered about for more information.
 - There are a few cases which seem to clearly be 'as' bugs which I have left unsupported, and there is one cases where we diverge but should fix if it blocks diffing .o files (Darwin 'as' ends up widening a jump unnecessarily).
 - 403.gcc build, runs, and diffs equivalently to the 'as' built version now (using llvm-mc). However, it builds so slowly that I wouldn't recommend trying it quite yet. :)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98974 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 18:07:55 +00:00
Daniel Dunbar
0180daee02 MC/X86: Rename alternate spellings of {ADD64,CMP64} and mark as "code gen only" so they don't get selected by the asm matcher.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98972 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 18:07:48 +00:00
Johnny Chen
81f04d59f6 Renumber LdStExFrm from 28 to 11 and shift the existing format values to make
room for it.  This is in preparation for another patch which is adding NEON
subformats to facilitate disassembly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98967 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 17:39:00 +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
bdd9281f35 MCAssembler: Pull out MCObjectWriter class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98948 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 09:28:55 +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
Daniel Dunbar
17a0650641 MC/Mach-O: Lift relocation emission logic a bit higher to separate evaluation / relocation handling from the actual .o writing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98942 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 07:09:18 +00:00
Jeffrey Yasskin
509bcb134d Remove a memory leak from the CBackend.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98941 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 07:06:46 +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