oota-llvm.git
14 years agoAdded the enhanced disassembly library's implementation and
Sean Callanan [Mon, 1 Feb 2010 08:49:35 +0000 (08:49 +0000)]
Added the enhanced disassembly library's implementation and
fleshed out the .exports file.  I still have to fix several
details of operand parsing, but the basic functionality is
there and usable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94974 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSimplify code. We can compare TNew with T in one batch.
Zhongxing Xu [Mon, 1 Feb 2010 07:32:52 +0000 (07:32 +0000)]
Simplify code. We can compare TNew with T in one batch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94973 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoUndo r94946 now all the tests are passing again.
Evan Cheng [Mon, 1 Feb 2010 02:13:39 +0000 (02:13 +0000)]
Undo r94946 now all the tests are passing again.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94970 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix stack size bug while using o32 abi
Bruno Cardoso Lopes [Mon, 1 Feb 2010 02:03:24 +0000 (02:03 +0000)]
Fix stack size bug while using o32 abi

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94969 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFor MVNr and MVNs, we need to set Inst{25} = 0 so as not to confuse the decoder.
Johnny Chen [Sun, 31 Jan 2010 11:22:28 +0000 (11:22 +0000)]
For MVNr and MVNs, we need to set Inst{25} = 0 so as not to confuse the decoder.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94955 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoChange TAILJMP's to be varargs and transfer implicit uses over from TCRETURN's. Other...
Evan Cheng [Sun, 31 Jan 2010 07:28:44 +0000 (07:28 +0000)]
Change TAILJMP's to be varargs and transfer implicit uses over from TCRETURN's. Otherwise the missing uses can make post-regalloc scheduling do bad things. This fixes 403.gcc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94950 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix a missing check from my last commit.
Evan Cheng [Sun, 31 Jan 2010 07:27:31 +0000 (07:27 +0000)]
Fix a missing check from my last commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94949 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAvoid recursive sibcall's.
Evan Cheng [Sun, 31 Jan 2010 06:44:49 +0000 (06:44 +0000)]
Avoid recursive sibcall's.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94946 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRemove a completed item, add a couple new ones.
Eli Friedman [Sun, 31 Jan 2010 04:55:32 +0000 (04:55 +0000)]
Remove a completed item, add a couple new ones.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94945 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRemove test which is no longer relevant.
Eli Friedman [Sun, 31 Jan 2010 04:40:45 +0000 (04:40 +0000)]
Remove test which is no longer relevant.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94944 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSimplify/generalize the xor+add->sign-extend instcombine.
Eli Friedman [Sun, 31 Jan 2010 04:29:12 +0000 (04:29 +0000)]
Simplify/generalize the xor+add->sign-extend instcombine.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94943 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd a small transform: transform -(X<<Y) to (-X<<Y) when the shift has a single
Eli Friedman [Sun, 31 Jan 2010 02:30:23 +0000 (02:30 +0000)]
Add a small transform: transform -(X<<Y) to (-X<<Y) when the shift has a single
use and X is free to negate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94941 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMoved InstallLexer() from the X86-specific AsmLexer
Sean Callanan [Sun, 31 Jan 2010 02:28:18 +0000 (02:28 +0000)]
Moved InstallLexer() from the X86-specific AsmLexer
to the TargetAsmLexer class so that clients can
actually use the TargetAsmLexer they get from a
Target.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94940 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDo not mark no-return calls tail calls. It'll screw up special calls like longjmp...
Evan Cheng [Sun, 31 Jan 2010 00:59:31 +0000 (00:59 +0000)]
Do not mark no-return calls tail calls. It'll screw up special calls like longjmp and it doesn't make much sense for performance reason. If my logic is faulty, please let me know.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94937 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix PR6144. Reload GP before the emission of CALLSEQ_END to guarantee the right reloa...
Bruno Cardoso Lopes [Sat, 30 Jan 2010 18:32:07 +0000 (18:32 +0000)]
Fix PR6144. Reload GP before the emission of CALLSEQ_END to guarantee the right reload order

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94915 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix mov.d out register by using the FFR register class directly
Bruno Cardoso Lopes [Sat, 30 Jan 2010 18:29:19 +0000 (18:29 +0000)]
Fix mov.d out register by using the FFR register class directly

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94914 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix a gross typo: ARMv6+ may or may not support unaligned memory operations.
Anton Korobeynikov [Sat, 30 Jan 2010 14:08:12 +0000 (14:08 +0000)]
Fix a gross typo: ARMv6+ may or may not support unaligned memory operations.
Even if they are suported by the core, they can be disabled
(this is just a configuration bit inside some register).

Allow unaligned memops on darwin and conservatively disallow them otherwise.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94889 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoCheck alignment of loads when deciding whether it is safe to execute them
Bob Wilson [Sat, 30 Jan 2010 04:42:39 +0000 (04:42 +0000)]
Check alignment of loads when deciding whether it is safe to execute them
unconditionally.  Besides checking the offset, also check that the underlying
object is aligned as much as the load itself.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94875 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAllow more tailcall optimization: calls with inputs that are all passed in registers.
Evan Cheng [Sat, 30 Jan 2010 01:22:00 +0000 (01:22 +0000)]
Allow more tailcall optimization: calls with inputs that are all passed in registers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94873 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDon't forget to transfer target flag when inserting a tailcall instruction.
Evan Cheng [Sat, 30 Jan 2010 01:16:15 +0000 (01:16 +0000)]
Don't forget to transfer target flag when inserting a tailcall instruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94872 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoEmit declaration DIE for the class static variables.
Devang Patel [Sat, 30 Jan 2010 01:08:30 +0000 (01:08 +0000)]
Emit declaration DIE for the class static variables.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94870 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMC/X86 AsmParser: Handle absolute memory operands correctly. We were doing
Daniel Dunbar [Sat, 30 Jan 2010 01:02:48 +0000 (01:02 +0000)]
MC/X86 AsmParser: Handle absolute memory operands correctly. We were doing
something totally broken and parsing them as immediates, but the .td file also
had the wrong match class so things sortof worked. Except, that is, that we
would parse
  movl $0, %eax
as
  movl 0, %eax
Feel free to guess how well that worked.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94869 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAsmMatcher: Create operand classes before use, apparently records aren't visited
Daniel Dunbar [Sat, 30 Jan 2010 01:02:37 +0000 (01:02 +0000)]
AsmMatcher: Create operand classes before use, apparently records aren't visited
in the order they were declared.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94868 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix a case where debug_value could affect codegen.
Dale Johannesen [Sat, 30 Jan 2010 00:57:47 +0000 (00:57 +0000)]
Fix a case where debug_value could affect codegen.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94866 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoUse more specific types to avoid casts. No functionality change.
Bob Wilson [Sat, 30 Jan 2010 00:41:10 +0000 (00:41 +0000)]
Use more specific types to avoid casts.  No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94863 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRemove ARM-specific calling convention from this test. Target data is
Bob Wilson [Sat, 30 Jan 2010 00:40:23 +0000 (00:40 +0000)]
Remove ARM-specific calling convention from this test.  Target data is
needed for this test, but otherwise, there's nothing ARM-specific about
it and no need to specify the calling convention.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94862 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoX86.td: Refactor to bring operands that use print_pcrel_imm together.
Daniel Dunbar [Sat, 30 Jan 2010 00:24:12 +0000 (00:24 +0000)]
X86.td: Refactor to bring operands that use print_pcrel_imm together.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94861 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFileCheck: When looking for "possible matches", only compare against the prefix
Daniel Dunbar [Sat, 30 Jan 2010 00:24:06 +0000 (00:24 +0000)]
FileCheck: When looking for "possible matches", only compare against the prefix
line. Turns out edit_distance can be slow if the string we are scanning for
happens to be quite large.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94860 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAsmMatcher/X86: Separate out sublass for memory operands that have no segment
Daniel Dunbar [Sat, 30 Jan 2010 00:24:00 +0000 (00:24 +0000)]
AsmMatcher/X86: Separate out sublass for memory operands that have no segment
register, and use to cleanup a FIXME in X86AsmParser.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94859 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoKeep iterating over all uses when meeting a phi node in AllUsesOfValueWillTrapIfNull().
Jakob Stoklund Olesen [Fri, 29 Jan 2010 23:54:14 +0000 (23:54 +0000)]
Keep iterating over all uses when meeting a phi node in AllUsesOfValueWillTrapIfNull().

This bug was exposed by my inliner cost changes in r94615, and caused failures
of lencod on most architectures when building with LTO.

This patch fixes lencod and 464.h264ref on x86-64 (and likely others).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94858 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMC/X86: Add a nice X86 assembler matcher test case from Kevin Enderby.
Daniel Dunbar [Fri, 29 Jan 2010 23:32:40 +0000 (23:32 +0000)]
MC/X86: Add a nice X86 assembler matcher test case from Kevin Enderby.
 - This test case is auto generated, and has been verified to round-trip
   correctly through llvm-mc by checking the assembled .o file before and after
   piping through llvm-mc. It will be extended over time as the matcher grows
   support for more instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94857 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoModified encoding bits specification for VFP instructions. In particular, the D
Johnny Chen [Fri, 29 Jan 2010 23:21:10 +0000 (23:21 +0000)]
Modified encoding bits specification for VFP instructions.  In particular, the D
bit (Inst{22}) and the M bit (Inst{5}) should be left unspecified.  For binary
format instructions, Inst{6} and Inst{4} need to specified for proper decodings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94855 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoPrint a comment next to "materializable" global values, to distinguish
Dan Gohman [Fri, 29 Jan 2010 23:12:36 +0000 (23:12 +0000)]
Print a comment next to "materializable" global values, to distinguish
them from values that are not actually defined in the module.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94854 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoPPC is not ready for sibcall optimization.
Evan Cheng [Fri, 29 Jan 2010 23:05:56 +0000 (23:05 +0000)]
PPC is not ready for sibcall optimization.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94853 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoPreserve load alignment in instcombine transformations. I've been unable to
Bob Wilson [Fri, 29 Jan 2010 22:39:21 +0000 (22:39 +0000)]
Preserve load alignment in instcombine transformations.  I've been unable to
create a testcase where this matters.  The select+load transformation only
occurs when isSafeToLoadUnconditionally is true, and in those situations,
instcombine also changes the underlying objects to be aligned.  This seems
like a good idea regardless, and I've verified that it doesn't pessimize
the subsequent realignment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94850 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMinor code cleanup.
Dan Gohman [Fri, 29 Jan 2010 21:57:46 +0000 (21:57 +0000)]
Minor code cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94848 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSkip whitespace when looking for a potential intended match.
Dan Gohman [Fri, 29 Jan 2010 21:55:16 +0000 (21:55 +0000)]
Skip whitespace when looking for a potential intended match.
Before:

<stdin>:94:1: note: possible intended match here
 movsd 4096(%rsi), %xmm0
^

After:
<stdin>:94:2: note: possible intended match here
 movsd 4096(%rsi), %xmm0
 ^

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94847 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix the position of the caret in the FileCheck error message.
Dan Gohman [Fri, 29 Jan 2010 21:53:18 +0000 (21:53 +0000)]
Fix the position of the caret in the FileCheck error message.
Before:

test/CodeGen/X86/lsr-reuse.ll:52:34: error: expected string not found in input
; CHECK: movsd -2048(%rsi), %xmm0
                                 ^

After:

test/CodeGen/X86/lsr-reuse.ll:52:10: error: expected string not found in input
; CHECK: movsd -2048(%rsi), %xmm0
         ^

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94846 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMake sure the size is doubled (not 4x).
Junjie Gu [Fri, 29 Jan 2010 21:34:26 +0000 (21:34 +0000)]
Make sure the size is doubled (not 4x).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94845 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRemoved symbols from .exports that are not yet in
Sean Callanan [Fri, 29 Jan 2010 21:21:44 +0000 (21:21 +0000)]
Removed symbols from .exports that are not yet in
the library.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94844 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd assertion to humor the paranoid.
Dale Johannesen [Fri, 29 Jan 2010 21:21:28 +0000 (21:21 +0000)]
Add assertion to humor the paranoid.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94843 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoWe were not writing bitcode for function-local metadata whose operands have been...
Victor Hernandez [Fri, 29 Jan 2010 21:19:19 +0000 (21:19 +0000)]
We were not writing bitcode for function-local metadata whose operands have been erased (making it not have any more function-local operands)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94842 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRevert my last couple of patches. They appear to have broken bison.
Eric Christopher [Fri, 29 Jan 2010 21:16:24 +0000 (21:16 +0000)]
Revert my last couple of patches. They appear to have broken bison.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94841 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRename two IRReader.h functions to indicate that they return a Module
Jeffrey Yasskin [Fri, 29 Jan 2010 21:11:04 +0000 (21:11 +0000)]
Rename two IRReader.h functions to indicate that they return a Module
that loads its contents lazily from bitcode.  I think these are the
only remaining mis-named functions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94840 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoUse uint64_t instead of unsigned for offsets and sizes.
Bob Wilson [Fri, 29 Jan 2010 20:34:28 +0000 (20:34 +0000)]
Use uint64_t instead of unsigned for offsets and sizes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94835 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd svn:ignore properties.
Dan Gohman [Fri, 29 Jan 2010 19:43:48 +0000 (19:43 +0000)]
Add svn:ignore properties.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94833 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoImprove isSafeToLoadUnconditionally to recognize that GEPs with constant
Bob Wilson [Fri, 29 Jan 2010 19:19:08 +0000 (19:19 +0000)]
Improve isSafeToLoadUnconditionally to recognize that GEPs with constant
indices are safe if the result is known to be within the bounds of the
underlying object.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94829 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoBelatedly document r85295 and r85330.
Jeffrey Yasskin [Fri, 29 Jan 2010 19:10:38 +0000 (19:10 +0000)]
Belatedly document r85295 and r85330.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94825 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd size and location info in DW_TAG_class_type descriptor.
Devang Patel [Fri, 29 Jan 2010 18:34:58 +0000 (18:34 +0000)]
Add size and location info in DW_TAG_class_type descriptor.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94822 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoBefore inserting llvm.dbg.declare intrinsic at the end of a basic block, check...
Devang Patel [Fri, 29 Jan 2010 18:30:57 +0000 (18:30 +0000)]
Before inserting   llvm.dbg.declare intrinsic at the end of a basic block, check whether the basic block has a terminator or not.
This API is used by clang and the test case is test/CodeGen/debug-info-crash.c in clang module.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94820 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix MSVC build.
Benjamin Kramer [Fri, 29 Jan 2010 15:19:06 +0000 (15:19 +0000)]
Fix MSVC build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94809 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoConvert some users of ftostr to raw_ostream.
Benjamin Kramer [Fri, 29 Jan 2010 14:42:22 +0000 (14:42 +0000)]
Convert some users of ftostr to raw_ostream.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94808 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoUse llvm::format instead of ftostr (which just calls sprintf).
Benjamin Kramer [Fri, 29 Jan 2010 14:40:33 +0000 (14:40 +0000)]
Use llvm::format instead of ftostr (which just calls sprintf).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94807 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoChange the SREM case to match the logic in the IR version ComputeMaskedBits.
Duncan Sands [Fri, 29 Jan 2010 09:45:26 +0000 (09:45 +0000)]
Change the SREM case to match the logic in the IR version ComputeMaskedBits.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94805 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoCatch more trivial tail call opportunities: no inputs and output types match.
Evan Cheng [Fri, 29 Jan 2010 06:45:59 +0000 (06:45 +0000)]
Catch more trivial tail call opportunities: no inputs and output types match.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94804 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoHaving RHSKnownZero and RHSKnownOne be alternative names for KnownZero and KnownOne
Duncan Sands [Fri, 29 Jan 2010 06:18:46 +0000 (06:18 +0000)]
Having RHSKnownZero and RHSKnownOne be alternative names for KnownZero and KnownOne
(via APInt &RHSKnownZero = KnownZero, etc) seems dangerous and confusing to me: it
is easy not to notice this, and then wonder why KnownZero/RHSKnownZero changed
underneath you when you modified RHSKnownZero/KnownZero etc.  So get rid of this.
No intended functionality change (tested with "make check" + llvm-gcc bootstrap).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94802 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoIt looks like the changes to the SRem logic of SimplifyDemandedUseBits
Duncan Sands [Fri, 29 Jan 2010 06:18:37 +0000 (06:18 +0000)]
It looks like the changes to the SRem logic of SimplifyDemandedUseBits
(fix for PR6165) are needed here too.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94801 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFileCheck: Switch "possible match" calculation to use StringRef::edit_distance.
Daniel Dunbar [Fri, 29 Jan 2010 03:22:19 +0000 (03:22 +0000)]
FileCheck: Switch "possible match" calculation to use StringRef::edit_distance.
 - Thanks Doug, who is obviously less lazy than me!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94795 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMake strcpy_chk lower to strcpy if we have a safe size.
Eric Christopher [Fri, 29 Jan 2010 01:37:11 +0000 (01:37 +0000)]
Make strcpy_chk lower to strcpy if we have a safe size.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94783 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoQuick fix to make the header file for the enhanced
Sean Callanan [Fri, 29 Jan 2010 01:34:29 +0000 (01:34 +0000)]
Quick fix to make the header file for the enhanced
disassembly information have a better comment (and
better guard macros).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94781 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdded a bare-bones Makefile to build the enhanced disassembly
Sean Callanan [Fri, 29 Jan 2010 01:30:01 +0000 (01:30 +0000)]
Added a bare-bones Makefile to build the enhanced disassembly
library as a static and a shared library.  Added dependencies
so the target-specific enhanced disassembly info tables are
built before the library.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94780 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRecognize 'add_executable' when analyzing CMake files.
Ted Kremenek [Fri, 29 Jan 2010 01:10:55 +0000 (01:10 +0000)]
Recognize 'add_executable' when analyzing CMake files.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94777 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoUpdate CMake build.
Ted Kremenek [Fri, 29 Jan 2010 01:10:25 +0000 (01:10 +0000)]
Update CMake build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94776 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd constant support to object size handling and remove default
Eric Christopher [Fri, 29 Jan 2010 01:09:57 +0000 (01:09 +0000)]
Add constant support to object size handling and remove default
lowering. We'll either figure it out, or not and be lowered by
SelectionDAGBuild.

Add test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94775 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoGeneric reformatting and comment fixing. No functionality change.
Bill Wendling [Fri, 29 Jan 2010 00:52:43 +0000 (00:52 +0000)]
Generic reformatting and comment fixing. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94771 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd newline to debugging output, and fix some grammar-os in comment.
Bill Wendling [Fri, 29 Jan 2010 00:27:39 +0000 (00:27 +0000)]
Add newline to debugging output, and fix some grammar-os in comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94765 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdded a custom TableGen backend to support the
Sean Callanan [Fri, 29 Jan 2010 00:21:04 +0000 (00:21 +0000)]
Added a custom TableGen backend to support the
enhanced disassembler, and the necessary makefile
rules to build the table for X86.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94764 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agomem2reg erases the dbg.declare intrinsics that it converts to dbg.val intrinsics
Victor Hernandez [Fri, 29 Jan 2010 00:01:35 +0000 (00:01 +0000)]
mem2reg erases the dbg.declare intrinsics that it converts to dbg.val intrinsics

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94763 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAssign the ordering of SDNodes in a much less intrusive fashion. After the
Bill Wendling [Thu, 28 Jan 2010 21:51:40 +0000 (21:51 +0000)]
Assign the ordering of SDNodes in a much less intrusive fashion. After the
"visit*" method is called, take the newly created nodes, walk them in a DFS
fashion, and if they don't have an ordering set, then give it one.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94757 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSupport some more options...
Mikhail Glushenkov [Thu, 28 Jan 2010 18:19:36 +0000 (18:19 +0000)]
Support some more options...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94752 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRemove the folding rule
Dan Gohman [Thu, 28 Jan 2010 18:08:26 +0000 (18:08 +0000)]
Remove the folding rule
  getelementptr (i8* inttoptr (i64 1 to i8*), i32 -1)
  to
  inttoptr (i64 0 to i8*)
from the VMCore constant folder. It didn't handle sign-extension properly
in the case where the source integer is smaller than a pointer size. And,
it relied on an assumption about sizeof(i8).

The Analysis constant folder still folds these kinds of things; it has
access to TargetData, so it can do them right.

Add a testcase which tests that the VMCore constant folder doesn't
miscompile this, and that the Analysis folder does fold it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94750 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoReplace strcpy with memcpy when we have the length around anyway.
Benjamin Kramer [Thu, 28 Jan 2010 18:04:38 +0000 (18:04 +0000)]
Replace strcpy with memcpy when we have the length around anyway.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94746 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix PR6165. The bug was that LHSKnownZero was being and'd with DemandedMask
Duncan Sands [Thu, 28 Jan 2010 17:22:42 +0000 (17:22 +0000)]
Fix PR6165.  The bug was that LHSKnownZero was being and'd with DemandedMask
when it should have been and'd with LowBits.  Fix that and while there beef
up the logic in the case of a negative LHS.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94745 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd llvm::Program::ChangeStderrToBinary().
Douglas Gregor [Thu, 28 Jan 2010 06:42:08 +0000 (06:42 +0000)]
Add llvm::Program::ChangeStderrToBinary().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94743 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoCheck Type::isSized before calling ScalarEvolution::getAllocSizeExpr,
Dan Gohman [Thu, 28 Jan 2010 06:32:46 +0000 (06:32 +0000)]
Check Type::isSized before calling ScalarEvolution::getAllocSizeExpr,
rather than after.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94742 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoconvert the last 3 targets to use EmitFunctionBody() now that
Chris Lattner [Thu, 28 Jan 2010 06:22:43 +0000 (06:22 +0000)]
convert the last 3 targets to use EmitFunctionBody() now that
it has before/end body hooks.

 lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp |   49 ++-----------
 lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp   |   87 ++++++------------------
 lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp |   56 +++------------
 test/CodeGen/XCore/ashr.ll                      |    2
 4 files changed, 48 insertions(+), 146 deletions(-)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94741 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMake getAlignOf return an i64, for consistency with getSizeOf and
Dan Gohman [Thu, 28 Jan 2010 02:43:22 +0000 (02:43 +0000)]
Make getAlignOf return an i64, for consistency with getSizeOf and
getOffsetOf, and remove the comment about assuming i8 is byte-aligned,
which is no longer applicable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94738 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRemove SCEVAllocSizeExpr and SCEVFieldOffsetExpr, and in their place
Dan Gohman [Thu, 28 Jan 2010 02:15:55 +0000 (02:15 +0000)]
Remove SCEVAllocSizeExpr and SCEVFieldOffsetExpr, and in their place
use plain SCEVUnknowns with ConstantExpr::getSizeOf and
ConstantExpr::getOffsetOf constants. This eliminates a bunch of
special-case code.

Also add code for pattern-matching these expressions, for clients that
want to recognize them.

Move ScalarEvolution's logic for expanding array and vector sizeof
expressions into an element count times the element size, to expose
the multiplication to subsequent folding, into the regular constant
folder.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94737 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoadd target hooks for emitting random gunk before and after the function body.
Chris Lattner [Thu, 28 Jan 2010 01:58:58 +0000 (01:58 +0000)]
add target hooks for emitting random gunk before and after the function body.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94732 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix a bug introduced by r94490 where it created a X86ISD::CMP whose output type is...
Evan Cheng [Thu, 28 Jan 2010 01:57:22 +0000 (01:57 +0000)]
Fix a bug introduced by r94490 where it created a X86ISD::CMP whose output type is different from its inputs.
This fixes PR6146.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94731 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoswitch blackfin to the default runOnMachineFunction
Chris Lattner [Thu, 28 Jan 2010 01:54:33 +0000 (01:54 +0000)]
switch blackfin to the default runOnMachineFunction

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94729 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoeliminate a now-useless class.
Chris Lattner [Thu, 28 Jan 2010 01:50:22 +0000 (01:50 +0000)]
eliminate a now-useless class.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94728 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSwitch MSP430, SPU, Sparc, and SystemZ to use EmitFunctionBody().
Chris Lattner [Thu, 28 Jan 2010 01:48:52 +0000 (01:48 +0000)]
Switch MSP430, SPU, Sparc, and SystemZ to use EmitFunctionBody().

Diffstat:
 6 files changed, 30 insertions(+), 284 deletions(-)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94727 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoUpdate of 94055 to track the IR level call site information via an intrinsic.
Jim Grosbach [Thu, 28 Jan 2010 01:45:32 +0000 (01:45 +0000)]
Update of 94055 to track the IR level call site information via an intrinsic.
This allows code gen and the exception table writer to cooperate to make sure
landing pads are associated with the correct invoke locations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94726 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRecord the death of ModuleProvier and GhostLinkage in the release notes and
Jeffrey Yasskin [Thu, 28 Jan 2010 01:41:20 +0000 (01:41 +0000)]
Record the death of ModuleProvier and GhostLinkage in the release notes and
give upgrade instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94723 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoGive AsmPrinter the most common expected implementation of
Chris Lattner [Thu, 28 Jan 2010 01:28:58 +0000 (01:28 +0000)]
Give AsmPrinter the most common expected implementation of
runOnMachineFunction, and switch PPC to use EmitFunctionBody.
The two ppc asmprinters now don't heave to define
runOnMachineFunction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94722 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoTruncate the release notes so they're ready to accumulate notes for the 2.7 release.
Jeffrey Yasskin [Thu, 28 Jan 2010 01:14:43 +0000 (01:14 +0000)]
Truncate the release notes so they're ready to accumulate notes for the 2.7 release.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94720 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoswitch ARM to EmitFunctionBody().
Chris Lattner [Thu, 28 Jan 2010 01:10:34 +0000 (01:10 +0000)]
switch ARM to EmitFunctionBody().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94719 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoemit a 0 byte instead of a noop if a function is empty on darwin.
Chris Lattner [Thu, 28 Jan 2010 01:06:32 +0000 (01:06 +0000)]
emit a 0 byte instead of a noop if a function is empty on darwin.
"0" is nice and target independent.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94718 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRemove the argument from EmitJumpTableInfo, because it doesn't need it.
Chris Lattner [Thu, 28 Jan 2010 01:02:27 +0000 (01:02 +0000)]
Remove the argument from EmitJumpTableInfo, because it doesn't need it.

Move the X86 implementation of function body emission up to
AsmPrinter::EmitFunctionBody, which works by calling the virtual
EmitInstruction method.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94716 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDrop the argument to AsmPrinter::EmitConstantPool and make it virtual.
Chris Lattner [Thu, 28 Jan 2010 00:19:24 +0000 (00:19 +0000)]
Drop the argument to AsmPrinter::EmitConstantPool and make it virtual.
Overload it in the ARM backend to do nothing, since is does insane
constant pool emission.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94708 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agodon't emit constant pools twice.
Chris Lattner [Thu, 28 Jan 2010 00:15:18 +0000 (00:15 +0000)]
don't emit constant pools twice.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94706 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agorename printVisibility to EmitVisibility and make it private,
Chris Lattner [Thu, 28 Jan 2010 00:05:10 +0000 (00:05 +0000)]
rename printVisibility to EmitVisibility and make it private,
constify EmitLinkage.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94705 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoswitch ARM to use EmitFunctionHeader.
Chris Lattner [Wed, 27 Jan 2010 23:58:11 +0000 (23:58 +0000)]
switch ARM to use EmitFunctionHeader.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94703 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoeliminate the ARMFunctionInfo::Align member, using
Chris Lattner [Wed, 27 Jan 2010 23:37:36 +0000 (23:37 +0000)]
eliminate the ARMFunctionInfo::Align member, using
MachineFunction::Alignment instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94701 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoadd a helper function for bumping up the alignment of a machine function.
Chris Lattner [Wed, 27 Jan 2010 23:35:43 +0000 (23:35 +0000)]
add a helper function for bumping up the alignment of a machine function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94700 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoswitch blackfin to use EmitFunctionHeader. BlackfinAsmPrinter.cpp
Chris Lattner [Wed, 27 Jan 2010 23:26:37 +0000 (23:26 +0000)]
switch blackfin to use EmitFunctionHeader.  BlackfinAsmPrinter.cpp
is now less than 200 LOC!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94699 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoswitch mips to use the shared EmitFunctionHeader() function
Chris Lattner [Wed, 27 Jan 2010 23:23:58 +0000 (23:23 +0000)]
switch mips to use the shared EmitFunctionHeader() function

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94698 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoChanged constants to an enum so as not to pollute the
Sean Callanan [Wed, 27 Jan 2010 23:20:51 +0000 (23:20 +0000)]
Changed constants to an enum so as not to pollute the
global namespace needlessly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94697 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdded a header file defining the externally-visible C API
Sean Callanan [Wed, 27 Jan 2010 23:03:46 +0000 (23:03 +0000)]
Added a header file defining the externally-visible C API
for the LLVM disassemblers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94696 91177308-0d34-0410-b5e6-96231b3b80d8