oota-llvm.git
13 years agoPTX: Fix if-then-else formatting and add missing asserts
Justin Holewinski [Mon, 20 Jun 2011 17:08:56 +0000 (17:08 +0000)]
PTX: Fix if-then-else formatting and add missing asserts

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

13 years agoDisable again.
Rafael Espindola [Mon, 20 Jun 2011 17:04:08 +0000 (17:04 +0000)]
Disable again.

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

13 years agoPTX: Add basic register spilling code
Justin Holewinski [Mon, 20 Jun 2011 15:56:20 +0000 (15:56 +0000)]
PTX: Add basic register spilling code

The current implementation generates stack loads/stores, which are
really just mov instructions from/to "special" registers.  This may
not be the most efficient implementation, compared to an approach where
the stack registers are directly folded into instructions, but this is
easier to implement and I have yet to see a case where ptxas is unable
to see through this kind of register usage and know what is really
going on.

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

13 years agoDon't apply on PPC64 the 32bit ADDIC optimizations as there's no overflow
Roman Divacky [Mon, 20 Jun 2011 15:28:39 +0000 (15:28 +0000)]
Don't apply on PPC64 the 32bit ADDIC optimizations as there's no overflow
with 32bit values.

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

13 years agoThis is an automatically reduced test case that crashed in GVN, at some
Jay Foad [Mon, 20 Jun 2011 14:46:47 +0000 (14:46 +0000)]
This is an automatically reduced test case that crashed in GVN, at some
point during the development of the phi operand changes.

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

13 years agoChange how PHINodes store their operands.
Jay Foad [Mon, 20 Jun 2011 14:38:01 +0000 (14:38 +0000)]
Change how PHINodes store their operands.

Change PHINodes to store simple pointers to their incoming basic blocks,
instead of full-blown Uses.

Note that this loses an optimization in SplitCriticalEdge(), because we
can no longer walk the use list of a BasicBlock to find phi nodes. See
the comment I removed starting "However, the foreach loop is slow for
blocks with lots of predecessors".

Extend replaceAllUsesWith() on a BasicBlock to also update any phi
nodes in the block's successors. This mimics what would have happened
when PHINodes were proper Users of their incoming blocks. (Note that
this only works if OldBB->replaceAllUsesWith(NewBB) is called when
OldBB still has a terminator instruction, so it still has some
successors.)

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

13 years agoMake better use of the PHINode API.
Jay Foad [Mon, 20 Jun 2011 14:18:48 +0000 (14:18 +0000)]
Make better use of the PHINode API.

Change various bits of code to make better use of the existing PHINode
API, to insulate them from forthcoming changes in how PHINodes store
their operands.

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

13 years agoRemove the AugmentedUse struct.
Jay Foad [Mon, 20 Jun 2011 14:12:33 +0000 (14:12 +0000)]
Remove the AugmentedUse struct.

I don't think the AugmentedUse struct buys us much, either in
correctness or in ease of use. Ditch it, and simplify Use::getUser() and
User::allocHungoffUses().

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

13 years agoRe enable 133415 with two fixes
Rafael Espindola [Mon, 20 Jun 2011 14:11:42 +0000 (14:11 +0000)]
Re enable 133415 with two fixes
* Don't introduce a duplicated bb in the CFG
* When making a branch unconditional, clear the PredCond array so that it
  is really unconditional.

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

13 years agoDisable the logic added by rafael in commit 133415 to see if it brings the
Duncan Sands [Mon, 20 Jun 2011 09:26:23 +0000 (09:26 +0000)]
Disable the logic added by rafael in commit 133415 to see if it brings the
dragonegg buildbots back to life.  Original commit message:
Teach early dup how to duplicate basic blocks with one successor and only phi instructions
into more complex blocks.

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

13 years agoFix PromoteIntRes_TRUNCATE: Add support for cases where the
Nadav Rotem [Mon, 20 Jun 2011 07:15:58 +0000 (07:15 +0000)]
Fix PromoteIntRes_TRUNCATE: Add support for cases where the
source vector type is to be split while the target vector is to be promoted.
(eg: <4 x i64> -> <4 x i8> )

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

13 years agoFix MSVC build. next() function already exists in the MSVC headers. This create a...
Francois Pichet [Mon, 20 Jun 2011 05:19:37 +0000 (05:19 +0000)]
Fix MSVC build. next() function already exists in the MSVC headers. This create a overload conflict. Make sure we pick up the llvm one.

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

13 years agoTeach early dup how to duplicate basic blocks with one successor and only phi instruc...
Rafael Espindola [Mon, 20 Jun 2011 04:16:35 +0000 (04:16 +0000)]
Teach early dup how to duplicate basic blocks with one successor and only phi instructions
into more complex blocks.

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

13 years agoRevamp the "ConstantStruct::get" methods. Previously, these were scattered
Chris Lattner [Mon, 20 Jun 2011 04:01:31 +0000 (04:01 +0000)]
Revamp the "ConstantStruct::get" methods.  Previously, these were scattered
all over the place in different styles and variants.  Standardize on two
preferred entrypoints: one that takes a StructType and ArrayRef, and one that
takes StructType and varargs.

In cases where there isn't a struct type convenient, we now add a
ConstantStruct::getAnon method (whose name will make more sense after a few
more patches land).

It would be "really really nice" if the ConstantStruct::get and
ConstantVector::get methods didn't make temporary std::vectors.

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

13 years agointroduce an isLayoutIdentical() method, which is currently just a pointer
Chris Lattner [Mon, 20 Jun 2011 03:51:04 +0000 (03:51 +0000)]
introduce an isLayoutIdentical() method, which is currently just a pointer
equality check.

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

13 years agoAdd a RegisterTuples class to Target.td and TableGen.
Jakob Stoklund Olesen [Mon, 20 Jun 2011 02:50:54 +0000 (02:50 +0000)]
Add a RegisterTuples class to Target.td and TableGen.

A RegisterTuples instance is used to synthesize super-registers by
zipping together lists of sub-registers. This is useful for generating
pseudo-registers representing register sequence constraints like 'two
consecutive GPRs', or 'an even-odd pair of floating point registers'.

The RegisterTuples def can be used in register set operations when
building register classes. That is the only way of accessing the
synthesized super-registers.

For example, the ARM QQ register class of pseudo-registers could have
been formed like this:

  // Form pairs Q0_Q1, Q2_Q3, ...
  def QQPairs : RegisterTuples<[qsub_0, qsub_1],
                               [(decimate QPR, 2),
                                (decimate (shl QPR, 1), 2)]>;

  def QQ : RegisterClass<..., (add QQPairs)>;

Similarly, pseudo-registers representing '3 consecutive D-regs with
wraparound' look like:

  // Form D0_D1_D2, D1_D2_D3, ..., D30_D31_D0, D31_D0_D1.
  def DSeqTriples : RegisterTuples<[dsub_0, dsub_1, dsub_2],
                                   [(rotl DPR, 0),
                                    (rotl DPR, 1),
                                    (rotl DPR, 2)]>;

TableGen automatically computes aliasing information for the synthesized
registers.

Register tuples are still somewhat experimental. We still need to see
how they interact with MC.

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

13 years agoFix a FIXME by making GlobalVariable::getInitializer() return a
Jay Foad [Sun, 19 Jun 2011 18:37:11 +0000 (18:37 +0000)]
Fix a FIXME by making GlobalVariable::getInitializer() return a
const Constant *.

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

13 years agoUpdate test.
Benjamin Kramer [Sun, 19 Jun 2011 12:14:34 +0000 (12:14 +0000)]
Update test.

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

13 years agoCode cleanups: Remove duplicated logic in PromotInteRes_BITCAST, reserve vector space...
Nadav Rotem [Sun, 19 Jun 2011 10:49:57 +0000 (10:49 +0000)]
Code cleanups: Remove duplicated logic in PromotInteRes_BITCAST, reserve vector space, reuse types.

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

13 years agoCalls to AssertZext and getZeroExtendInReg must be made using scalar types.
Nadav Rotem [Sun, 19 Jun 2011 10:22:39 +0000 (10:22 +0000)]
Calls to AssertZext and getZeroExtendInReg must be made using scalar types.

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

13 years agoWhen promoting the vector elements in CopyToParts, use vector trunc
Nadav Rotem [Sun, 19 Jun 2011 08:49:38 +0000 (08:49 +0000)]
When promoting the vector elements in CopyToParts, use vector trunc
instead of scalarizing, and doing an element-by-element truncat.

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

13 years agoReduce the runtime of the test. Keep only the interesting cases.
Nadav Rotem [Sun, 19 Jun 2011 08:12:43 +0000 (08:12 +0000)]
Reduce the runtime of the test. Keep only the interesting cases.

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

13 years agoRevert r133373. I was going to use this to teach the Verifier to verify constant
Nick Lewycky [Sun, 19 Jun 2011 03:30:32 +0000 (03:30 +0000)]
Revert r133373. I was going to use this to teach the Verifier to verify constant
expressions, but Chris wants to instead reduce the set of possible constant
expression types.

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

13 years agoAdd the remaining instructions/constant expressions as Operators so that code
Nick Lewycky [Sun, 19 Jun 2011 02:26:33 +0000 (02:26 +0000)]
Add the remaining instructions/constant expressions as Operators so that code
can manipulate instructions and constantexpr's uniformly. No users yet though.

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

13 years agoRemove support for parsing the "type i32" syntax for defining a numbered
Chris Lattner [Sun, 19 Jun 2011 00:03:46 +0000 (00:03 +0000)]
Remove support for parsing the "type i32" syntax for defining a numbered
top level type without a specified number.  This syntax isn't documented
and blocks forward progress.

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

13 years agorevert r133368, apparently I missed the tests to be updated.
Chris Lattner [Sat, 18 Jun 2011 23:51:31 +0000 (23:51 +0000)]
revert r133368, apparently I missed the tests to be updated.

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

13 years agoRemove support for parsing the "type i32" syntax for defining a numbered
Chris Lattner [Sat, 18 Jun 2011 23:38:57 +0000 (23:38 +0000)]
Remove support for parsing the "type i32" syntax for defining a numbered
top level type without a specified number.  This asmprinter has never
generated this, as you can tell by no tests being updated.  It also isn't
documented.

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

13 years agofix the varargs version of StructType::get to not require an LLVMContext, making...
Chris Lattner [Sat, 18 Jun 2011 22:48:56 +0000 (22:48 +0000)]
fix the varargs version of StructType::get to not require an LLVMContext, making usage
much cleaner.

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

13 years agoeliminate some pointless virtual methods.
Chris Lattner [Sat, 18 Jun 2011 22:15:47 +0000 (22:15 +0000)]
eliminate some pointless virtual methods.

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

13 years agosimplify some code.
Chris Lattner [Sat, 18 Jun 2011 21:46:23 +0000 (21:46 +0000)]
simplify some code.

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

13 years agonow that Type::getDescription() is dead, the TypePrinting class can move from Assembl...
Chris Lattner [Sat, 18 Jun 2011 21:23:04 +0000 (21:23 +0000)]
now that Type::getDescription() is dead, the TypePrinting class can move from Assembly/Writer.h to being
a private class in AsmWriter.cpp.

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

13 years agoeliminate the Type::getDescription() method, using "<<" instead. This
Chris Lattner [Sat, 18 Jun 2011 21:18:23 +0000 (21:18 +0000)]
eliminate the Type::getDescription() method, using "<<" instead.  This
removes some gunk from LLVMContext.

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

13 years agoimprove some comments.
Chris Lattner [Sat, 18 Jun 2011 21:02:49 +0000 (21:02 +0000)]
improve some comments.

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

13 years agoremove an unreduced testcase.
Chris Lattner [Sat, 18 Jun 2011 19:12:59 +0000 (19:12 +0000)]
remove an unreduced testcase.

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

13 years agorework the remaining autoupgrade logic to use a StringRef instead of creating a
Chris Lattner [Sat, 18 Jun 2011 18:56:39 +0000 (18:56 +0000)]
rework the remaining autoupgrade logic to use a StringRef instead of creating a
temporary std::string for every function being checked.

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

13 years agoDirectly print to a raw_ostream instead of printing to a buffer first.
Benjamin Kramer [Sat, 18 Jun 2011 14:42:47 +0000 (14:42 +0000)]
Directly print to a raw_ostream instead of printing to a buffer first.

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

13 years agoSimplify code. No functionality change.
Benjamin Kramer [Sat, 18 Jun 2011 14:42:42 +0000 (14:42 +0000)]
Simplify code. No functionality change.

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

13 years agoSimplify code. No change in functionality.
Benjamin Kramer [Sat, 18 Jun 2011 13:53:47 +0000 (13:53 +0000)]
Simplify code. No change in functionality.

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

13 years agoMC: Allow .common as alias for .comm assembler directive. PR10116.
Hans Wennborg [Sat, 18 Jun 2011 13:51:54 +0000 (13:51 +0000)]
MC: Allow .common as alias for .comm assembler directive. PR10116.

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

13 years agoDon't allocate empty read-only SmallVectors during SelectionDAG deallocation.
Benjamin Kramer [Sat, 18 Jun 2011 13:13:44 +0000 (13:13 +0000)]
Don't allocate empty read-only SmallVectors during SelectionDAG deallocation.

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

13 years agoRemove unused but set variables.
Benjamin Kramer [Sat, 18 Jun 2011 11:09:41 +0000 (11:09 +0000)]
Remove unused but set variables.

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

13 years agoFix PR10103: Less code for enum type translation.
Hans Wennborg [Sat, 18 Jun 2011 10:28:47 +0000 (10:28 +0000)]
Fix PR10103: Less code for enum type translation.

In cases such as the attached test, where the case value for a switch
destination is used in a phi node that follows the destination, it
might be better to replace that value with the condition value of the
switch, so that more blocks can be folded away with
TryToSimplifyUncondBranchFromEmptyBlock because there are less
conflicts in the phi node.

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

13 years agoAdd test for r133251.
Nick Lewycky [Sat, 18 Jun 2011 07:23:25 +0000 (07:23 +0000)]
Add test for r133251.

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

13 years agoWhen scalar replacement returns a vector type, only accept it if the vector
Cameron Zwarich [Sat, 18 Jun 2011 06:17:51 +0000 (06:17 +0000)]
When scalar replacement returns a vector type, only accept it if the vector
type's bitwidth matches the (allocated) size of the alloca. This severely
pessimizes vector scalar replacement when the only vector type being used is
something like <3 x float> on x86 or ARM whose allocated size matches a
<4 x float>.

I hope to fix some of the flawed assumptions about allocated size throughout
scalar replacement and reenable this in most cases.

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

13 years agorip out a ton of intrinsic modernization logic from AutoUpgrade.cpp, which is
Chris Lattner [Sat, 18 Jun 2011 06:05:24 +0000 (06:05 +0000)]
rip out a ton of intrinsic modernization logic from AutoUpgrade.cpp, which is
for pre-2.9 bitcode files.  We keep x86 unaligned loads, movnt, crc32, and the
target indep prefetch change.

As usual, updating the testsuite is a PITA.

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

13 years agoFix an invalid bitcast crash that occurs when doing a partial memset of a vector
Cameron Zwarich [Sat, 18 Jun 2011 05:47:49 +0000 (05:47 +0000)]
Fix an invalid bitcast crash that occurs when doing a partial memset of a vector
alloca. Fixes part of <rdar://problem/9580800>.

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

13 years agoRemove a pointless assignment. Nothing checks the value of VectorTy anymore now
Cameron Zwarich [Sat, 18 Jun 2011 05:47:45 +0000 (05:47 +0000)]
Remove a pointless assignment. Nothing checks the value of VectorTy anymore now
unless ScalarKind is Vector.

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

13 years agoUse the correct comparator to avoid depending on pointer values.
Jakob Stoklund Olesen [Sat, 18 Jun 2011 05:44:55 +0000 (05:44 +0000)]
Use the correct comparator to avoid depending on pointer values.

This should fix the Linux buildbots.

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

13 years agoStore CodeGenRegisters as pointers so they won't be reallocated.
Jakob Stoklund Olesen [Sat, 18 Jun 2011 04:26:06 +0000 (04:26 +0000)]
Store CodeGenRegisters as pointers so they won't be reallocated.

Reuse the CodeGenRegBank DenseMap in a few places that would build their
own or use linear search.

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

13 years agoRemove MethodProtos/MethodBodies and allocation_order_begin/end.
Jakob Stoklund Olesen [Sat, 18 Jun 2011 03:08:20 +0000 (03:08 +0000)]
Remove MethodProtos/MethodBodies and allocation_order_begin/end.

Targets that need to change the default allocation order should use the
AltOrders mechanism instead. See the X86 and ARM targets for examples.

The allocation_order_begin() and allocation_order_end() methods have been
replaced with getRawAllocationOrder(), and there is further support
functions in RegisterClassInfo.

It is no longer possible to insert arbitrary code into generated
register classes. This is a feature.

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

13 years agoDelete unneeded allocation order override.
Jakob Stoklund Olesen [Sat, 18 Jun 2011 02:30:02 +0000 (02:30 +0000)]
Delete unneeded allocation order override.

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

13 years agoSwitch ARM to using AltOrders instead of MethodBodies.
Jakob Stoklund Olesen [Sat, 18 Jun 2011 01:14:46 +0000 (01:14 +0000)]
Switch ARM to using AltOrders instead of MethodBodies.

This slightly changes the GPR allocation order on Darwin where R9 is not
a callee-saved register:

Before: %R0 %R1 %R2 %R3 %R12 %R9 %LR %R4 %R5 %R6 %R8 %R10 %R11
After:  %R0 %R1 %R2 %R3 %R9 %R12 %LR %R4 %R5 %R6 %R8 %R10 %R11

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

13 years agoSwitch x86 to using AltOrders instead of MethodBodies.
Jakob Stoklund Olesen [Sat, 18 Jun 2011 01:14:43 +0000 (01:14 +0000)]
Switch x86 to using AltOrders instead of MethodBodies.

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

13 years agoMoved to the right place.
Galina Kistanova [Sat, 18 Jun 2011 00:59:37 +0000 (00:59 +0000)]
Moved to the right place.

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

13 years agoReserve D16-D13 on subtargets that don't support them.
Jakob Stoklund Olesen [Sat, 18 Jun 2011 00:53:27 +0000 (00:53 +0000)]
Reserve D16-D13 on subtargets that don't support them.

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

13 years agoProvide AltOrders for specifying alternative allocation orders.
Jakob Stoklund Olesen [Sat, 18 Jun 2011 00:50:49 +0000 (00:50 +0000)]
Provide AltOrders for specifying alternative allocation orders.

A register class can define AltOrders and AltOrderSelect instead of
defining method protos and bodies. The AltOrders lists can be defined
with set operations, and TableGen can verify that the alternative
allocation orders only contain valid registers.

This is currently an opt-in feature, and it is still possible to
override allocation_order_begin/end. That will not be true for long.

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

13 years ago* Override the "EmitBytes" function, since it can sneak values in that way.
Bill Wendling [Sat, 18 Jun 2011 00:19:35 +0000 (00:19 +0000)]
* Override the "EmitBytes" function, since it can sneak values in that way.
* Make this used only if CFI is used.

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

13 years agoFix UMULO support for 2x register width to allow the full
Eric Christopher [Sat, 18 Jun 2011 00:09:57 +0000 (00:09 +0000)]
Fix UMULO support for 2x register width to allow the full
range without a libcall to a new mulo<mode> libcall
that we'd have to create.

Finishes the rest of rdar://9090077 and rdar://9210061

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

13 years agoRemove false assertion.
Bill Wendling [Fri, 17 Jun 2011 23:42:01 +0000 (23:42 +0000)]
Remove false assertion.

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

13 years agoOnly call TRI::getRawAllocationOrder to resolve a target-dependent hint.
Jakob Stoklund Olesen [Fri, 17 Jun 2011 23:26:52 +0000 (23:26 +0000)]
Only call TRI::getRawAllocationOrder to resolve a target-dependent hint.

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

13 years agoZap the last reference to allocation_order_begin().
Jakob Stoklund Olesen [Fri, 17 Jun 2011 23:17:13 +0000 (23:17 +0000)]
Zap the last reference to allocation_order_begin().

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

13 years agoSI, DI, BP, and SP don't have 8-bit sub-registers in x86 mode.
Jakob Stoklund Olesen [Fri, 17 Jun 2011 23:15:00 +0000 (23:15 +0000)]
SI, DI, BP, and SP don't have 8-bit sub-registers in x86 mode.

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

13 years agoFix comment.
Eric Christopher [Fri, 17 Jun 2011 22:35:59 +0000 (22:35 +0000)]
Fix comment.

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

13 years agoFix -Asserts build
Matt Beaumont-Gay [Fri, 17 Jun 2011 22:21:12 +0000 (22:21 +0000)]
Fix -Asserts build

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

13 years agoRevert r133285. Causing odd failures on Dragonegg.
Chad Rosier [Fri, 17 Jun 2011 22:08:25 +0000 (22:08 +0000)]
Revert r133285.  Causing odd failures on Dragonegg.

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

13 years agoDisable for another investigation.
Bill Wendling [Fri, 17 Jun 2011 21:44:15 +0000 (21:44 +0000)]
Disable for another investigation.

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

13 years agoSet debug loc for new preheader's terminator.
Devang Patel [Fri, 17 Jun 2011 21:36:44 +0000 (21:36 +0000)]
Set debug loc for new preheader's terminator.

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

13 years agoSupport only DwarfCFI or SjLj exception handling in LSDA decoder.
Bill Wendling [Fri, 17 Jun 2011 21:31:43 +0000 (21:31 +0000)]
Support only DwarfCFI or SjLj exception handling in LSDA decoder.

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

13 years agoSjLj exception handling LSDA decoding support wasn't represented correctly. Use
Bill Wendling [Fri, 17 Jun 2011 21:29:06 +0000 (21:29 +0000)]
SjLj exception handling LSDA decoding support wasn't represented correctly. Use
the correct values, etc. In particular, the exception handling type is SjLj, not
ARM.

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

13 years agoDisable to investigate ARM failure.
Bill Wendling [Fri, 17 Jun 2011 21:09:50 +0000 (21:09 +0000)]
Disable to investigate ARM failure.

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

13 years agoUse the verbose asm flag instead of a new flag for decoding the LSDA.
Bill Wendling [Fri, 17 Jun 2011 20:55:01 +0000 (20:55 +0000)]
Use the verbose asm flag instead of a new flag for decoding the LSDA.

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

13 years agoFix a bug in the type-lowering of integer-promoted elements. Add a check that
Nadav Rotem [Fri, 17 Jun 2011 20:54:12 +0000 (20:54 +0000)]
Fix a bug in the type-lowering of integer-promoted elements. Add a check that
the newly created simple type is valid before checking its legality.
Re-commit the test file.

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

13 years agoAdd an alternative rev16 pattern. We should figure out a better way to handle these...
Evan Cheng [Fri, 17 Jun 2011 20:47:21 +0000 (20:47 +0000)]
Add an alternative rev16 pattern. We should figure out a better way to handle these complex rev patterns. rdar://9609108

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

13 years agoLower multiply with overflow checking to __mulo<mode>
Eric Christopher [Fri, 17 Jun 2011 20:41:29 +0000 (20:41 +0000)]
Lower multiply with overflow checking to __mulo<mode>
calls if we haven't been able to lower them any
other way.

Fixes rdar://9090077 and rdar://9210061

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

13 years agoAdd an option that allows one to "decode" the LSDA.
Bill Wendling [Fri, 17 Jun 2011 20:35:21 +0000 (20:35 +0000)]
Add an option that allows one to "decode" the LSDA.

The LSDA is a bit difficult for the non-initiated to read. Even with comments,
it's not always clear what's going on. This wraps the ASM streamer in a class
that retains the LSDA and then emits a human-readable description of what's
going on in it.

So instead of having to make sense of:

Lexception1:
        .byte   255
        .byte   155
        .byte   168
        .space  1
        .byte   3
        .byte   26
Lset0 = Ltmp7-Leh_func_begin1
      .long     Lset0
Lset1 = Ltmp812-Ltmp7
      .long     Lset1
Lset2 = Ltmp913-Leh_func_begin1
      .long     Lset2
      .byte     3
Lset3 = Ltmp812-Leh_func_begin1
      .long     Lset3
Lset4 = Leh_func_end1-Ltmp812
      .long     Lset4
      .long     0
      .byte     0
      .byte     1
      .byte     0
      .byte     2
      .byte     125
      .long     __ZTIi@GOTPCREL+4
      .long     __ZTIPKc@GOTPCREL+4

you can read this instead:

## Exception Handling Table: Lexception1
##  @LPStart Encoding: omit
##    @TType Encoding: indirect pcrel sdata4
##        @TType Base: 40 bytes
## @CallSite Encoding: udata4
## @Action Table Size: 26 bytes

## Action 1:
##   A throw between Ltmp7 and Ltmp812 jumps to Ltmp913 on an exception.
##     For type(s):  __ZTIi@GOTPCREL+4 __ZTIPKc@GOTPCREL+4
## Action 2:
##   A throw between Ltmp812 and Leh_func_end1 does not have a landing pad.

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

13 years agoRelocate NUW test to cover all binary ops in a dynamic alloca expr.
Stuart Hastings [Fri, 17 Jun 2011 20:21:52 +0000 (20:21 +0000)]
Relocate NUW test to cover all binary ops in a dynamic alloca expr.
Followup to 132926.  rdar://problem/9265821

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

13 years agoest 2008-06-04-indirectmem.ll is X86-specific. Move to X86 folder.
Galina Kistanova [Fri, 17 Jun 2011 18:26:23 +0000 (18:26 +0000)]
est 2008-06-04-indirectmem.ll is X86-specific. Move to X86 folder.

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

13 years agoDrop the "2" suffix on some enums.
Chris Lattner [Fri, 17 Jun 2011 18:17:37 +0000 (18:17 +0000)]
Drop the "2" suffix on some enums.

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

13 years agoremove support for a bunch of obsolete instruction encodings
Chris Lattner [Fri, 17 Jun 2011 18:09:11 +0000 (18:09 +0000)]
remove support for a bunch of obsolete instruction encodings
and other backward compatibility hacks.

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

13 years agoRemove a useless copy of MCELFStreamer. Patch by Logan Chien!
Benjamin Kramer [Fri, 17 Jun 2011 18:05:30 +0000 (18:05 +0000)]
Remove a useless copy of MCELFStreamer. Patch by Logan Chien!

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

13 years agogetSuccWeight returns now default 0 if Weights vector is empty.
Jakub Staszak [Fri, 17 Jun 2011 18:00:21 +0000 (18:00 +0000)]
getSuccWeight returns now default 0 if Weights vector is empty.

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

13 years agomissed a file.
Chris Lattner [Fri, 17 Jun 2011 17:56:00 +0000 (17:56 +0000)]
missed a file.

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

13 years agoRemove some "2" suffixes from the metadata enums now that "1" is gone.
Chris Lattner [Fri, 17 Jun 2011 17:50:30 +0000 (17:50 +0000)]
Remove some "2" suffixes from the metadata enums now that "1" is gone.

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

13 years agoremove bitcode reader support for LLVM 2.7 metadata encoding.
Chris Lattner [Fri, 17 Jun 2011 17:48:53 +0000 (17:48 +0000)]
remove bitcode reader support for LLVM 2.7 metadata encoding.

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

13 years agoremove another old and dead hunk of code.
Chris Lattner [Fri, 17 Jun 2011 17:40:18 +0000 (17:40 +0000)]
remove another old and dead hunk of code.

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

13 years agoStop accepting and ignoring attributes in function types. Attributes are applied
Chris Lattner [Fri, 17 Jun 2011 17:37:13 +0000 (17:37 +0000)]
Stop accepting and ignoring attributes in function types.  Attributes are applied
to functions and call/invokes, not to types.

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

13 years agoAllow empty Weights vector.
Jakub Staszak [Fri, 17 Jun 2011 17:30:10 +0000 (17:30 +0000)]
Allow empty Weights vector.

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

13 years agoFix a few places where 32bit instructions/registerset were used on PPC64.
Roman Divacky [Fri, 17 Jun 2011 15:21:10 +0000 (15:21 +0000)]
Fix a few places where 32bit instructions/registerset were used on PPC64.

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

13 years agoTest for previous commit.
Rafael Espindola [Fri, 17 Jun 2011 14:16:17 +0000 (14:16 +0000)]
Test for previous commit.

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

13 years agoTwo fixes relating to debug value:
Rafael Espindola [Fri, 17 Jun 2011 13:59:43 +0000 (13:59 +0000)]
Two fixes relating to debug value:
* We should change the generated code because of a debug use.
* Avoid creating debug uses of undef, as they become a kill.
Test to follow.

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

13 years agoFix typo in comment.
Jay Foad [Fri, 17 Jun 2011 13:36:06 +0000 (13:36 +0000)]
Fix typo in comment.

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

13 years agoPTX: Adjust rounding modes
Justin Holewinski [Fri, 17 Jun 2011 12:12:42 +0000 (12:12 +0000)]
PTX: Adjust rounding modes

* rounding modes for fp add, mul, sub now use .rn
* float -> int rounding correctly uses .rzi not .rni
* 32bit fdiv for sm13 uses div.rn (instead of div.approx)
* 32bit fdiv for sm10 now uses div (instead of div.approx)

Approx is not IEEE 754 compatible (and should be optionally set by a flag to the backend instead). The .rn rounding modifier is the PTX default anyway, but it's better to be explicit.

All these modifiers should be available by using __fmul_rz functions for example, but support will need to be added for this in the backend.

Patch by Dan Bailey

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

13 years agoDon't force remove config.cache on reconfiguration.
NAKAMURA Takumi [Fri, 17 Jun 2011 11:08:09 +0000 (11:08 +0000)]
Don't force remove config.cache on reconfiguration.

config.cache will be used by the person who specifies '-C' to configure.
config.cache's inconsistency should be responsible to him.

Re-configuration would spend so much on cygming without '-C', esp. cygwin.

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

13 years agoWhen promoting an alloca to registers discard any lifetime intrinsics.
Nick Lewycky [Fri, 17 Jun 2011 10:09:00 +0000 (10:09 +0000)]
When promoting an alloca to registers discard any lifetime intrinsics.

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

13 years agoAdd a hook for PBQP clients to run a custom pre-alloc pass to run prior to PBQP alloc...
Lang Hames [Fri, 17 Jun 2011 07:09:01 +0000 (07:09 +0000)]
Add a hook for PBQP clients to run a custom pre-alloc pass to run prior to PBQP allocation. Patch by Arnaud Allard de Grandmaison.

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

13 years agomake the asmparser reject function and type redefinitions. 'Merging' hasn't been
Chris Lattner [Fri, 17 Jun 2011 07:06:44 +0000 (07:06 +0000)]
make the asmparser reject function and type redefinitions.  'Merging' hasn't been
needed since llvm-gcc 3.4 days.

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

13 years agoremove asmparser support for the old getresult instruction, which has been subsumed...
Chris Lattner [Fri, 17 Jun 2011 06:57:15 +0000 (06:57 +0000)]
remove asmparser support for the old getresult instruction, which has been subsumed by extractvalue.

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

13 years agoremove parser support for the obsolete "multiple return values" syntax, which
Chris Lattner [Fri, 17 Jun 2011 06:49:41 +0000 (06:49 +0000)]
remove parser support for the obsolete "multiple return values" syntax, which
was replaced with return of a "first class aggregate".

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

13 years agostop accepting begin/end around function bodies in the .ll parser, this isn't pascal...
Chris Lattner [Fri, 17 Jun 2011 06:42:57 +0000 (06:42 +0000)]
stop accepting begin/end around function bodies in the .ll parser, this isn't pascal anymore.

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

13 years agoRemove support for using "foo" as symbols instead of %"foo". This is ancient
Chris Lattner [Fri, 17 Jun 2011 06:36:20 +0000 (06:36 +0000)]
Remove support for using "foo" as symbols instead of %"foo".  This is ancient
syntax and has been long obsolete.  As usual, updating the tests is the nasty
part of this.

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