oota-llvm.git
12 years agoAdd a test for the miscompilation my recent ConstantDataArray patches introduced...
Chris Lattner [Sun, 5 Feb 2012 02:37:36 +0000 (02:37 +0000)]
Add a test for the miscompilation my recent ConstantDataArray patches introduced, to make sure
we don't regress on it in the future.

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

12 years agoreapply the patches reverted in r149470 that reenable ConstantDataArray,
Chris Lattner [Sun, 5 Feb 2012 02:29:43 +0000 (02:29 +0000)]
reapply the patches reverted in r149470 that reenable ConstantDataArray,
but with a critical fix to the SelectionDAG code that optimizes copies
from strings into immediate stores: the previous code was stopping reading
string data at the first nul.  Address this by adding a new argument to
llvm::getConstantStringInfo, preserving the behavior before the patch.

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

12 years agoRemove most of the intrinsics for XOP VPCMOV instruction. They all aliased to the...
Craig Topper [Sun, 5 Feb 2012 00:55:56 +0000 (00:55 +0000)]
Remove most of the intrinsics for XOP VPCMOV instruction. They all aliased to the same instruction with different types. This would be better accomplished with casts in the not yet created xopintrin.h header file.

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

12 years agoModified the Enhanced Disassembler to create and
Sean Callanan [Sat, 4 Feb 2012 07:45:35 +0000 (07:45 +0000)]
Modified the Enhanced Disassembler to create and
cache disassemblers according to the string value
of the target triple, not according to the enum
of the triple CPU.  The reason for this is that
certain attributes of the instruction set are not
reflected in the enum, but only in the string.

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

12 years agoDrop the REDEF_BY_EC VNInfo flag.
Jakob Stoklund Olesen [Sat, 4 Feb 2012 05:51:25 +0000 (05:51 +0000)]
Drop the REDEF_BY_EC VNInfo flag.

A live range that has an early clobber tied redef now looks like a
normal tied redef, except the early clobber def uses the early clobber
slot.

This is enough to handle any strange interference problems.

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

12 years agoCorrectly terminate a physreg redefined by an early clobber.
Jakob Stoklund Olesen [Sat, 4 Feb 2012 05:41:20 +0000 (05:41 +0000)]
Correctly terminate a physreg redefined by an early clobber.

I don't have a test that fails because of this, but a test case like
CodeGen/X86/2009-12-01-EarlyClobberBug.ll exposes the problem.  EAX is
redefined by a tied early clobber operand on inline asm, and the live
range should look like this:

  %EAX,inf = [48r,64e:0)[64e,80r:1)  0@48r 1@64e

Previously, the two values got merged:

  %EAX,inf = [48r,80r:0)  0@48r

With this bug fixed, the REDEF_BY_EC VNInfo flag is no longer needed.

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

12 years agoFix a leak!
Nick Lewycky [Sat, 4 Feb 2012 05:26:17 +0000 (05:26 +0000)]
Fix a leak!

Andy, in a previous commit you made this into an ImmutablePass so that you could
add it to the PassManager, then in the next commit you left it a Pass but
removed the code that added it to the PM. If you do add it to the PM then the PM
should take care of deleting it, but it's also true that nothing in codegen
needs this object to exist after it's done its work here. It's not clear to me
which design you want; this should likely either cease to be a Pass or be added
to the PM where other parts of CodeGen will request it.

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

12 years agoDon't store COPY pointers in VNInfo.
Jakob Stoklund Olesen [Sat, 4 Feb 2012 05:20:49 +0000 (05:20 +0000)]
Don't store COPY pointers in VNInfo.

If a value is defined by a COPY, that instuction can easily and cheaply
be found by getInstructionFromIndex(VNI->def).

This reduces the size of VNInfo from 24 to 16 bytes, and improves
llc compile time by 3%.

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

12 years agoBoost the effective chain depth of loads and stores.
Hal Finkel [Sat, 4 Feb 2012 04:14:04 +0000 (04:14 +0000)]
Boost the effective chain depth of loads and stores.

By default, boost the chain depth contribution of loads and stores. This will allow a load/store pair to vectorize even when it would not otherwise be long enough to satisfy the chain depth requirement.

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

12 years agoremove the blank line from previous ci.
Qirun Zhang [Sat, 4 Feb 2012 03:18:47 +0000 (03:18 +0000)]
remove the blank line from previous ci.

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

12 years agotest commit.
Qirun Zhang [Sat, 4 Feb 2012 03:15:26 +0000 (03:15 +0000)]
test commit.
add a blank line.

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

12 years agoautoconf: put generated clang files in build dir
Dylan Noblesmith [Sat, 4 Feb 2012 03:00:50 +0000 (03:00 +0000)]
autoconf: put generated clang files in build dir

It was writing generated files to the clang srcdir when
'--with-clang-srcdir' was specified.

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

12 years agoTargetPassConfig: confine the MC configuration to TargetMachine.
Andrew Trick [Sat, 4 Feb 2012 02:56:59 +0000 (02:56 +0000)]
TargetPassConfig: confine the MC configuration to TargetMachine.

Passes prior to instructon selection are now split into separate configurable stages.
Header dependencies are simplified.
The bulk of this diff is simply removal of the silly DisableVerify flags.

Sorry for the target header churn. Attempting to stabilize them.

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

12 years agoMove TargetPassConfig implementation into Passes.cpp
Andrew Trick [Sat, 4 Feb 2012 02:56:48 +0000 (02:56 +0000)]
Move TargetPassConfig implementation into Passes.cpp

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

12 years agoMake TargetPassConfig an ImmutablePass so CodeGenPasses can query options
Andrew Trick [Sat, 4 Feb 2012 02:56:45 +0000 (02:56 +0000)]
Make TargetPassConfig an ImmutablePass so CodeGenPasses can query options

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

12 years agocmake: update outdated CPack version info
Dylan Noblesmith [Sat, 4 Feb 2012 02:52:48 +0000 (02:52 +0000)]
cmake: update outdated CPack version info

Left over from r116516.

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

12 years agoObject: avoid undefined behavior when bounds-checking
Dylan Noblesmith [Sat, 4 Feb 2012 02:41:39 +0000 (02:41 +0000)]
Object: avoid undefined behavior when bounds-checking

Don't form an out of bounds pointer just to test if it
would be out of bounds.

Also perform the same bounds checking for all the previous
mapped structures.

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

12 years agoautoconf: fix clang detection
Dylan Noblesmith [Sat, 4 Feb 2012 02:41:36 +0000 (02:41 +0000)]
autoconf: fix clang detection

Now this works with and without --with-clang-srcdir, with and
without an out-of-tree build.

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

12 years agoEmit new property tag.
Devang Patel [Sat, 4 Feb 2012 01:30:32 +0000 (01:30 +0000)]
Emit new property tag.

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

12 years agoUpdate llvm debug version to support new structure and tag for Objective-C property...
Devang Patel [Sat, 4 Feb 2012 01:30:01 +0000 (01:30 +0000)]
Update llvm debug version to support new structure and tag for Objective-C property's debug info.

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

12 years agoIntroduce DIObjCProperty. This will be used to encode objective-c property.
Devang Patel [Sat, 4 Feb 2012 00:59:25 +0000 (00:59 +0000)]
Introduce DIObjCProperty. This will be used to encode objective-c property.

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

12 years ago[fast-isel] HandlePHINodesInSuccessorBlocks() can promite i8 and i16 types too.
Chad Rosier [Sat, 4 Feb 2012 00:39:19 +0000 (00:39 +0000)]
[fast-isel] HandlePHINodesInSuccessorBlocks() can promite i8 and i16 types too.

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

12 years agoUpdate to the new EH system...remove OLD EH code.
Bill Wendling [Sat, 4 Feb 2012 00:29:12 +0000 (00:29 +0000)]
Update to the new EH system...remove OLD EH code.

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

12 years agoDrop ZeroIndex and InvalidIndex.
Jakob Stoklund Olesen [Sat, 4 Feb 2012 00:11:06 +0000 (00:11 +0000)]
Drop ZeroIndex and InvalidIndex.

They are not used any more. Simply use SlotIndex() to get an invalid
index.

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

12 years agoAdd new tag and an attribute to support debug info for objective-c property.
Devang Patel [Fri, 3 Feb 2012 23:57:08 +0000 (23:57 +0000)]
Add new tag and an attribute to support debug info for objective-c property.

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

12 years agoTrim headers.
Jakob Stoklund Olesen [Fri, 3 Feb 2012 23:51:15 +0000 (23:51 +0000)]
Trim headers.

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

12 years agoDelete some dead code.
Jakob Stoklund Olesen [Fri, 3 Feb 2012 21:32:06 +0000 (21:32 +0000)]
Delete some dead code.

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

12 years ago[fast-isel] Add support for URem.
Chad Rosier [Fri, 3 Feb 2012 21:23:45 +0000 (21:23 +0000)]
[fast-isel] Add support for URem.

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

12 years agoHandle register mask operands in setPhysRegsDeadExcept().
Jakob Stoklund Olesen [Fri, 3 Feb 2012 21:23:14 +0000 (21:23 +0000)]
Handle register mask operands in setPhysRegsDeadExcept().

Calls that use register mask operands don't have implicit defs for
returned values.  The register mask operand handles the call clobber,
but it always behaves like a set of dead defs.

Add live implicit defs for any implicitly defined physregs that are
actually used.

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

12 years ago[fast-isel] Rename isZExt to isSigned. No functional change intended.
Chad Rosier [Fri, 3 Feb 2012 21:14:11 +0000 (21:14 +0000)]
[fast-isel] Rename isZExt to isSigned.  No functional change intended.

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

12 years agoIncrement DFAStateEntryTable index for sentinel entry.
Brendon Cahoon [Fri, 3 Feb 2012 21:08:25 +0000 (21:08 +0000)]
Increment DFAStateEntryTable index for sentinel entry.

When adding the {-1, -1} entry to the DFAStateInputTable, we
need to increment the index used to populate the DFAStateEntryTable.
Otherwise, the entry table will be off by one for each transition
after the {-1, -1} entry. PR11908.

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

12 years ago[fast-isel] Add support for UDIV.
Chad Rosier [Fri, 3 Feb 2012 21:07:27 +0000 (21:07 +0000)]
[fast-isel] Add support for UDIV.

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

12 years agoArrayRef'ize MI::setPhysRegsDeadExcept().
Jakob Stoklund Olesen [Fri, 3 Feb 2012 20:43:39 +0000 (20:43 +0000)]
ArrayRef'ize MI::setPhysRegsDeadExcept().

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

12 years agoHandle all live physreg defs in the same place.
Jakob Stoklund Olesen [Fri, 3 Feb 2012 20:43:35 +0000 (20:43 +0000)]
Handle all live physreg defs in the same place.

SelectionDAG has 4 different ways of passing physreg defs to users.
Collect all of the uses at the same time, and pass all of them to
MI->setPhysRegsDeadExcept() to mark the remaining defs dead.

The setPhysRegsDeadExcept() function will soon add the required
implicit-defs to instructions with register mask operands.

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

12 years ago[fast-isel] Add support for FPToUI. Also add test cases for FPToSI.
Chad Rosier [Fri, 3 Feb 2012 20:27:51 +0000 (20:27 +0000)]
[fast-isel] Add support for FPToUI.  Also add test cases for FPToSI.

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

12 years agoInitialize all common codegen passes before configuration so we can use their PassIDs.
Andrew Trick [Fri, 3 Feb 2012 20:14:47 +0000 (20:14 +0000)]
Initialize all common codegen passes before configuration so we can use their PassIDs.

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

12 years ago[fast-isel] Add support for selecting UIToFP.
Chad Rosier [Fri, 3 Feb 2012 19:42:52 +0000 (19:42 +0000)]
[fast-isel] Add support for selecting UIToFP.

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

12 years agoSimplify some GEP checks in the verifier.
Duncan Sands [Fri, 3 Feb 2012 17:28:51 +0000 (17:28 +0000)]
Simplify some GEP checks in the verifier.

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

12 years agoThe type-legalizer often scalarizes code. One of the common patterns is extract-and...
Nadav Rotem [Fri, 3 Feb 2012 13:18:25 +0000 (13:18 +0000)]
The type-legalizer often scalarizes code. One of the common patterns is extract-and-truncate.
In this patch we optimize this pattern and convert the sequence into extract op of a narrow type.
This allows the BUILD_VECTOR dag optimizations to construct efficient shuffle operations in many cases.

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

12 years agoRemove getShuffleVPERMILPImmediate function, getShuffleSHUFImmediate performs the...
Craig Topper [Fri, 3 Feb 2012 06:52:33 +0000 (06:52 +0000)]
Remove getShuffleVPERMILPImmediate function, getShuffleSHUFImmediate performs the same calculation.

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

12 years agoAllow command-line overrides of the target triple with the Mach-O
Cameron Zwarich [Fri, 3 Feb 2012 06:35:22 +0000 (06:35 +0000)]
Allow command-line overrides of the target triple with the Mach-O
disassembler, just like the generic disassembler.

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

12 years agoRemove unnecessary qualification on 256-bit vector handling in LowerBUILD_VECTOR...
Craig Topper [Fri, 3 Feb 2012 06:32:21 +0000 (06:32 +0000)]
Remove unnecessary qualification on 256-bit vector handling in LowerBUILD_VECTOR. Condition was already guaranteed by earlier code.

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

12 years agoAdd auto upgrade support for x86 pcmpgt/pcmpeq intrinics removed in r149367.
Craig Topper [Fri, 3 Feb 2012 06:10:55 +0000 (06:10 +0000)]
Add auto upgrade support for x86 pcmpgt/pcmpeq intrinics removed in r149367.

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

12 years agoDo the same fix as r149667, but for the Mach-O disassembler.
Cameron Zwarich [Fri, 3 Feb 2012 05:42:17 +0000 (05:42 +0000)]
Do the same fix as r149667, but for the Mach-O disassembler.

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

12 years agoAdded TargetPassConfig. The first little step toward configuring codegen passes.
Andrew Trick [Fri, 3 Feb 2012 05:12:41 +0000 (05:12 +0000)]
Added TargetPassConfig. The first little step toward configuring codegen passes.

Allows command line overrides to be centralized in LLVMTargetMachine.cpp.
LLVMTargetMachine can intercept common passes and give precedence to command line overrides.
Allows adding "internal" target configuration options without touching TargetOptions.
Encapsulates the PassManager.
Provides a good point to initialize all CodeGen passes so that Pass ID's can be used in APIs.
Allows modifying the target configuration hooks without rebuilding the world.

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

12 years agowhitespace
Andrew Trick [Fri, 3 Feb 2012 05:12:30 +0000 (05:12 +0000)]
whitespace

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

12 years agoAdd a new MachineJumpTableInfo entry type, EK_GPRel64BlockAddress, which is
Akira Hatanaka [Fri, 3 Feb 2012 04:33:00 +0000 (04:33 +0000)]
Add a new MachineJumpTableInfo entry type, EK_GPRel64BlockAddress, which is
needed to emit a 64-bit gp-relative relocation entry. Make changes necessary
for emitting jump tables which have entries with directive .gpdword. This patch
does not implement the parts needed for direct object emission or JIT.

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

12 years agoFix llvm-objdump disassembly for interesting Mach-O binaries, e.g. any MacOS
Cameron Zwarich [Fri, 3 Feb 2012 04:13:37 +0000 (04:13 +0000)]
Fix llvm-objdump disassembly for interesting Mach-O binaries, e.g. any MacOS
dylib. This regressed with r145408. I will try to make a test case and add it
so that this doesn't happen again.

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

12 years agoIncorporate suggestions Chad, Jakob and Evan's suggestions on r149957.
Lang Hames [Fri, 3 Feb 2012 01:13:49 +0000 (01:13 +0000)]
Incorporate suggestions Chad, Jakob and Evan's suggestions on r149957.

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

12 years agoFix SSAUpdaterImpl's RecordMatchingPHI to record exactly the
Dan Gohman [Fri, 3 Feb 2012 01:07:01 +0000 (01:07 +0000)]
Fix SSAUpdaterImpl's RecordMatchingPHI to record exactly the
PHI nodes which were matched, rather than climbing up the
original PHI node's operands to rediscover PHI nodes for
recording, since the PHI nodes found that are not
necessarily part of the matched set.
This fixes rdar://10589171.

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

12 years agoReplace the old --with-cxx-* configure options with a single --with-gcc-toolchain
Rafael Espindola [Fri, 3 Feb 2012 00:59:30 +0000 (00:59 +0000)]
Replace the old --with-cxx-* configure options with a single --with-gcc-toolchain
that just uses the new toolchain probing logic. This fixes linking with -m32 on
64 bit systems (the /32 dir was not being added to the search).

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

12 years agoNarrow test further. Make bot and test happy.
Jim Grosbach [Fri, 3 Feb 2012 00:26:07 +0000 (00:26 +0000)]
Narrow test further. Make bot and test happy.

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

12 years agoTidy up. Trailing whitespace.
Jim Grosbach [Fri, 3 Feb 2012 00:07:04 +0000 (00:07 +0000)]
Tidy up. Trailing whitespace.

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

12 years agoRestrict InstCombine from converting varargs to or from fixed args.
Jim Grosbach [Fri, 3 Feb 2012 00:00:55 +0000 (00:00 +0000)]
Restrict InstCombine from converting varargs to or from fixed args.

More targetted fix replacing d0e277d272d517ca1cda368267d199f0da7cad95.

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

12 years agoRevert "Disable InstCombine unsafe folding bitcasts of calls w/ varargs."
Jim Grosbach [Fri, 3 Feb 2012 00:00:50 +0000 (00:00 +0000)]
Revert "Disable InstCombine unsafe folding bitcasts of calls w/ varargs."

This reverts commit d0e277d272d517ca1cda368267d199f0da7cad95.

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

12 years agoRequire non-NULL register masks.
Jakob Stoklund Olesen [Thu, 2 Feb 2012 23:52:57 +0000 (23:52 +0000)]
Require non-NULL register masks.

It doesn't seem worthwhile to give meaning to a NULL register mask
pointer. It complicates all the code using register mask operands.

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

12 years agobuild/make: Ensure make clean removes the LLVMBuild makefile fragment.
Daniel Dunbar [Thu, 2 Feb 2012 23:27:34 +0000 (23:27 +0000)]
build/make: Ensure make clean removes the LLVMBuild makefile fragment.

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

12 years agobuild/Make: Add missing dependency, LLVMBuild makefile fragment implicitly depends...
Daniel Dunbar [Thu, 2 Feb 2012 23:27:32 +0000 (23:27 +0000)]
build/Make: Add missing dependency, LLVMBuild makefile fragment implicitly depends on Makefile.config.

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

12 years agoAdd pseudo-registers for pairs, triples, and quads of D registers.
Jakob Stoklund Olesen [Thu, 2 Feb 2012 22:45:32 +0000 (22:45 +0000)]
Add pseudo-registers for pairs, triples, and quads of D registers.

NEON loads and stores accept single and double spaced pairs, triples,
and quads of D registers.  This patch adds new register classes to
accurately model those constraints:

  Dn, Dn+1    Dn, Dn+2
  ----------------------
  DPair       DPairSpc
  DTriple     DTripleSpc
  DQuad       DQuadSpc

Also extend the existing QQ and QQQQ register classes to contains all Q
pairs and quads instead of just the aligned ones.

These new register classes will make it possible to accurately model
constraints on NEON loads and stores, and we can get rid of all the NEON
pseudo-instructions.  The late scheduler will be able to accurately
model instruction dependencies from the explicit operands.

This more than doubles the number of ARM registers, but the backend
passes are quite good at handling this. The llc -O0 compile time only
regresses by 1.5%.  Future work on register mask operands will recover
this regression.

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

12 years agoUnix line endings
Matt Beaumont-Gay [Thu, 2 Feb 2012 19:00:49 +0000 (19:00 +0000)]
Unix line endings

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

12 years agoBBVectorize: Simplify code, no functionality change.
Benjamin Kramer [Thu, 2 Feb 2012 18:52:15 +0000 (18:52 +0000)]
BBVectorize: Simplify code, no functionality change.

Also silences warnings about bodyless for loops.

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

12 years agoMinor changes from review.
Hal Finkel [Thu, 2 Feb 2012 17:29:39 +0000 (17:29 +0000)]
Minor changes from review.

As suggested by Nick Lewycky, the tree traversal queues have been changed to SmallVectors and the associated loops have been rotated. Also, an 80-col violation was fixed.

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

12 years agoMove test/CodeGen/Generic/2012-02-01-CoalescerBug.ll to CodeGen/ARM, for now. It...
NAKAMURA Takumi [Thu, 2 Feb 2012 11:44:58 +0000 (11:44 +0000)]
Move test/CodeGen/Generic/2012-02-01-CoalescerBug.ll to CodeGen/ARM, for now. It requires TARGETS=arm.

I cannot reproduce a fixed issue with other targets.

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

12 years agoMinor change in signature of the getZeroVector()
Elena Demikhovsky [Thu, 2 Feb 2012 09:20:18 +0000 (09:20 +0000)]
Minor change in signature of the getZeroVector()

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

12 years agoOptimization for SIGN_EXTEND operation on AVX.
Elena Demikhovsky [Thu, 2 Feb 2012 09:10:43 +0000 (09:10 +0000)]
Optimization for SIGN_EXTEND operation on AVX.
Special handling was added for v4i32 -> v4i64 and v8i16 -> v8i32
extensions.

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

12 years agoUnbreak the MSVC build.
Francois Pichet [Thu, 2 Feb 2012 08:36:09 +0000 (08:36 +0000)]
Unbreak the MSVC build.

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

12 years agoRe-apply the coalescer fix from r149147. Commit r149597 should have fixed the llvm...
Lang Hames [Thu, 2 Feb 2012 08:01:53 +0000 (08:01 +0000)]
Re-apply the coalescer fix from r149147. Commit r149597 should have fixed the llvm-gcc and clang self-host issues.

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

12 years agoSet EFLAGS correctly in EmitLoweredSelect on X86.
Lang Hames [Thu, 2 Feb 2012 07:48:37 +0000 (07:48 +0000)]
Set EFLAGS correctly in EmitLoweredSelect on X86.

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

12 years agoBreak as soon as the MustMapCurValNos flag is set - no need to reiterate.
Lang Hames [Thu, 2 Feb 2012 06:55:45 +0000 (06:55 +0000)]
Break as soon as the MustMapCurValNos flag is set - no need to reiterate.

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

12 years agoVectorize long blocks in groups.
Hal Finkel [Thu, 2 Feb 2012 06:14:56 +0000 (06:14 +0000)]
Vectorize long blocks in groups.

Long basic blocks with many candidate pairs (such as in the SHA implementation in Perl 5.14; thanks to Roman Divacky for the example) used to take an unacceptably-long time to compile. Instead, break long blocks into groups so that no group has too many candidate pairs.

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

12 years agoPR11868. The previous loop in LiveIntervals::join would sometimes fall over if
Lang Hames [Thu, 2 Feb 2012 05:37:34 +0000 (05:37 +0000)]
PR11868. The previous loop in LiveIntervals::join would sometimes fall over if
more than two adjacent ranges needed to be merged. The new version should be
able to handle an arbitrary sequence of adjancent ranges.

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

12 years agoSet the correct stack pointer register.
Akira Hatanaka [Thu, 2 Feb 2012 03:17:04 +0000 (03:17 +0000)]
Set the correct stack pointer register.

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

12 years agoExpand EHSELECTION and EHSELECTION nodes. Set the correct exception pointer and
Akira Hatanaka [Thu, 2 Feb 2012 03:13:40 +0000 (03:13 +0000)]
Expand EHSELECTION and EHSELECTION nodes. Set the correct exception pointer and
selector registers.

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

12 years agoAdd DWARF numbers of 64-bit registers.
Akira Hatanaka [Thu, 2 Feb 2012 02:56:14 +0000 (02:56 +0000)]
Add DWARF numbers of 64-bit registers.

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

12 years agoRegen one last time.
Eric Christopher [Thu, 2 Feb 2012 01:11:30 +0000 (01:11 +0000)]
Regen one last time.

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

12 years agoautoconf: fix build/src dir confusion
Dylan Noblesmith [Thu, 2 Feb 2012 00:54:18 +0000 (00:54 +0000)]
autoconf: fix build/src dir confusion

This was the cause of the silent failure to generate
clang's config.h. My bad.

Fix on r149563 / r149568.

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

12 years agoRegenerate again.
Eric Christopher [Thu, 2 Feb 2012 00:19:05 +0000 (00:19 +0000)]
Regenerate again.

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

12 years agoautoconf: restore old clang-srcdir behavior
Dylan Noblesmith [Thu, 2 Feb 2012 00:17:33 +0000 (00:17 +0000)]
autoconf: restore old clang-srcdir behavior

Keep the string empty when unspecified. Undoes
part of r149563.

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

12 years agoRegenerate configure.
Eric Christopher [Thu, 2 Feb 2012 00:16:55 +0000 (00:16 +0000)]
Regenerate configure.

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

12 years agoautoconf: honor --with-clang-srcdir
Dylan Noblesmith [Thu, 2 Feb 2012 00:11:14 +0000 (00:11 +0000)]
autoconf: honor --with-clang-srcdir

configure was silently failing to produce anything in the case
where clang wasn't at tools/clang/, resulting in compilation
errors much later in the build when config.h didn't exist.

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

12 years agoTypo
Pete Cooper [Wed, 1 Feb 2012 23:43:12 +0000 (23:43 +0000)]
Typo

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

12 years agoFix the cmake build
Rafael Espindola [Wed, 1 Feb 2012 23:40:51 +0000 (23:40 +0000)]
Fix the cmake build

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

12 years agoInstruction scheduling itinerary for Intel Atom.
Andrew Trick [Wed, 1 Feb 2012 23:20:51 +0000 (23:20 +0000)]
Instruction scheduling itinerary for Intel Atom.

Adds an instruction itinerary to all x86 instructions, giving each a default latency of 1, using the InstrItinClass IIC_DEFAULT.

Sets specific latencies for Atom for the instructions in files X86InstrCMovSetCC.td, X86InstrArithmetic.td, X86InstrControl.td, and X86InstrShiftRotate.td. The Atom latencies for the remainder of the x86 instructions will be set in subsequent patches.

Adds a test to verify that the scheduler is working.

Also changes the scheduling preference to "Hybrid" for i386 Atom, while leaving x86_64 as ILP.

Patch by Preston Gurd!

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

12 years agoMove ARM subreg index compositions to the SubRegIndex itself.
Jakob Stoklund Olesen [Wed, 1 Feb 2012 23:16:43 +0000 (23:16 +0000)]
Move ARM subreg index compositions to the SubRegIndex itself.

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

12 years agoSpecify SubRegIndex components on the index itself.
Jakob Stoklund Olesen [Wed, 1 Feb 2012 23:16:41 +0000 (23:16 +0000)]
Specify SubRegIndex components on the index itself.

It is simpler to define a composite index directly:

  def ssub_2 : SubRegIndex<[dsub_1, ssub_0]>;
  def ssub_3 : SubRegIndex<[dsub_1, ssub_1]>;

Than specifying the composite indices on each register:

  CompositeIndices = [(ssub_2 dsub_1, ssub_0),
                      (ssub_3 dsub_1, ssub_1)] in ...

This also makes it clear that SubRegIndex composition is supposed to be
unique.

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

12 years agofix cmake
Andrew Trick [Wed, 1 Feb 2012 22:28:29 +0000 (22:28 +0000)]
fix cmake

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

12 years agoFix a bug in the TopoOrderRC comparison function.
Jakob Stoklund Olesen [Wed, 1 Feb 2012 22:19:26 +0000 (22:19 +0000)]
Fix a bug in the TopoOrderRC comparison function.

The final tie breaker comparison also needs to return +/-1, or 0.
This is not a less() function.

This could cause otherwise identical super-classes to be ordered
unstably, depending on what the system qsort routine does with a bad
compare function.

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

12 years agoAvoid creating an extract element to an illegal type after LegalizeTypes has run.
Mon P Wang [Wed, 1 Feb 2012 22:15:20 +0000 (22:15 +0000)]
Avoid creating an extract element to an illegal type after LegalizeTypes has run.

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

12 years agoVLIW specific scheduler framework that utilizes deterministic finite automaton (DFA).
Andrew Trick [Wed, 1 Feb 2012 22:13:57 +0000 (22:13 +0000)]
VLIW specific scheduler framework that utilizes deterministic finite automaton (DFA).

This new scheduler plugs into the existing selection DAG scheduling framework. It is a top-down critical path scheduler that tracks register pressure and uses a DFA for pipeline modeling.

Patch by Sergei Larin!

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

12 years agoAvoid emitting empty arrays, they're not standard C++.
Jakob Stoklund Olesen [Wed, 1 Feb 2012 22:12:51 +0000 (22:12 +0000)]
Avoid emitting empty arrays, they're not standard C++.

It's only by luck that we haven't produced any yet, and clang refuses to
compile them.

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

12 years agoTidy up.
Chad Rosier [Wed, 1 Feb 2012 18:45:51 +0000 (18:45 +0000)]
Tidy up.

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

12 years agocmake: make BUILD_SHARED_LIBS a visible option
Dylan Noblesmith [Wed, 1 Feb 2012 14:49:39 +0000 (14:49 +0000)]
cmake: make BUILD_SHARED_LIBS a visible option

It could only be specified on the commandline, and wouldn't show
up as an option in the GUI or when invoked via `cmake -i` at all.

This also tells CMake that it's a BOOL, rather than "UNINITIALIZED".

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

12 years agotest/CodeGen/X86/avx-minmax.ll: Relax expressions for Win32 targets. YMM arguments...
NAKAMURA Takumi [Wed, 1 Feb 2012 14:35:29 +0000 (14:35 +0000)]
test/CodeGen/X86/avx-minmax.ll: Relax expressions for Win32 targets. YMM arguments are passed as indirect on Win32 x64.

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

12 years agoautoconf: generate clang's private config.h header
Dylan Noblesmith [Wed, 1 Feb 2012 14:06:21 +0000 (14:06 +0000)]
autoconf: generate clang's private config.h header

The CMake build already generated one. Follows clang r149497.

This brings us one step closer to compiling and configuring clang
separately from LLVM using the autoconf build, too.

(I lack the right version of autoconf et al. to regen, but it
was a simple change, so I just updated configure manually.)

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

12 years agoPassing AVX 256-bit structures in Win64 was wrong.
Elena Demikhovsky [Wed, 1 Feb 2012 10:46:14 +0000 (10:46 +0000)]
Passing AVX 256-bit structures in Win64 was wrong.
Fixed Win64 calling conventions.

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

12 years agoShortened code in shuffle masks
Elena Demikhovsky [Wed, 1 Feb 2012 10:33:05 +0000 (10:33 +0000)]
Shortened code in shuffle masks

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

12 years agoOptimization for "truncate" operation on AVX.
Elena Demikhovsky [Wed, 1 Feb 2012 07:56:44 +0000 (07:56 +0000)]
Optimization for "truncate" operation on AVX.
Truncating v4i64 -> v4i32 and v8i32 -> v8i16 may be done with set of shuffles.

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

12 years agoSwitchInst refactoring.
Stepan Dyatkovskiy [Wed, 1 Feb 2012 07:49:51 +0000 (07:49 +0000)]
SwitchInst refactoring.
The purpose of refactoring is to hide operand roles from SwitchInst user (programmer). If you want to play with operands directly, probably you will need lower level methods than SwitchInst ones (TerminatorInst or may be User). After this patch we can reorganize SwitchInst operands and successors as we want.

What was done:

1. Changed semantics of index inside the getCaseValue method:
getCaseValue(0) means "get first case", not a condition. Use getCondition() if you want to resolve the condition. I propose don't mix SwitchInst case indexing with low level indexing (TI successors indexing, User's operands indexing), since it may be dangerous.
2. By the same reason findCaseValue(ConstantInt*) returns actual number of case value. 0 means first case, not default. If there is no case with given value, ErrorIndex will returned.
3. Added getCaseSuccessor method. I propose to avoid usage of TerminatorInst::getSuccessor if you want to resolve case successor BB. Use getCaseSuccessor instead, since internal SwitchInst organization of operands/successors is hidden and may be changed in any moment.
4. Added resolveSuccessorIndex and resolveCaseIndex. The main purpose of these methods is to see how case successors are really mapped in TerminatorInst.
4.1 "resolveSuccessorIndex" was created if you need to level down from SwitchInst to TerminatorInst. It returns TerminatorInst's successor index for given case successor.
4.2 "resolveCaseIndex" converts low level successors index to case index that curresponds to the given successor.

Note: There are also related compatability fix patches for dragonegg, klee, llvm-gcc-4.0, llvm-gcc-4.2, safecode, clang.

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

12 years agoAdd pass printer passes in the right place.
Andrew Trick [Wed, 1 Feb 2012 07:16:20 +0000 (07:16 +0000)]
Add pass printer passes in the right place.

The pass pointer should never be referenced after sending it to
schedulePass(), which may delete the pass. To fix this bug I had to
clean up the design leading to more goodness.

You may notice now that any non-analysis pass is printed. So things like loop-simplify and lcssa show up, while target lib, target data, alias analysis do not show up. Normally, analysis don't mutate the IR, but you can now check this by using both -print-after and -print-before. The effects of analysis will now show up in between the two.

The llc path is still in bad shape. But I'll be improving it in my next checkin. Meanwhile, print-machineinstrs still works the same way. With print-before/after, many llc passes that were not printed before now are, some of these should be converted to analysis. A few very important passes, isel and scheduler, are not properly initialized, so not printed.

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

12 years agowhitespace
Andrew Trick [Wed, 1 Feb 2012 07:16:17 +0000 (07:16 +0000)]
whitespace

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