Commit Graph

73252 Commits

Author SHA1 Message Date
Jay Foad
cd35e09a4a Reinstate r133435 and r133449 (reverted in r133499) now that the clang
self-hosted build failure has been fixed (r133512).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133513 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-21 10:33:19 +00:00
Jay Foad
69254f67a5 Don't use PN->replaceUsesOfWith() to change a PHINode's incoming blocks,
because it won't work after my phi operand changes, because the incoming
blocks will no longer be Uses.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133512 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-21 10:02:43 +00:00
Jay Foad
80be2a2654 Add a reduced test case for the buildbot failure (clang self-hosted
build) caused by r133435.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133509 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-21 08:33:49 +00:00
Chris Lattner
39ff10a293 use the MapEntryTy typedef instead of writing it out long form,
add some fixme's about methods that should be removed.

Merged from type-system-rewrite.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133504 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-21 06:22:33 +00:00
Evan Cheng
9568e5c3c3 Teach dag combine to match halfword byteswap patterns.
1. (((x) & 0xFF00) >> 8) | (((x) & 0x00FF) << 8)
   => (bswap x) >> 16
2. ((x&0xff)<<8)|((x&0xff00)>>8)|((x&0xff000000)>>8)|((x&0x00ff0000)<<8))
   => (rotl (bswap x) 16)

This allows us to eliminate most of the def : Pat patterns for ARM rev16
revsh instructions. It catches many more cases for ARM and x86.

rdar://9609108


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133503 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-21 06:01:08 +00:00
Andrew Trick
2fabd464ae indvars -disable-iv-rewrite: Adds support for eliminating identity
ops.

This is a rewrite of the IV simplification algorithm used by
-disable-iv-rewrite. To avoid perturbing the default mode, I
temporarily split the driver and created SimplifyIVUsersNoRewrite. The
idea is to avoid doing opcode/pattern matching inside
IndVarSimplify. SCEV already does it. We want to optimize with the
full generality of SCEV, but optimize def-use chains top down on-demand rather
than rewriting the entire expression bottom-up. This was easy to do
for operations that SCEV can prove are identity function. So we're now
eliminating bitmasks and zero extends this way.

A result of this rewrite is that indvars -disable-iv-rewrite no longer
requires IVUsers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133502 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-21 03:22:38 +00:00
Chad Rosier
a88a0ca808 Revert r133435 and r133449 to appease buildbots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133499 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-21 02:09:03 +00:00
Akira Hatanaka
805569f54a Add A0 and A1 to the list of registers used for returning a value in order to
handle functions with return type Complex long long.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133497 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-21 01:28:11 +00:00
Akira Hatanaka
5f7451ff6e Coding style fixes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133496 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-21 01:02:03 +00:00
Akira Hatanaka
21afc63ea7 Re-apply 132758 and 132768 which were speculatively reverted in 132777.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133494 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-21 00:40:49 +00:00
Bill Wendling
48b93b10e3 Don't mark the eh.dispatch.setup with a memory access marker. We want this to
stick around even during fast isel.
<rdar://problem/9637156>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133493 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-21 00:35:15 +00:00
Dan Gohman
c4bcd4d964 Completely short-circuit out ARC optimization if the ARC runtime
functions do not appear in the module.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133478 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-20 23:20:43 +00:00
Bill Wendling
b8c6ed3b62 Remove the subclassing. This will be moved to the ASM printer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133473 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-20 22:12:24 +00:00
Jakob Stoklund Olesen
9b718e8864 Skip fields that don't exist in the Register class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133470 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-20 20:56:05 +00:00
Justin Holewinski
c882df2560 PTX: Fix conversion between predicates and value types
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133454 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-20 18:42:48 +00:00
Nick Lewycky
1bd15700a0 Emit movq for 64-bit register to XMM register moves, but continue to accept
movd when assembling.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133452 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-20 18:33:26 +00:00
Jay Foad
332d7e871c Fix a check for PHINodes with two incoming values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133449 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-20 17:46:19 +00:00
Justin Holewinski
cad129bcc0 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
2011-06-20 17:08:56 +00:00
Rafael Espindola
b87e37f1b1 Disable again.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133446 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-20 17:04:08 +00:00
Justin Holewinski
df1c8d837d 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
2011-06-20 15:56:20 +00:00
Roman Divacky
8e9d6720c3 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
2011-06-20 15:28:39 +00:00
Jay Foad
5e27a1d468 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
2011-06-20 14:46:47 +00:00
Jay Foad
72f5f313d8 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
2011-06-20 14:38:01 +00:00
Jay Foad
c137120bb0 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
2011-06-20 14:18:48 +00:00
Jay Foad
691c05bb29 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
2011-06-20 14:12:33 +00:00
Rafael Espindola
689c24768b 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
2011-06-20 14:11:42 +00:00
Duncan Sands
2ee2d93232 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
2011-06-20 09:26:23 +00:00
Nadav Rotem
4720611025 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
2011-06-20 07:15:58 +00:00
Francois Pichet
289a27946f 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
2011-06-20 05:19:37 +00:00
Rafael Espindola
275c1f9f93 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
2011-06-20 04:16:35 +00:00
Chris Lattner
b065b06c12 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
2011-06-20 04:01:31 +00:00
Chris Lattner
5d6fa7f2ac 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
2011-06-20 03:51:04 +00:00
Jakob Stoklund Olesen
4ce25d5d69 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
2011-06-20 02:50:54 +00:00
Jay Foad
7d715dfe6d 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
2011-06-19 18:37:11 +00:00
Benjamin Kramer
9cfcc6c1e1 Update test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133390 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-19 12:14:34 +00:00
Nadav Rotem
5b82c2f891 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
2011-06-19 10:49:57 +00:00
Nadav Rotem
0928c9e18a 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
2011-06-19 10:22:39 +00:00
Nadav Rotem
c6341e6e50 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
2011-06-19 08:49:38 +00:00
Nadav Rotem
c17d3552da 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
2011-06-19 08:12:43 +00:00
Nick Lewycky
6cc6bc8cd5 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
2011-06-19 03:30:32 +00:00
Nick Lewycky
c49c0ff74c 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
2011-06-19 02:26:33 +00:00
Chris Lattner
a53616d08b 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
2011-06-19 00:03:46 +00:00
Chris Lattner
edcaca8e41 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
2011-06-18 23:51:31 +00:00
Chris Lattner
8dd72b85b2 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
2011-06-18 23:38:57 +00:00
Chris Lattner
b2318662b6 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
2011-06-18 22:48:56 +00:00
Chris Lattner
ea049181a0 eliminate some pointless virtual methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133363 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-18 22:15:47 +00:00
Chris Lattner
ebb2189904 simplify some code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133362 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-18 21:46:23 +00:00
Chris Lattner
fb78b33018 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
2011-06-18 21:23:04 +00:00
Chris Lattner
0cd0d88160 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
2011-06-18 21:18:23 +00:00
Chris Lattner
70d0ff1a97 improve some comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133359 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-18 21:02:49 +00:00