oota-llvm.git
13 years agoAdd an assert (which should never trigger) that triggers on a testcase I'm looking at.
Eli Friedman [Wed, 13 Jul 2011 00:44:29 +0000 (00:44 +0000)]
Add an assert (which should never trigger) that triggers on a testcase I'm looking at.

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

13 years agoImprove codegen for select's:
Evan Cheng [Wed, 13 Jul 2011 00:42:17 +0000 (00:42 +0000)]
Improve codegen for select's:
if (x != 0) x = 1
if (x == 1) x = 1

Previous codegen looks like this:
        mov     r1, r0
        cmp     r1, #1
        mov     r0, #0
        moveq   r0, #1

The naive lowering select between two different values. It should recognize the
test is equality test so it's more a conditional move rather than a select:
        cmp     r0, #1
        movne   r0, #0

rdar://9758317

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

13 years agoAssign variable before we test it.
Bill Wendling [Wed, 13 Jul 2011 00:23:39 +0000 (00:23 +0000)]
Assign variable before we test it.

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

13 years agoFix obvious think-o.
Bill Wendling [Wed, 13 Jul 2011 00:20:09 +0000 (00:20 +0000)]
Fix obvious think-o.

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

13 years agoClean up the handling of an EBP/RBP unwind frame pointer. In particular, don't
Bill Wendling [Wed, 13 Jul 2011 00:16:14 +0000 (00:16 +0000)]
Clean up the handling of an EBP/RBP unwind frame pointer. In particular, don't
assert when the frame pointer is -1 (i.e., the function is "frameless").

Still to do: "frameless" unwind information.

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

13 years agoThere is a cyclic dependency between MC and Target if this method is out-of-line.
Bill Wendling [Tue, 12 Jul 2011 22:35:01 +0000 (22:35 +0000)]
There is a cyclic dependency between MC and Target if this method is out-of-line.

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

13 years agoRemove the const from Type after of Jay deconstify work.
Francois Pichet [Tue, 12 Jul 2011 22:04:11 +0000 (22:04 +0000)]
Remove the const from Type after of Jay deconstify work.

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

13 years agoDelete StructType bodies when destroying a StructType.
Benjamin Kramer [Tue, 12 Jul 2011 18:22:07 +0000 (18:22 +0000)]
Delete StructType bodies when destroying a StructType.

Leak found by valgrind.

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

13 years agoAdd check for predicate w/o S bit.
Jim Grosbach [Tue, 12 Jul 2011 16:25:04 +0000 (16:25 +0000)]
Add check for predicate w/o S bit.

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

13 years agoImprove test cases from r134746.
Jim Grosbach [Tue, 12 Jul 2011 16:06:01 +0000 (16:06 +0000)]
Improve test cases from r134746.

Use memory barriers to force if-conversion off for these tests instead of
the internal llc command line option ifcvt-limit.

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

13 years agoReverted 134901 because of 134959. Did not use svn merge -r but rather:
Garrison Venn [Tue, 12 Jul 2011 15:34:42 +0000 (15:34 +0000)]
Reverted 134901 because of 134959. Did not use svn merge -r but rather:

1,$s/llvm::Type::getInt\(..\)Ty(builder.getContext())/builder.getInt\1Ty()/g
1,$s/builder.getInt\(..*\)Ty()->getPointerTo()/builder.getInt\1PtrTy()/g

vi sub commands (second one was not a reversion but requested by
Tobias Grosser.

Mod was tested, but other examples have failed to build as they are currently
being thrashed with the const qualifier removal change.

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

13 years agoSecond attempt at de-constifying LLVM Types in FunctionType::get(),
Jay Foad [Tue, 12 Jul 2011 14:06:48 +0000 (14:06 +0000)]
Second attempt at de-constifying LLVM Types in FunctionType::get(),
StructType::get() and TargetData::getIntPtrType().

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

13 years agoVectorType is also a SequentialType
Tobias Grosser [Tue, 12 Jul 2011 11:37:02 +0000 (11:37 +0000)]
VectorType is also a SequentialType

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

13 years agoRemove IntegerType constness from TargetData
Tobias Grosser [Tue, 12 Jul 2011 11:36:58 +0000 (11:36 +0000)]
Remove IntegerType constness from TargetData

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

13 years agoFix the BrainF build.
Francois Pichet [Tue, 12 Jul 2011 08:43:36 +0000 (08:43 +0000)]
Fix the BrainF build.

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

13 years agosimplify assertions to not be completely redundant.
Chris Lattner [Tue, 12 Jul 2011 05:26:21 +0000 (05:26 +0000)]
simplify assertions to not be completely redundant.

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

13 years agomake the IRBuilder type methods return non-const types.
Chris Lattner [Tue, 12 Jul 2011 04:14:22 +0000 (04:14 +0000)]
make the IRBuilder type methods return non-const types.

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

13 years agoComment correction.
Andrew Trick [Tue, 12 Jul 2011 03:39:22 +0000 (03:39 +0000)]
Comment correction.

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

13 years agoRevert r134893 and r134888 (and related patches in other trees). It was causing
Bill Wendling [Tue, 12 Jul 2011 01:15:52 +0000 (01:15 +0000)]
Revert r134893 and r134888 (and related patches in other trees). It was causing
an assert on Darwin llvm-gcc builds.

Assertion failed: (castIsValid(op, S, Ty) && "Invalid cast!"), function Create, file /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.llvm-gcc-i386-darwin9-RA/llvm.src/lib/VMCore/Instructions.cpp, li\
ne 2067.
etc.

http://smooshlab.apple.com:8013/builders/llvm-gcc-i386-darwin9-RA/builds/2354

--- Reverse-merging r134893 into '.':
U    include/llvm/Target/TargetData.h
U    include/llvm/DerivedTypes.h
U    tools/bugpoint/ExtractFunction.cpp
U    unittests/Support/TypeBuilderTest.cpp
U    lib/Target/ARM/ARMGlobalMerge.cpp
U    lib/Target/TargetData.cpp
U    lib/VMCore/Constants.cpp
U    lib/VMCore/Type.cpp
U    lib/VMCore/Core.cpp
U    lib/Transforms/Utils/CodeExtractor.cpp
U    lib/Transforms/Instrumentation/ProfilingUtils.cpp
U    lib/Transforms/IPO/DeadArgumentElimination.cpp
U    lib/CodeGen/SjLjEHPrepare.cpp
--- Reverse-merging r134888 into '.':
G    include/llvm/DerivedTypes.h
U    include/llvm/Support/TypeBuilder.h
U    include/llvm/Intrinsics.h
U    unittests/Analysis/ScalarEvolutionTest.cpp
U    unittests/ExecutionEngine/JIT/JITTest.cpp
U    unittests/ExecutionEngine/JIT/JITMemoryManagerTest.cpp
U    unittests/VMCore/PassManagerTest.cpp
G    unittests/Support/TypeBuilderTest.cpp
U    lib/Target/MBlaze/MBlazeIntrinsicInfo.cpp
U    lib/Target/Blackfin/BlackfinIntrinsicInfo.cpp
U    lib/VMCore/IRBuilder.cpp
G    lib/VMCore/Type.cpp
U    lib/VMCore/Function.cpp
G    lib/VMCore/Core.cpp
U    lib/VMCore/Module.cpp
U    lib/AsmParser/LLParser.cpp
U    lib/Transforms/Utils/CloneFunction.cpp
G    lib/Transforms/Utils/CodeExtractor.cpp
U    lib/Transforms/Utils/InlineFunction.cpp
U    lib/Transforms/Instrumentation/GCOVProfiling.cpp
U    lib/Transforms/Scalar/ObjCARC.cpp
U    lib/Transforms/Scalar/SimplifyLibCalls.cpp
U    lib/Transforms/Scalar/MemCpyOptimizer.cpp
G    lib/Transforms/IPO/DeadArgumentElimination.cpp
U    lib/Transforms/IPO/ArgumentPromotion.cpp
U    lib/Transforms/InstCombine/InstCombineCompares.cpp
U    lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
U    lib/Transforms/InstCombine/InstCombineCalls.cpp
U    lib/CodeGen/DwarfEHPrepare.cpp
U    lib/CodeGen/IntrinsicLowering.cpp
U    lib/Bitcode/Reader/BitcodeReader.cpp

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

13 years agoTypeMap had a destructor that destroyed the types it held. DenseMap did not, so
Nick Lewycky [Tue, 12 Jul 2011 00:26:08 +0000 (00:26 +0000)]
TypeMap had a destructor that destroyed the types it held. DenseMap did not, so
destroy those types in ~LLVMContext.

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

13 years agoindvars: Code reorganization in preparation for
Andrew Trick [Tue, 12 Jul 2011 00:08:50 +0000 (00:08 +0000)]
indvars: Code reorganization in preparation for
LinearFunctionTestReplace rewrite. No functionality.

I've been wanting to group the indvar subphases into sections and
order them by their logical sequence. My next checkin adds functions
related to LFTR, and doing the reorg now should help reviewers. Since,
most of the code in IndVarSimplify.cpp has recently been replaced or
will be replaced soon, obscuring blame should not be an issue. This
seems like an ideal time to shuffle the code around.

I'm happy to take more suggestions for cleaning up the code. Or if
you've been wanting to cleanup anything in this file yourself, now is
a good time.

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

13 years agoRevert r134921, 134917, 134908 and 134907. They're causing failures
Eric Christopher [Mon, 11 Jul 2011 23:06:52 +0000 (23:06 +0000)]
Revert r134921, 134917, 134908 and 134907. They're causing failures
in multiple buildbots.

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

13 years agofix some examples
John Wiegley [Mon, 11 Jul 2011 22:39:46 +0000 (22:39 +0000)]
fix some examples

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

13 years agoFix LTO after the recent MC subtarget refactoring.
Cameron Zwarich [Mon, 11 Jul 2011 22:19:51 +0000 (22:19 +0000)]
Fix LTO after the recent MC subtarget refactoring.

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

13 years agoMost MCCodeEmitter's don't meed MCContext.
Evan Cheng [Mon, 11 Jul 2011 21:24:15 +0000 (21:24 +0000)]
Most MCCodeEmitter's don't meed MCContext.

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

13 years agoUse get(0 Instead of Create()
David Greene [Mon, 11 Jul 2011 20:55:22 +0000 (20:55 +0000)]
Use get(0 Instead of Create()

Respond to some feedback asking for a name change.

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

13 years agoDisassembler doesn't need TargetMachine anymore.
Evan Cheng [Mon, 11 Jul 2011 20:40:56 +0000 (20:40 +0000)]
Disassembler doesn't need TargetMachine anymore.

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

13 years agostruct Init -> class Init.
Evan Cheng [Mon, 11 Jul 2011 20:23:13 +0000 (20:23 +0000)]
struct Init -> class Init.

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

13 years agoFix Build
David Greene [Mon, 11 Jul 2011 18:59:29 +0000 (18:59 +0000)]
Fix Build

Update the tag for Init to match how it's defined.

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

13 years ago[AVX] Make Inits Foldable
David Greene [Mon, 11 Jul 2011 18:25:51 +0000 (18:25 +0000)]
[AVX] Make Inits Foldable

Manage Inits in a FoldingSet.  This provides several benefits:

- Memory for Inits is properly managed

- Duplicate Inits are folded into Flyweights, saving memory

- It enforces const-correctness, protecting against certain classes
  of bugs

The above benefits allow Inits to be used in more contexts, which in
turn provides more dynamism to TableGen.  This enhanced capability
will be used by the AVX code generator to a fold common patterns
together.

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

13 years agoResynchronize EDInfo.h and EDEmitter.cpp.
Shantonu Sen [Mon, 11 Jul 2011 17:57:30 +0000 (17:57 +0000)]
Resynchronize EDInfo.h and EDEmitter.cpp.
The enum names as well as order (i.e. value)
had skewed, which means that consumers of the
tablegen-ed table would see different values than
intended. Make both files have a superset of enums,
and add classification as needed for numMCOperands.

Reviewed by Owen Anderson

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

13 years agoFix recognition of ARM 'adcs' mnemonic.
Jim Grosbach [Mon, 11 Jul 2011 17:09:57 +0000 (17:09 +0000)]
Fix recognition of ARM 'adcs' mnemonic.

The 'CS' is not a predication suffix in this case.

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

13 years agoSimplify printing of ARM shifted immediates.
Jim Grosbach [Mon, 11 Jul 2011 16:48:36 +0000 (16:48 +0000)]
Simplify printing of ARM shifted immediates.

Print shifted immediate values directly rather than as a payload+shifter
value pair. This makes for more readable output assembly code, simplifies
the instruction printer, and is consistent with how Thumb immediates are
 displayed.

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

13 years agoModified demo to work with non const Type parameters as is required by new
Garrison Venn [Mon, 11 Jul 2011 16:31:53 +0000 (16:31 +0000)]
Modified demo to work with non const Type parameters as is required by new
type system. However most of these modifications were due to IRBuilder
(IRBuilderBase), not having been modified to NOT return such const qualified
free types. If IRBuilder does not change, as can also be seen in its
instruction creation methods, to use const free types, it may be useful to have
ExceptionDemo drop IRBuilder usage. Modifying builder.getInt32Ty() to
llvm::Type::getInt32Ty(builder.getContext()) is pretty ugly.

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

13 years agotest/CodeGen/PowerPC/vector.ll: Tweak redirection >%t >%t to >%t >>%t. See also r1348...
NAKAMURA Takumi [Mon, 11 Jul 2011 16:21:52 +0000 (16:21 +0000)]
test/CodeGen/PowerPC/vector.ll: Tweak redirection >%t >%t to >%t >>%t. See also r134814 (test/CodeGen/X86/vector.ll).

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

13 years agoDe-constify Types in StructType::get() and TargetData::getIntPtrType().
Jay Foad [Mon, 11 Jul 2011 09:56:20 +0000 (09:56 +0000)]
De-constify Types in StructType::get() and TargetData::getIntPtrType().

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

13 years agoAdd a missing test for r134882.
Cameron Zwarich [Mon, 11 Jul 2011 08:35:17 +0000 (08:35 +0000)]
Add a missing test for r134882.

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

13 years agoDe-constify Types in FunctionType::get().
Jay Foad [Mon, 11 Jul 2011 07:56:41 +0000 (07:56 +0000)]
De-constify Types in FunctionType::get().

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

13 years agoRemove mentions of type planes.
Jay Foad [Mon, 11 Jul 2011 07:28:49 +0000 (07:28 +0000)]
Remove mentions of type planes.

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

13 years ago- Eliminate MCCodeEmitter's dependency on TargetMachine. It now uses MCInstrInfo
Evan Cheng [Mon, 11 Jul 2011 03:57:24 +0000 (03:57 +0000)]
- Eliminate MCCodeEmitter's dependency on TargetMachine. It now uses MCInstrInfo
  and MCSubtargetInfo.
- Added methods to update subtarget features (used when targets automatically
  detect subtarget features or switch modes).
- Teach X86Subtarget to update MCSubtargetInfo features bits since the
  MCSubtargetInfo layer can be shared with other modules.
- These fixes .code 16 / .code 32 support since mode switch is updated in
  MCSubtargetInfo so MC code emitter can do the right thing.

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

13 years agoDon't duplicate the work done by a gep into a "bitcast" if the gep has
Rafael Espindola [Mon, 11 Jul 2011 03:43:47 +0000 (03:43 +0000)]
Don't duplicate the work done by a gep into a "bitcast" if the gep has
more than one use.

Fixes PR10322.

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

13 years agoFix <rdar://problem/9751331>.
Cameron Zwarich [Mon, 11 Jul 2011 01:29:42 +0000 (01:29 +0000)]
Fix <rdar://problem/9751331>.

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

13 years agoSilence -Wunused-variable in release builds.
Chandler Carruth [Sun, 10 Jul 2011 09:45:35 +0000 (09:45 +0000)]
Silence -Wunused-variable in release builds.

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

13 years agoMake the destructor virtual to silence GCC's -Wnon-virtual-dtor. Let me
Chandler Carruth [Sun, 10 Jul 2011 08:38:12 +0000 (08:38 +0000)]
Make the destructor virtual to silence GCC's -Wnon-virtual-dtor. Let me
know if there is some problem with this destructor being virtual...

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

13 years agoUse BranchProbability instead of floating points in IfConverter.
Jakub Staszak [Sun, 10 Jul 2011 02:58:07 +0000 (02:58 +0000)]
Use BranchProbability instead of floating points in IfConverter.

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

13 years ago- Make BranchProbability constructor public.
Jakub Staszak [Sun, 10 Jul 2011 02:12:39 +0000 (02:12 +0000)]
- Make BranchProbability constructor public.
- Add getCompl() method.

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

13 years agoDon't analyze block if it's not considered for ifcvt anymore.
Jakub Staszak [Sun, 10 Jul 2011 02:00:16 +0000 (02:00 +0000)]
Don't analyze block if it's not considered for ifcvt anymore.

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

13 years agofinish a thought.
Chris Lattner [Sun, 10 Jul 2011 00:29:18 +0000 (00:29 +0000)]
finish a thought.

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

13 years agoMove the loads after the calls so that the fix for
Rafael Espindola [Sat, 9 Jul 2011 23:53:58 +0000 (23:53 +0000)]
Move the loads after the calls so that the fix for
PR10292 doesn't show that the loads don't alias
the allocas.

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

13 years agoUse CHECK-NEXT.
Rafael Espindola [Sat, 9 Jul 2011 22:56:50 +0000 (22:56 +0000)]
Use CHECK-NEXT.

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

13 years agoRemove tests for APIs that were removed.
Nick Lewycky [Sat, 9 Jul 2011 18:55:51 +0000 (18:55 +0000)]
Remove tests for APIs that were removed.

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

13 years agoUpdate OCaml bindings. Opaque types are gone, type holders are gone and the
Nick Lewycky [Sat, 9 Jul 2011 18:29:33 +0000 (18:29 +0000)]
Update OCaml bindings. Opaque types are gone, type holders are gone and the
module operations that operate on type names are gone.

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

13 years agothe various ConstantExpr::get*Ty methods existed to work with issues around
Chris Lattner [Sat, 9 Jul 2011 18:23:52 +0000 (18:23 +0000)]
the various ConstantExpr::get*Ty methods existed to work with issues around
type refinement.  Zap them now that type refinement is toast.

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

13 years agodon't load element before checking to see if it is valid.
Chris Lattner [Sat, 9 Jul 2011 18:23:26 +0000 (18:23 +0000)]
don't load element before checking to see if it is valid.

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

13 years agoEliminate the WriteTypeSymbolic function. Now that types know
Chris Lattner [Sat, 9 Jul 2011 18:03:13 +0000 (18:03 +0000)]
Eliminate the WriteTypeSymbolic function.  Now that types know
their names, we don't need a module around to print them.

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

13 years agostop using WriteTypeSymbolic.
Chris Lattner [Sat, 9 Jul 2011 18:02:13 +0000 (18:02 +0000)]
stop using WriteTypeSymbolic.

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

13 years agoremove the DerivedType which isn't adding value anymore.
Chris Lattner [Sat, 9 Jul 2011 17:59:15 +0000 (17:59 +0000)]
remove the DerivedType which isn't adding value anymore.

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

13 years agoLand the long talked about "type system rewrite" patch. This
Chris Lattner [Sat, 9 Jul 2011 17:41:24 +0000 (17:41 +0000)]
Land the long talked about "type system rewrite" patch.  This
patch brings numerous advantages to LLVM.  One way to look at it
is through diffstat:
 109 files changed, 3005 insertions(+), 5906 deletions(-)

Removing almost 3K lines of code is a good thing.  Other advantages
include:

1. Value::getType() is a simple load that can be CSE'd, not a mutating
   union-find operation.
2. Types a uniqued and never move once created, defining away PATypeHolder.
3. Structs can be "named" now, and their name is part of the identity that
   uniques them.  This means that the compiler doesn't merge them structurally
   which makes the IR much less confusing.
4. Now that there is no way to get a cycle in a type graph without a named
   struct type, "upreferences" go away.
5. Type refinement is completely gone, which should make LTO much MUCH faster
   in some common cases with C++ code.
6. Types are now generally immutable, so we can use "Type *" instead
   "const Type *" everywhere.

Downsides of this patch are that it removes some functions from the C API,
so people using those will have to upgrade to (not yet added) new API.
"LLVM 3.0" is the right time to do this.

There are still some cleanups pending after this, this patch is large enough
as-is.

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

13 years agoadd a #include
Chris Lattner [Sat, 9 Jul 2011 17:00:38 +0000 (17:00 +0000)]
add a #include

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

13 years agofix a really bad bug that would cause nested cursors to break,
Chris Lattner [Sat, 9 Jul 2011 17:00:12 +0000 (17:00 +0000)]
fix a really bad bug that would cause nested cursors to break,
used by the new bitcode reader.

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

13 years agomore tests not making the jump into the brave new world.
Chris Lattner [Sat, 9 Jul 2011 16:57:10 +0000 (16:57 +0000)]
more tests not making the jump into the brave new world.

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

13 years agoremove some crufy old tests that aren't adding much value
Chris Lattner [Sat, 9 Jul 2011 16:55:16 +0000 (16:55 +0000)]
remove some crufy old tests that aren't adding much value

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

13 years agoremove a test that doesn't make sense in the new world.
Chris Lattner [Sat, 9 Jul 2011 16:52:42 +0000 (16:52 +0000)]
remove a test that doesn't make sense in the new world.

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

13 years agotest/CodeGen/X86/vector.ll: Tweak temporary output to appease Win32 hosts.
NAKAMURA Takumi [Sat, 9 Jul 2011 10:22:28 +0000 (10:22 +0000)]
test/CodeGen/X86/vector.ll: Tweak temporary output to appease Win32 hosts.

With Lit (not bash) in a test, multiple redirects >%t might open(%t, "w") multiple. It can be avoided if latter redirect is >>%t.

It might work even if ">/dev/null" were used.

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

13 years agoWindows/DynamicLibrary.inc: Fix trivial warnings. Thanks to John Myers!
NAKAMURA Takumi [Sat, 9 Jul 2011 08:41:20 +0000 (08:41 +0000)]
Windows/DynamicLibrary.inc: Fix trivial warnings. Thanks to John Myers!

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

13 years agolit/LitConfig.py: Demote Win32 message "Unable to find 'bash.exe'" from Warning to...
NAKAMURA Takumi [Sat, 9 Jul 2011 07:19:50 +0000 (07:19 +0000)]
lit/LitConfig.py: Demote Win32 message "Unable to find 'bash.exe'" from Warning to Note.

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

13 years agoRevert accidental commit.
Evan Cheng [Sat, 9 Jul 2011 06:26:27 +0000 (06:26 +0000)]
Revert accidental commit.

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

13 years agoChange createAsmParser to take a MCSubtargetInfo instead of triple,
Evan Cheng [Sat, 9 Jul 2011 05:47:46 +0000 (05:47 +0000)]
Change createAsmParser to take a MCSubtargetInfo instead of triple,
CPU, and feature string. Parsing some asm directives can change
subtarget state (e.g. .code 16) and it must be reflected in other
modules (e.g. MCCodeEmitter). That is, the MCSubtargetInfo instance
must be shared.

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

13 years agoOops, didn't mean to commit that.
Jakob Stoklund Olesen [Sat, 9 Jul 2011 01:02:44 +0000 (01:02 +0000)]
Oops, didn't mean to commit that.

Spills should be hoisted out of loops, but we don't want to hoist them
to dominating blocks at the same loop depth. That could cause the spills
to be executed more often.

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

13 years agoAdded test cases for GVN signed intrinsics recognition, r134777.
Lang Hames [Sat, 9 Jul 2011 00:36:54 +0000 (00:36 +0000)]
Added test cases for GVN signed intrinsics recognition, r134777.

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

13 years agoAdded recognition for signed add/sub/mul with overflow intrinsics to GVN as per Chris...
Lang Hames [Sat, 9 Jul 2011 00:25:11 +0000 (00:25 +0000)]
Added recognition for signed add/sub/mul with overflow intrinsics to GVN as per Chris and Frits suggestion.

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

13 years agoHoist spills within a basic block.
Jakob Stoklund Olesen [Sat, 9 Jul 2011 00:25:03 +0000 (00:25 +0000)]
Hoist spills within a basic block.

Try to move spills as early as possible in their basic block. This can
help eliminate interferences by shortening the live range being
spilled.

This fixes PR10221.

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

13 years agoReally force on 64bit for 64-bit targets. Should fix remaining failures on unknown...
Eli Friedman [Fri, 8 Jul 2011 23:43:01 +0000 (23:43 +0000)]
Really force on 64bit for 64-bit targets.  Should fix remaining failures on unknown x86/non-x86 targets.

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

13 years agoRevert earlier unnecessary hack. Make sure we correctly force on 64bit and cmov...
Eli Friedman [Fri, 8 Jul 2011 23:07:42 +0000 (23:07 +0000)]
Revert earlier unnecessary hack.  Make sure we correctly force on 64bit and cmov for 64-bit targets.

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

13 years agoFix indentation.
Evan Cheng [Fri, 8 Jul 2011 22:49:55 +0000 (22:49 +0000)]
Fix indentation.

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

13 years agoFix comment.
Evan Cheng [Fri, 8 Jul 2011 22:49:42 +0000 (22:49 +0000)]
Fix comment.

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

13 years agoAdd an fma TableGen node.
Cameron Zwarich [Fri, 8 Jul 2011 22:49:34 +0000 (22:49 +0000)]
Add an fma TableGen node.

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

13 years agoAdd support for ARM / Thumb mode switching with .code 16 and .code 32.
Evan Cheng [Fri, 8 Jul 2011 22:36:29 +0000 (22:36 +0000)]
Add support for ARM / Thumb mode switching with .code 16 and .code 32.

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

13 years agoUpdate comments for SandyBridge CPU identifiers.
Bob Wilson [Fri, 8 Jul 2011 22:33:59 +0000 (22:33 +0000)]
Update comments for SandyBridge CPU identifiers.

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

13 years agoMark tBRIND as predicable.
Jim Grosbach [Fri, 8 Jul 2011 22:33:49 +0000 (22:33 +0000)]
Mark tBRIND as predicable.

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

13 years agoRestore old behavior. Always auto-detect features unless cpu or features are specified.
Evan Cheng [Fri, 8 Jul 2011 22:30:25 +0000 (22:30 +0000)]
Restore old behavior. Always auto-detect features unless cpu or features are specified.

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

13 years agoFix broken x86_64 tests which specify non-64-bit cpu's.
Evan Cheng [Fri, 8 Jul 2011 22:29:33 +0000 (22:29 +0000)]
Fix broken x86_64 tests which specify non-64-bit cpu's.

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

13 years agoPseudo-ize tBRIND.
Jim Grosbach [Fri, 8 Jul 2011 22:25:23 +0000 (22:25 +0000)]
Pseudo-ize tBRIND.

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

13 years agoDefault 64-bit target features and SSE2 on when a triple specifies x86-64. Clean...
Eli Friedman [Fri, 8 Jul 2011 22:16:47 +0000 (22:16 +0000)]
Default 64-bit target features and SSE2 on when a triple specifies x86-64.  Clean up all the other hacks which are now unnecessary.

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

13 years agoUse add instead of accumulate.
Cameron Zwarich [Fri, 8 Jul 2011 22:13:55 +0000 (22:13 +0000)]
Use add instead of accumulate.

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

13 years agoRecognize Intel CPUs with Family=6 and Model=44.
Bob Wilson [Fri, 8 Jul 2011 22:09:35 +0000 (22:09 +0000)]
Recognize Intel CPUs with Family=6 and Model=44.
According to Intel Application Note 485, this value is used for
"Intel Core i7 and Intel Xeon processor".  Just include it with the other
"corei7-avx" entries.

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

13 years agoReapply a fixed version of r133285.
Bob Wilson [Fri, 8 Jul 2011 22:09:33 +0000 (22:09 +0000)]
Reapply a fixed version of r133285.
This tightens up checking for overflow in alloca sizes, based on feedback
from Duncan and John about the change in r132926.

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

13 years agoMake tBX_RET and tBX_RET_vararg predicable.
Jim Grosbach [Fri, 8 Jul 2011 21:50:04 +0000 (21:50 +0000)]
Make tBX_RET and tBX_RET_vararg predicable.

The normal tBX instruction is predicable, so there's no reason the
pseudos for using it as a return shouldn't be. Gives us some nice code-gen
improvements as can be seen by the test changes. In particular, several
tests now have to disable if-conversion because it works too well and defeats
the test.

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

13 years agoAdd _allrem, _aullrem and _allmul to the runtime for MSVC.
Julien Lerouge [Fri, 8 Jul 2011 21:40:25 +0000 (21:40 +0000)]
Add _allrem, _aullrem and _allmul to the runtime for MSVC.
http://llvm.org/bugs/show_bug.cgi?id=10305

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

13 years agoAdd an intrinsic and codegen support for fused multiply-accumulate. The intent
Cameron Zwarich [Fri, 8 Jul 2011 21:39:21 +0000 (21:39 +0000)]
Add an intrinsic and codegen support for fused multiply-accumulate. The intent
is to use this for architectures that have a native FMA instruction.

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

13 years agoFor non-x86 host, used generic as CPU name.
Evan Cheng [Fri, 8 Jul 2011 21:14:14 +0000 (21:14 +0000)]
For non-x86 host, used generic as CPU name.

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

13 years agoPseudo-ize tBX_RET and tBX_RET_vararg.
Jim Grosbach [Fri, 8 Jul 2011 21:10:35 +0000 (21:10 +0000)]
Pseudo-ize tBX_RET and tBX_RET_vararg.

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

13 years agoPlug a leak by giving the AsmParser ownership of the MCSubtargetInfo.
Benjamin Kramer [Fri, 8 Jul 2011 21:06:23 +0000 (21:06 +0000)]
Plug a leak by giving the AsmParser ownership of the MCSubtargetInfo.

Found by valgrind.

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

13 years agoShuffle productions around a bit.
Jim Grosbach [Fri, 8 Jul 2011 21:04:05 +0000 (21:04 +0000)]
Shuffle productions around a bit.

No functional change.

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

13 years agoBe more aggressive about following hints.
Jakob Stoklund Olesen [Fri, 8 Jul 2011 20:46:18 +0000 (20:46 +0000)]
Be more aggressive about following hints.

RAGreedy::tryAssign will now evict interference from the preferred
register even when another register is free.

To support this, add the EvictionCost struct that counts how many hints
are broken by an eviction. We don't want to break one hint just to
satisfy another.

Rename canEvict to shouldEvict, and add the first bit of eviction policy
that doesn't depend on spill weights: Always make room in the preferred
register as long as the evictees can be split and aren't already
assigned to their preferred register.

Also make the CSR avoidance more accurate. When looking for a cheaper
register it is OK to use a new volatile register. Only CSR aliases that
have never been used before should be avoided.

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

13 years agoUse tPseudoExpand for tTAILJMPrND and tTAILJMPr.
Jim Grosbach [Fri, 8 Jul 2011 20:39:19 +0000 (20:39 +0000)]
Use tPseudoExpand for tTAILJMPrND and tTAILJMPr.

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

13 years agoUse tPseudoExpand for tTAILJMPd and tTAILJMPdND.
Jim Grosbach [Fri, 8 Jul 2011 20:32:21 +0000 (20:32 +0000)]
Use tPseudoExpand for tTAILJMPd and tTAILJMPdND.

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

13 years agoSilence compiler warning.
Benjamin Kramer [Fri, 8 Jul 2011 20:18:13 +0000 (20:18 +0000)]
Silence compiler warning.

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

13 years agoAdd more info to FIXME.
Jim Grosbach [Fri, 8 Jul 2011 20:18:11 +0000 (20:18 +0000)]
Add more info to FIXME.

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

13 years agoMove Thumb tail call pseudos to Thumb.td file.
Jim Grosbach [Fri, 8 Jul 2011 20:13:35 +0000 (20:13 +0000)]
Move Thumb tail call pseudos to Thumb.td file.

Fix a FIXME.

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