Commit Graph

61941 Commits

Author SHA1 Message Date
Bob Wilson
21773e716f Add support for encoding VDUP (ARM core register) instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107201 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 20:13:29 +00:00
Duncan Sands
871dc240d0 Fix a buffer overflow noticed by gcc-4.6: zero is written into
SmallArray[SmallSize] in the SmallPtrSetIteratorImpl, and this is
one off the end of the array.  For those who care, right now gcc
warns about writing off the end because it is confused about the
declaration of SmallArray as having length 1 in the parent class
SmallPtrSetIteratorImpl.  However if you tweak code to unconfuse
it, then it still warns about writing off the end of the array,
because of this buffer overflow.  In short, even with this fix
gcc-4.6 will warn about writing off the end of the array, but now
that is only because it is confused.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107200 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 20:12:02 +00:00
Duncan Sands
05b0b44f8a NextPowerOfTwo was already used to ensure that SmallSizePowTwo is a power
of two, no need to do it a second time (NextPowerOfTwo is idempotent).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107199 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 20:05:34 +00:00
Chris Lattner
190a7f4a18 give PATypeHolder an explicit copy ctor which initializes the type pointer,
and make PATypeHolder work with null pointers.

The implicitly generated one didn't work on numerous levels, but was still
accepted, allowing all sorts of bugs with default constructed pa type holders.

Previously, they "sort of" worked if they were default constructed and then
destructed.  Now they really work, and you can even default construct one,
then assign to it, amazing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107195 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 19:20:38 +00:00
Jakob Stoklund Olesen
d1303d2a66 Fix the handling of partial redefines in the fast register allocator.
A partial redefine needs to be treated like a tied operand, and the register
must be reloaded while processing use operands.

This fixes a bug where partially redefined registers were processed as normal
defs with a reload added. The reload could clobber another use operand if it was
a kill that allowed register reuse.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107193 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 19:15:30 +00:00
Bob Wilson
5d52165e4e Fix a register scavenger crash when dealing with undefined subregs.
The LowerSubregs pass needs to preserve implicit def operands attached to
EXTRACT_SUBREG instructions when it replaces those instructions with copies.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107189 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 18:42:49 +00:00
Bruno Cardoso Lopes
721ef73d88 Add AVX non-temporal stores
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107178 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 18:22:01 +00:00
Dan Gohman
af0824701b Add a few more interesting testcases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107177 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 18:17:11 +00:00
Dan Gohman
6f205cbceb Fix whitespace style.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107175 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 18:12:34 +00:00
Bruno Cardoso Lopes
de173ca1fb Move non-temporal movs to their own section
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107168 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 17:42:37 +00:00
Bob Wilson
d5a563de07 Add support for encoding NEON VMOV (from core register to scalar) instructions.
The encoding is the same as VMOV (from scalar to core register) except that
the operands are in different places.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107167 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 17:34:07 +00:00
Bruno Cardoso Lopes
ea86423cbd Add sqrt, rsqrt and rcp AVX instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107166 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 17:26:30 +00:00
Jim Grosbach
077f1bfa91 skip dbg_value instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107154 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 16:55:24 +00:00
Gabor Greif
16575de259 minor cosmetics
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107148 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 16:27:38 +00:00
Bob Wilson
1ab38469df The t2MOVi16 and t2MOVTi16 instructions do not set CPSR. Trying to add
a CPSR operand to them causes an assertion failure, so apparently these
instructions haven't been getting a lot of use.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107147 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 16:25:11 +00:00
Gabor Greif
f500cbdcb1 use ArgOffset constant to prepare for operand rotation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107146 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 16:21:20 +00:00
Gabor Greif
cfbb7d4329 use ArgOperand API
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107145 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 16:17:26 +00:00
Gabor Greif
009105c393 use ArgOperand API
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107144 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 16:01:30 +00:00
Duncan Sands
a7065b1fcc Return Changed. This required setting Changed if dbg metadata
is stripped off.  Currently set unconditionally, since the API
does not provide a way of working out if anything was actually
stripped off.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107142 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 14:52:10 +00:00
Duncan Sands
80b9b89537 It seems clear that this should return Changed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107141 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 14:49:35 +00:00
Rafael Espindola
d31f972bd3 Add a VT argument to getMinimalPhysRegClass and replace the copy related uses
of getPhysicalRegisterRegClass with it.

If we want to make a copy (or estimate its cost), it is better to use the
smallest class as more efficient operations might be possible.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107140 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 14:02:34 +00:00
Duncan Sands
17c6e6d9cf getMachineBasicBlockAddress returns a uintptr_t - don't truncate
to unsigned only to extend back to a pointer sized value on the
next line.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107139 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 13:34:20 +00:00
Duncan Sands
6f74f69ff4 The variable ValueSize is set to 1 on both code paths, and then
ignored!  Remove it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107138 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 13:30:08 +00:00
Duncan Sands
5b96b26eb7 The variable "Value" is carefully set to Layout.getSymbolAddress,
but then not actually used - maybe a bug?  Remove the variable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107137 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 13:26:33 +00:00
Duncan Sands
44886ac5eb Remove unused calls to Lexer.getLoc and the pointless variable HasFillExpr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107136 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 13:24:40 +00:00
Duncan Sands
31a3a3ebaf Remove pointless variable LastDef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107135 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 13:23:22 +00:00
Duncan Sands
9b8c91ced0 Looks like this test is missing an XFAIL line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107134 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 13:18:50 +00:00
Duncan Sands
58c86910b3 Remove unused variable Loc and pointless variables unified_syntax
and thumb_mode.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107133 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 13:04:35 +00:00
Gabor Greif
9d677680e4 use ArgOperand APIs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107132 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 13:03:46 +00:00
Duncan Sands
978189e090 Remove an unused and a pointless variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107131 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 13:00:29 +00:00
Duncan Sands
78337b4d4d Remove pointless and unused variables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107130 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 12:48:49 +00:00
Gabor Greif
eff566d19a encode operand initializations (at fixed index)
in terms of Op<> and ArgOffset. This works for
values of {0, 1} for ArgOffset.
Please note that ArgOffset will become 0 soon and
will go away eventually.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107129 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 11:41:38 +00:00
Duncan Sands
374acd0891 Remove a pointless variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107128 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 11:39:45 +00:00
Duncan Sands
90c64f4aac Remove initialized but otherwise unused variables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107127 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 11:22:26 +00:00
Duncan Sands
51370298b8 Remove variables that are written by not read.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107126 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 11:07:47 +00:00
Benjamin Kramer
3432d70d5b Use a more obvious way to avoid compiling functions which are only used when XDEBUG is enabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107125 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 10:03:11 +00:00
Chandler Carruth
ca9f7efdf8 Jump through some silly hoops to make GCC accept that a function may not always
be called.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107124 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 06:46:00 +00:00
Evan Cheng
c36b5b9730 PR7503: uxtb16 is not available for ARMv7-M. Patch by Brian G. Lucas.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107122 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 05:38:36 +00:00
Evan Cheng
c170f66742 Change if-cvt options to something that actually as useable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107121 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 05:37:59 +00:00
Jim Grosbach
2f2b25451b When processing loops for scheduling latencies (used for live outs on loop
back-edges), make sure not to include dbg_value instructions in the count.
Closing in on the end of rdar://7797940

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107119 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 04:48:13 +00:00
Dan Gohman
7a64257f94 Just as its not safe to blindly transfer the nsw bit from an add
instruction to an add scev, it's not safe to blindly transfer the
inbounds flag from a gep instruction to an nsw on the scev for the
gep.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107117 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 01:41:41 +00:00
Bruno Cardoso Lopes
b22dc70a5c Refactoring of arithmetic instruction classes with unary operator
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107116 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 01:33:09 +00:00
Jakob Stoklund Olesen
628a79771b When no memoperands are present, assume unaligned, volatile.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107114 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 01:13:07 +00:00
Bill Wendling
0a1bd2abf6 Strip resulting binaries.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107112 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 01:08:57 +00:00
Bob Wilson
8eab75f390 Reapply my if-conversion cleanup from svn r106939 with fixes.
There are 2 changes relative to the previous version of the patch:

1) For the "simple" if-conversion case, there's no need to worry about
RemoveExtraEdges not handling an unanalyzable branch.  Predicated terminators
are ignored in this context, so RemoveExtraEdges does the right thing.
This might break someday if we ever treat indirect branches (BRIND) as
predicable, but for now, I just removed this part of the patch, because
in the case where we do not add an unconditional branch, we rely on keeping
the fall-through edge to CvtBBI (which is empty after this transformation).

The change relative to the previous patch is:

@@ -1036,10 +1036,6 @@
     IterIfcvt = false;
   }
 
-  // RemoveExtraEdges won't work if the block has an unanalyzable branch,
-  // which is typically the case for IfConvertSimple, so explicitly remove
-  // CvtBBI as a successor.
-  BBI.BB->removeSuccessor(CvtBBI->BB);
   RemoveExtraEdges(BBI);
 
   // Update block info. BB can be iteratively if-converted.


2) My patch exposed a bug in the code for merging the tail of a "diamond",
which had previously never been exercised.  The code was simply checking that
the tail had a single predecessor, but there was a case in
MultiSource/Benchmarks/VersaBench/dbms where that single predecessor was
neither edge of the diamond.  I added the following change to check for
that:

@@ -1276,7 +1276,18 @@
   // tail, add a unconditional branch to it.
   if (TailBB) {
     BBInfo TailBBI = BBAnalysis[TailBB->getNumber()];
-    if (TailBB->pred_size() == 1 && !TailBBI.HasFallThrough) {
+    bool CanMergeTail = !TailBBI.HasFallThrough;
+    // There may still be a fall-through edge from BBI1 or BBI2 to TailBB;
+    // check if there are any other predecessors besides those.
+    unsigned NumPreds = TailBB->pred_size();
+    if (NumPreds > 1)
+      CanMergeTail = false;
+    else if (NumPreds == 1 && CanMergeTail) {
+      MachineBasicBlock::pred_iterator PI = TailBB->pred_begin();
+      if (*PI != BBI1->BB && *PI != BBI2->BB)
+        CanMergeTail = false;
+    }
+    if (CanMergeTail) {
       MergeBlocks(BBI, TailBBI);
       TailBBI.IsDone = true;
     } else {

With these fixes, I was able to run all the SingleSource and MultiSource
tests successfully.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107110 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 00:55:23 +00:00
Dan Gohman
6be2bd516a Add an Intraprocedural form of BasicAliasAnalysis, which aims to
properly handles instructions and arguments defined in different
functions, or across recursive function iterations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107109 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 00:50:39 +00:00
Bruno Cardoso Lopes
4548260ab5 Described the missing AVX forms of SSE2 convert instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107108 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 00:36:02 +00:00
Bob Wilson
5cdede43e9 Fix Thumb encoding of VMOV (scalar to ARM core register). The encoding is
the same as ARM except that the condition code field is always set to ARMCC::AL.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107107 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 00:26:13 +00:00
Devang Patel
e4e7d56396 The comment string does not match for all targets. PowerPC uses ;.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107103 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 00:04:40 +00:00
Bob Wilson
8674949513 Unlike other targets, ARM now uses BUILD_VECTORs post-legalization so they
can't be changed arbitrarily by the DAGCombiner without checking if it is
running after legalization.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107097 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-28 23:40:25 +00:00