oota-llvm.git
13 years agoInitialize the only-used-with-PPC-double-double parts of the APFloat class. This
Bill Wendling [Fri, 18 Mar 2011 09:09:44 +0000 (09:09 +0000)]
Initialize the only-used-with-PPC-double-double parts of the APFloat class. This
makes valgrind stop complaining about uninitialized variables being read when it
accesses a bitfield (category) that shares its bits with these variables.

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

13 years agoSimplify the computation of undefined symbols. Instead of walking
Rafael Espindola [Fri, 18 Mar 2011 05:12:38 +0000 (05:12 +0000)]
Simplify the computation of undefined symbols. Instead of walking
functions and initializers, just report the declarations present in
the module.

The motivation is to open the way for using the lazy module parsing,
which should speed up clients that just want a symbol list (nm, ar).

This is slightly less precise, but since both -strip-dead-prototypes
and -globaldce are part of the standard pipeline, this shouldn't
change the result for clang/dragonegg produced binaries.

Any decl in an IL file was also put there because a FE expected it
to be necessary, so this should not be a problem for "-O0 -emit-llvm".

As a sanity check, I have bootstrapped clang on linux and built
firefox on both linux and darwin. A clang bootstrap on darwin
with LTO fails with or without this patch because, ironically,
the linker doesn't like the combination of dead_strip and LTO
when building libLTO.so :-)

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

13 years agoHoist spills when the same value is known to be in less loopy sibling registers.
Jakob Stoklund Olesen [Fri, 18 Mar 2011 04:23:06 +0000 (04:23 +0000)]
Hoist spills when the same value is known to be in less loopy sibling registers.

Stack slot real estate is virtually free compared to registers, so it is
advantageous to spill earlier even though the same value is now kept in both a
register and a stack slot.

Also eliminate redundant spills by extending the stack slot live range
underneath reloaded registers.

This can trigger a dead code elimination, removing copies and even reloads that
were only feeding spills.

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

13 years agoSome release notes.
Rafael Espindola [Fri, 18 Mar 2011 04:07:44 +0000 (04:07 +0000)]
Some release notes.

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

13 years agoTweak CrashRecoveryContextCleanup::createCleanup() to use the 'delete' cleanup as...
Ted Kremenek [Fri, 18 Mar 2011 03:46:21 +0000 (03:46 +0000)]
Tweak CrashRecoveryContextCleanup::createCleanup() to use the 'delete' cleanup as opposed to the 'destructor' cleanup (reclaims more memory).

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

13 years agotools/lto/LTOModule.cpp: Eliminate an unused variable.
NAKAMURA Takumi [Fri, 18 Mar 2011 03:21:11 +0000 (03:21 +0000)]
tools/lto/LTOModule.cpp: Eliminate an unused variable.

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

13 years agollvm-bcanalyzer.cpp: Tweak format string to suppress warnings on mingw32-g++.
NAKAMURA Takumi [Fri, 18 Mar 2011 03:21:04 +0000 (03:21 +0000)]
llvm-bcanalyzer.cpp: Tweak format string to suppress warnings on mingw32-g++.

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

13 years agoAccept instructions that read undefined values.
Jakob Stoklund Olesen [Fri, 18 Mar 2011 03:06:04 +0000 (03:06 +0000)]
Accept instructions that read undefined values.

This is not supposed to happen, but I have seen the x86 rematter getting
confused when rematerializing partial redefs.

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

13 years agoBe more accurate about the slot index reading a register when dealing with defs
Jakob Stoklund Olesen [Fri, 18 Mar 2011 03:06:02 +0000 (03:06 +0000)]
Be more accurate about the slot index reading a register when dealing with defs
and early clobbers.

Assert when trying to find an undefined value.

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

13 years agoAdd new CrashRecoveryContextCleanup subclass: CrashRecoveryContextDeleteCleanup....
Ted Kremenek [Fri, 18 Mar 2011 03:04:18 +0000 (03:04 +0000)]
Add new CrashRecoveryContextCleanup subclass: CrashRecoveryContextDeleteCleanup.  This deletes the object, not just calls its destructor.

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

13 years agoCheck RequiresNullTerminator first, or we might read from an invalid address.
Rafael Espindola [Fri, 18 Mar 2011 02:55:51 +0000 (02:55 +0000)]
Check RequiresNullTerminator first, or we might read from an invalid address.

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

13 years agoAdd a target-specific branchless method for double-width relational
Eli Friedman [Fri, 18 Mar 2011 02:34:11 +0000 (02:34 +0000)]
Add a target-specific branchless method for double-width relational
comparisons on x86.  Essentially, the way this works is that SUB+SBB sets
the relevant flags the same way a double-width CMP would.

This is a substantial improvement over the generic lowering in LLVM. The output
is also shorter than the gcc-generated output; I haven't done any detailed
benchmarking, though.

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

13 years agoAugment CrashRecoveryContext to have registered "cleanup" objects that can be used...
Ted Kremenek [Fri, 18 Mar 2011 02:05:11 +0000 (02:05 +0000)]
Augment CrashRecoveryContext to have registered "cleanup" objects that can be used to release resources during a crash.

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

13 years agoAdd some svn:ignore properties.
Eli Friedman [Fri, 18 Mar 2011 01:24:16 +0000 (01:24 +0000)]
Add some svn:ignore properties.

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

13 years agoFileCheck-ize and update test.
Eli Friedman [Fri, 18 Mar 2011 01:10:31 +0000 (01:10 +0000)]
FileCheck-ize and update test.

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

13 years agoThe disassembler for Thumb was wrongly adding 4 to the computed imm32 offset.
Johnny Chen [Fri, 18 Mar 2011 00:38:03 +0000 (00:38 +0000)]
The disassembler for Thumb was wrongly adding 4 to the computed imm32 offset.
Remove the offending logic and update the test cases.

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

13 years agoRemove TargetData and ValueTracking includes. I didn't mean for them to sneak in...
Andrew Trick [Fri, 18 Mar 2011 00:36:39 +0000 (00:36 +0000)]
Remove TargetData and ValueTracking includes. I didn't mean for them to sneak in my last checkin.

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

13 years agoThere are two pseudos in this case that are Thumb mode, not one.
Owen Anderson [Thu, 17 Mar 2011 23:52:05 +0000 (23:52 +0000)]
There are two pseudos in this case that are Thumb mode, not one.

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

13 years agoAdded isValidRewrite() to check the result of ScalarEvolutionExpander.
Andrew Trick [Thu, 17 Mar 2011 23:51:11 +0000 (23:51 +0000)]
Added isValidRewrite() to check the result of ScalarEvolutionExpander.

SCEV may generate expressions composed of multiple pointers, which can
lead to invalid GEP expansion. Until we can teach SCEV to follow strict
pointer rules, make sure no bad GEPs creep into IR.
Fixes rdar://problem/9038671.

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

13 years agowhitespace
Andrew Trick [Thu, 17 Mar 2011 23:46:48 +0000 (23:46 +0000)]
whitespace

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

13 years agoUse RequiresNullTerminator to create buffers without a null terminator
Rafael Espindola [Thu, 17 Mar 2011 22:18:42 +0000 (22:18 +0000)]
Use RequiresNullTerminator to create buffers without a null terminator
instead of copying.

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

13 years agoTry to not lose variable's debug info during instcombine.
Devang Patel [Thu, 17 Mar 2011 22:18:16 +0000 (22:18 +0000)]
Try to not lose variable's debug info during instcombine.
This is done by lowering dbg.declare intrinsic into dbg.value intrinsic.
Radar 9143931.

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

13 years agoIt used to be that t_addrmode_s4 was used for both:
Johnny Chen [Thu, 17 Mar 2011 22:04:05 +0000 (22:04 +0000)]
It used to be that t_addrmode_s4 was used for both:

o A8.6.195 STR (register) -- Encoding T1
o A8.6.193 STR (immediate, Thumb) -- Encoding T1

It has been changed so that now they use different addressing modes
and thus different MC representation (Operand Infos).  Modify the
disassembler to reflect the change, and add relevant tests.

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

13 years agoRefactor into a separate utility function.
Devang Patel [Thu, 17 Mar 2011 21:58:19 +0000 (21:58 +0000)]
Refactor into a separate utility function.

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

13 years agoBuildUDIV: If the divisor is even we can simplify the fixup of the multiplied value...
Benjamin Kramer [Thu, 17 Mar 2011 20:39:14 +0000 (20:39 +0000)]
BuildUDIV: If the divisor is even we can simplify the fixup of the multiplied value by introducing an early shift.

This allows us to compile "unsigned foo(unsigned x) { return x/28; }" into
shrl $2, %edi
imulq $613566757, %rdi, %rax
shrq $32, %rax
ret

instead of
movl    %edi, %eax
imulq   $613566757, %rax, %rcx
shrq    $32, %rcx
subl    %ecx, %eax
shrl    %eax
addl    %ecx, %eax
shrl    $4, %eax

on x86_64

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

13 years agoAdd an argument to APInt's magic udiv calculation to specify the number of bits that...
Benjamin Kramer [Thu, 17 Mar 2011 20:39:06 +0000 (20:39 +0000)]
Add an argument to APInt's magic udiv calculation to specify the number of bits that are known zero in the divided number.

This will come in handy soon.

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

13 years agoDead code elimination may separate the live interval into multiple connected components.
Jakob Stoklund Olesen [Thu, 17 Mar 2011 20:37:07 +0000 (20:37 +0000)]
Dead code elimination may separate the live interval into multiple connected components.

I have convinced myself that it can only happen when a phi value dies. When it
happens, allocate new virtual registers for the components.

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

13 years agoReapply: Add type output to llvm-dis annotations. Patch by Yuri!
Stuart Hastings [Thu, 17 Mar 2011 19:50:04 +0000 (19:50 +0000)]
Reapply: Add type output to llvm-dis annotations.  Patch by Yuri!

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

13 years agoAdd XCore intrinsic for setpsc.
Richard Osborne [Thu, 17 Mar 2011 18:42:05 +0000 (18:42 +0000)]
Add XCore intrinsic for setpsc.

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

13 years agoRevert 127813 while fixing broken test.
Stuart Hastings [Thu, 17 Mar 2011 16:54:27 +0000 (16:54 +0000)]
Revert 127813 while fixing broken test.

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

13 years agoAdd type output to llvm-dis. Patch by Yuri!
Stuart Hastings [Thu, 17 Mar 2011 16:30:14 +0000 (16:30 +0000)]
Add type output to llvm-dis.  Patch by Yuri!

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

13 years agoMC/Mach-O: Fix regression introduced in r126127, this assignment shouldn't have
Daniel Dunbar [Thu, 17 Mar 2011 16:25:24 +0000 (16:25 +0000)]
MC/Mach-O: Fix regression introduced in r126127, this assignment shouldn't have
been removed.

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

13 years agoMove more logic into getTypeForExtArgOrReturn.
Cameron Zwarich [Thu, 17 Mar 2011 14:53:37 +0000 (14:53 +0000)]
Move more logic into getTypeForExtArgOrReturn.

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

13 years agoChange the signext language in LangRef to closer match zeroext.
Cameron Zwarich [Thu, 17 Mar 2011 14:21:58 +0000 (14:21 +0000)]
Change the signext language in LangRef to closer match zeroext.

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

13 years agoRename getTypeForExtendedInteger() to getTypeForExtArgOrReturn().
Cameron Zwarich [Thu, 17 Mar 2011 14:21:56 +0000 (14:21 +0000)]
Rename getTypeForExtendedInteger() to getTypeForExtArgOrReturn().

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

13 years agoAdd comments for the demanglings. Correct mangled form of operator delete!
Nick Lewycky [Thu, 17 Mar 2011 05:20:12 +0000 (05:20 +0000)]
Add comments for the demanglings. Correct mangled form of operator delete!

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

13 years agotest/CodeGen/X86/h-registers-1.ll: Add explicit -mtriple=x86_64-linux. It does not...
NAKAMURA Takumi [Thu, 17 Mar 2011 04:24:40 +0000 (04:24 +0000)]
test/CodeGen/X86/h-registers-1.ll: Add explicit -mtriple=x86_64-linux. It does not need to be checked on x86_64-win32 (aka Win64).

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

13 years agoAdd "swi" which is an obsolete mnemonic for "svc".
Nick Lewycky [Thu, 17 Mar 2011 01:46:14 +0000 (01:46 +0000)]
Add "swi" which is an obsolete mnemonic for "svc".

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

13 years agoA couple new README entries.
Eli Friedman [Thu, 17 Mar 2011 01:22:09 +0000 (01:22 +0000)]
A couple new README entries.

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

13 years agoAdd support in the LTO library for loading an object from the middle
Rafael Espindola [Thu, 17 Mar 2011 00:36:11 +0000 (00:36 +0000)]
Add support in the LTO library for loading an object from the middle
of an file.

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

13 years agoFix handling of @IDNTPOFF relocations, they need to get STT_TLS.
Joerg Sonnenberger [Thu, 17 Mar 2011 00:35:10 +0000 (00:35 +0000)]
Fix handling of @IDNTPOFF relocations, they need to get STT_TLS.
While here, add VK_ARM_TPOFF and VK_ARM_GOTTPOFF, too.

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

13 years agoRewrite instructions as part of ConnectedVNInfoEqClasses::Distribute.
Jakob Stoklund Olesen [Thu, 17 Mar 2011 00:23:45 +0000 (00:23 +0000)]
Rewrite instructions as part of ConnectedVNInfoEqClasses::Distribute.

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

13 years agotest/CodeGen/X86/constant-pool-remat-0.ll: FileCheck-ize and add explicit -mtriple...
NAKAMURA Takumi [Wed, 16 Mar 2011 23:01:31 +0000 (23:01 +0000)]
test/CodeGen/X86/constant-pool-remat-0.ll: FileCheck-ize and add explicit -mtriple=x86_64-linux.

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

13 years agoAdd a LiveRangeEdit delegate callback before shrinking a live range.
Jakob Stoklund Olesen [Wed, 16 Mar 2011 22:56:16 +0000 (22:56 +0000)]
Add a LiveRangeEdit delegate callback before shrinking a live range.

The register allocator needs to adjust its live interval unions when that happens.

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

13 years agoErase virtual registers that are unused after DCE.
Jakob Stoklund Olesen [Wed, 16 Mar 2011 22:56:13 +0000 (22:56 +0000)]
Erase virtual registers that are unused after DCE.

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

13 years agoTag cached interference with a user-provided tag instead of the virtual register...
Jakob Stoklund Olesen [Wed, 16 Mar 2011 22:56:11 +0000 (22:56 +0000)]
Tag cached interference with a user-provided tag instead of the virtual register number.

The live range of a virtual register may change which invalidates the cached
interference information.

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

13 years agoClarify debugging output.
Jakob Stoklund Olesen [Wed, 16 Mar 2011 22:56:08 +0000 (22:56 +0000)]
Clarify debugging output.

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

13 years agoThe x86-64 ABI says that a bool is only guaranteed to be sign-extended to a byte
Cameron Zwarich [Wed, 16 Mar 2011 22:20:18 +0000 (22:20 +0000)]
The x86-64 ABI says that a bool is only guaranteed to be sign-extended to a byte
rather than an int. Thankfully, this only causes LLVM to miss optimizations, not
generate incorrect code.

This just fixes the zext at the return. We still insert an i32 ZextAssert when
reading a function's arguments, but it is followed by a truncate and another i8
ZextAssert so it is not optimized.

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

13 years agoRename a test to be more inclusive.
Cameron Zwarich [Wed, 16 Mar 2011 22:20:12 +0000 (22:20 +0000)]
Rename a test to be more inclusive.

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

13 years agoDon't recompute something that we already have in a local variable.
Cameron Zwarich [Wed, 16 Mar 2011 22:20:07 +0000 (22:20 +0000)]
Don't recompute something that we already have in a local variable.

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

13 years agoRevert r127757, "Patch to a fix dwarf relocation problem on ARM. One-line fix
Daniel Dunbar [Wed, 16 Mar 2011 22:16:39 +0000 (22:16 +0000)]
Revert r127757, "Patch to a fix dwarf relocation problem on ARM. One-line fix
plus the test where it used to break.", which broke Clang self-host of a
Debug+Asserts compiler, on OS X.

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

13 years agoAdd XCore intrinsics for setclk, setrdy.
Richard Osborne [Wed, 16 Mar 2011 21:56:00 +0000 (21:56 +0000)]
Add XCore intrinsics for setclk, setrdy.

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

13 years agoPatch to a fix dwarf relocation problem on ARM. One-line fix plus the test where...
Renato Golin [Wed, 16 Mar 2011 21:05:52 +0000 (21:05 +0000)]
Patch to a fix dwarf relocation problem on ARM. One-line fix plus the test where it used to break.

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

13 years agoAdd a test for i1 zeroext arguments on x86-64. We currently generate code that
Cameron Zwarich [Wed, 16 Mar 2011 20:15:44 +0000 (20:15 +0000)]
Add a test for i1 zeroext arguments on x86-64. We currently generate code that
conforms to the ABI, but DAGCombine could in theory recognize the sequence of
zext asserts and truncates and generate incorrect code.

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

13 years agoAdd checkevent intrinsic to check if any resources owned by the current thread
Richard Osborne [Wed, 16 Mar 2011 18:34:00 +0000 (18:34 +0000)]
Add checkevent intrinsic to check if any resources owned by the current thread
can event.

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

13 years agotest/CodeGen/X86: FileCheck-ize and add actions for x86_64-linux and x86_64-win32.
NAKAMURA Takumi [Wed, 16 Mar 2011 13:53:07 +0000 (13:53 +0000)]
test/CodeGen/X86: FileCheck-ize and add actions for x86_64-linux and x86_64-win32.

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

13 years agotest/CodeGen/X86: Add a pattern for Win64.
NAKAMURA Takumi [Wed, 16 Mar 2011 13:52:51 +0000 (13:52 +0000)]
test/CodeGen/X86: Add a pattern for Win64.

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

13 years agotest/CodeGen/X86: FileCheck-ize and add explicit -mtriple=x86_64-linux. They are...
NAKAMURA Takumi [Wed, 16 Mar 2011 13:52:38 +0000 (13:52 +0000)]
test/CodeGen/X86: FileCheck-ize and add explicit -mtriple=x86_64-linux. They are useless to Win64 target.

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

13 years agotest/CodeGen/X86/byval*.ll: Win64 has not supported byval yet.
NAKAMURA Takumi [Wed, 16 Mar 2011 13:52:20 +0000 (13:52 +0000)]
test/CodeGen/X86/byval*.ll: Win64 has not supported byval yet.

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

13 years agotest/CodeGen/X86/dyn-stackalloc.ll: FileCheck-ize.
NAKAMURA Takumi [Wed, 16 Mar 2011 13:52:08 +0000 (13:52 +0000)]
test/CodeGen/X86/dyn-stackalloc.ll: FileCheck-ize.

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

13 years agoFix a comment.
Cameron Zwarich [Wed, 16 Mar 2011 08:13:42 +0000 (08:13 +0000)]
Fix a comment.

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

13 years agolib/Support/raw_ostream.cpp: On mingw, report_fatal_error() should not be called...
NAKAMURA Takumi [Wed, 16 Mar 2011 02:53:39 +0000 (02:53 +0000)]
lib/Support/raw_ostream.cpp: On mingw, report_fatal_error() should not be called at dtor context.

report_fatal_error() invokes exit(). We know report_fatal_error() might not write messages to stderr when any errors were detected on FD == 2.

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

13 years agoWindows/PathV2.inc: [PR8520] Recognize "NUL" as special (character) file.
NAKAMURA Takumi [Wed, 16 Mar 2011 02:53:32 +0000 (02:53 +0000)]
Windows/PathV2.inc: [PR8520] Recognize "NUL" as special (character) file.

FIXME: It is a temporal hack. We should detect as many "special file name" as possible.

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

13 years agoWindows/Path.inc: [PR6270] PathV1::makeUnique(): Give arbitrary initial seed for...
NAKAMURA Takumi [Wed, 16 Mar 2011 02:53:24 +0000 (02:53 +0000)]
Windows/Path.inc: [PR6270] PathV1::makeUnique(): Give arbitrary initial seed for workaround.

FIXME: We should use sys::fs::unique_file() in future.

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

13 years agoTidy up. Whitespace and 80 column.
Jim Grosbach [Wed, 16 Mar 2011 01:21:55 +0000 (01:21 +0000)]
Tidy up. Whitespace and 80 column.

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

13 years agoDo not accidently initialize NumDbgValueLost and NumDbgLineLost counts.
Devang Patel [Wed, 16 Mar 2011 00:27:57 +0000 (00:27 +0000)]
Do not accidently initialize NumDbgValueLost and NumDbgLineLost counts.

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

13 years agoOnly convert allocas to scalars if it is profitable. The profitability metric I
Cameron Zwarich [Wed, 16 Mar 2011 00:13:44 +0000 (00:13 +0000)]
Only convert allocas to scalars if it is profitable. The profitability metric I
chose is having a non-memcpy/memset use and being larger than any native integer
type. Originally I chose having an access of a size smaller than the total size
of the alloca, but this caused some minor issues on the spirit benchmark where
SRoA runs again after some inlining.

This fixes <rdar://problem/8613163>.

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

13 years agoAdd native integer type TargetData to some existing tests.
Cameron Zwarich [Wed, 16 Mar 2011 00:13:40 +0000 (00:13 +0000)]
Add native integer type TargetData to some existing tests.

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

13 years agoBetter use initializer lists.
Cameron Zwarich [Wed, 16 Mar 2011 00:13:37 +0000 (00:13 +0000)]
Better use initializer lists.

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

13 years agoAdd a clarifying comment.
Cameron Zwarich [Wed, 16 Mar 2011 00:13:35 +0000 (00:13 +0000)]
Add a clarifying comment.

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

13 years agoAdd TargetData::fitsInLegalInteger().
Cameron Zwarich [Wed, 16 Mar 2011 00:13:28 +0000 (00:13 +0000)]
Add TargetData::fitsInLegalInteger().

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

13 years agoThere were two issues fixed:
Johnny Chen [Tue, 15 Mar 2011 22:27:33 +0000 (22:27 +0000)]
There were two issues fixed:

1. The ARM Darwin *r9 call instructions were pseudo-ized recently.
   Modify the ARMDisassemblerCore.cpp file to accomodate the change.

2. The disassembler was unnecessarily adding 8 to the sign-extended imm24:

   imm32 = SignExtend(imm24:'00', 32); // A8.6.23 BL, BLX (immediate)
                                       // Encoding A1

   It has no business doing such.  Removed the offending logic.

Add test cases to arm-tests.txt.

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

13 years agoAdd scei vendor
John Thompson [Tue, 15 Mar 2011 21:51:56 +0000 (21:51 +0000)]
Add scei vendor

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

13 years agoThe VTBL (and VTBX) instructions are rather permissive concerning the masks they
Bill Wendling [Tue, 15 Mar 2011 21:15:20 +0000 (21:15 +0000)]
The VTBL (and VTBX) instructions are rather permissive concerning the masks they
accept. If a value in the mask is out of range, it uses the value 0, for VTBL,
or leaves the value unchanged, for VTBX.

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

13 years agoTrace back through sibling copies to hoist spills and find rematerializable defs.
Jakob Stoklund Olesen [Tue, 15 Mar 2011 21:13:25 +0000 (21:13 +0000)]
Trace back through sibling copies to hoist spills and find rematerializable defs.

After live range splitting, an original value may be available in multiple
registers. Tracing back through the registers containing the same value, find
the best place to insert a spill, determine if the value has already been
spilled, or discover a reaching def that may be rematerialized.

This is only the analysis part. The information is not used for anything yet.

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

13 years agoPreserve both isPHIDef and isDefByCopy bits when copying parent values.
Jakob Stoklund Olesen [Tue, 15 Mar 2011 21:13:22 +0000 (21:13 +0000)]
Preserve both isPHIDef and isDefByCopy bits when copying parent values.

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

13 years agolit/ProgressBar.py: [PR7919] Improve line wrap for XN-incapable terminals.
NAKAMURA Takumi [Tue, 15 Mar 2011 21:07:44 +0000 (21:07 +0000)]
lit/ProgressBar.py: [PR7919] Improve line wrap for XN-incapable terminals.

On Win32 console, emitting char to col#79 causes linefeed, and the cursor will not return to col#79 upper line with backspace.

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

13 years agoSome minor cleanups based on feedback.
Bill Wendling [Tue, 15 Mar 2011 20:47:26 +0000 (20:47 +0000)]
Some minor cleanups based on feedback.

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

13 years agoTrailing whitespae.
Jim Grosbach [Tue, 15 Mar 2011 20:25:54 +0000 (20:25 +0000)]
Trailing whitespae.

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

13 years agoClean up something noticed by Fritz.
Cameron Zwarich [Tue, 15 Mar 2011 18:42:33 +0000 (18:42 +0000)]
Clean up something noticed by Fritz.

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

13 years agoDo not form thumb2 ldrd / strd if the offset is by multiple of 4. rdar://9133587
Evan Cheng [Tue, 15 Mar 2011 18:41:52 +0000 (18:41 +0000)]
Do not form thumb2 ldrd / strd if the offset is by multiple of 4. rdar://9133587

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

13 years agoDon't indent cases in a switch, no functionality change.
Richard Osborne [Tue, 15 Mar 2011 15:55:30 +0000 (15:55 +0000)]
Don't indent cases in a switch, no functionality change.

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

13 years agoOn the XCore the scavenging slot should be closest to the SP.
Richard Osborne [Tue, 15 Mar 2011 15:10:11 +0000 (15:10 +0000)]
On the XCore the scavenging slot should be closest to the SP.

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

13 years agois_llvm_target_library: recognize libraries without the LLVM prefix.
Oscar Fuentes [Tue, 15 Mar 2011 14:53:53 +0000 (14:53 +0000)]
is_llvm_target_library: recognize libraries without the LLVM prefix.

Without this cmake fails at configuration when some target pass
"native" on LLVM_LINK_COMPONENTS and that is expanded to "X86".

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

13 years agoAdd XCore intrinsics for getps, setps, setsr and clrsr.
Richard Osborne [Tue, 15 Mar 2011 13:45:47 +0000 (13:45 +0000)]
Add XCore intrinsics for getps, setps, setsr and clrsr.

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

13 years agoPTX: Set PTX 2.0 as the minimum supported version
Justin Holewinski [Tue, 15 Mar 2011 13:24:15 +0000 (13:24 +0000)]
PTX: Set PTX 2.0 as the minimum supported version

- Remove PTX 1.4 code generation
- Change type of intrinsics to .v4.i32 instead of .v4.i16
- Add and/or/xor integer instructions

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

13 years agoSilence compiler warning about case values not being in the enumerated type
Duncan Sands [Tue, 15 Mar 2011 08:54:51 +0000 (08:54 +0000)]
Silence compiler warning about case values not being in the enumerated type
MCFixupKind.  This is the same technique that is used elsewhere in MC.

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

13 years agoAvoid a compiler warning about reg possibly being used uninitialized
Duncan Sands [Tue, 15 Mar 2011 08:41:24 +0000 (08:41 +0000)]
Avoid a compiler warning about reg possibly being used uninitialized
when building with assertions disabled.

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

13 years agoDo not add PHIs with no users when creating LCSSA form. Patch by Andrew Clinton.
Cameron Zwarich [Tue, 15 Mar 2011 07:41:25 +0000 (07:41 +0000)]
Do not add PHIs with no users when creating LCSSA form. Patch by Andrew Clinton.

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

13 years agoAdd C++ global operator {new,new[],delete,delete[]}(unsigned {int,long}) to the
Nick Lewycky [Tue, 15 Mar 2011 07:31:32 +0000 (07:31 +0000)]
Add C++ global operator {new,new[],delete,delete[]}(unsigned {int,long}) to the
memory builtins as equivalent to malloc/free.

This is different from any attribute we have. For example, you can delete the
allocators when their result is unused, but you can't collapse two calls to the
same function, even if no global/memory state has changed in between. The
noalias return states that the result does not alias any other pointer, but
instcombine optimizes malloc() as though the result is non-null for the purpose
of eliminating unused pointers.

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

13 years agoAdd a peephole optimization to optimize pairs of bitcasts. e.g.
Evan Cheng [Tue, 15 Mar 2011 05:13:13 +0000 (05:13 +0000)]
Add a peephole optimization to optimize pairs of bitcasts. e.g.
v2 = bitcast v1
...
v3 = bitcast v2
...
   = v3
=>
v2 = bitcast v1
...
   = v1
if v1 and v3 are of in the same register class.

bitcast between i32 and fp (and others) are often not nops since they
are in different register classes. These bitcast instructions are often
left because they are in different basic blocks and cannot be
eliminated by dag combine.

rdar://9104514

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

13 years ago- Add "Bitcast" target instruction property for instructions which perform
Evan Cheng [Tue, 15 Mar 2011 05:09:26 +0000 (05:09 +0000)]
- Add "Bitcast" target instruction property for instructions which perform
nothing more than a bitcast.
- Teach tablegen to automatically infer "Bitcast" property.

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

13 years agoPR9450: Make switch optimization in SimplifyCFG not dependent on the ordering
Eli Friedman [Tue, 15 Mar 2011 02:23:35 +0000 (02:23 +0000)]
PR9450: Make switch optimization in SimplifyCFG not dependent on the ordering
of pointers in an std::map.

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

13 years agosext(undef) = 0, because the top bits will all be the same.
Evan Cheng [Tue, 15 Mar 2011 02:22:10 +0000 (02:22 +0000)]
sext(undef) = 0, because the top bits will all be the same.
zext(undef) = 0, because the top bits will be zero.

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

13 years agoTestcase for r127630.
Bill Wendling [Tue, 15 Mar 2011 01:49:08 +0000 (01:49 +0000)]
Testcase for r127630.

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

13 years agoBasic sanity checks to ensure that 2- and 3-byte
Sean Callanan [Tue, 15 Mar 2011 01:32:46 +0000 (01:32 +0000)]
Basic sanity checks to ensure that 2- and 3-byte
VEX prefixes are working for triadic AVX
instructions.  This concludes the patch set to
enable AVX support for the X86 disassebler.

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

13 years agoEnabled disassembler support for AVX instructions
Sean Callanan [Tue, 15 Mar 2011 01:28:15 +0000 (01:28 +0000)]
Enabled disassembler support for AVX instructions
in the instruction tables and fixed a few bugs that
were causing decode conflicts.  Rudimentary tests
are coming up in the next patch.

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

13 years agoX86 table-generator and disassembler support for the AVX
Sean Callanan [Tue, 15 Mar 2011 01:23:15 +0000 (01:23 +0000)]
X86 table-generator and disassembler support for the AVX
instruction set.  This code adds support for the VEX prefix
and for the YMM registers accessible on AVX-enabled
architectures.  Instruction table support that enables AVX
instructions for the disassembler is in an upcoming patch.

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

13 years agoRemove getMinusSCEVForExitTest().
Andrew Trick [Tue, 15 Mar 2011 01:16:14 +0000 (01:16 +0000)]
Remove getMinusSCEVForExitTest().
This function performed acrobatics to prove no-self-wrap, which we now
have for free.

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

13 years agoFixed an ARM disassembler bug where it does not handle STRi12 correctly because an...
Johnny Chen [Tue, 15 Mar 2011 01:13:17 +0000 (01:13 +0000)]
Fixed an ARM disassembler bug where it does not handle STRi12 correctly because an extra
register operand was erroneously added.  Remove an incorrect assert which triggers the bug.

rdar://problem/9131529

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