oota-llvm.git
10 years agoMark a method 'const' and another 'static'.
Craig Topper [Wed, 17 Jul 2013 03:54:53 +0000 (03:54 +0000)]
Mark a method 'const' and another 'static'.

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

10 years agoMake a few more static string pointers constant.
Craig Topper [Wed, 17 Jul 2013 03:43:10 +0000 (03:43 +0000)]
Make a few more static string pointers constant.

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

10 years agoDon't fallback to copy + delete in rename.
Rafael Espindola [Wed, 17 Jul 2013 03:33:41 +0000 (03:33 +0000)]
Don't fallback to copy + delete in rename.

Rename's documentation says "Files are renamed as if by POSIX rename()". and it
is used for atomically updating output files from a temporary. Having rename
fallback to a non atomic copy has the potential to hide bugs, like using
a temporary file in /tmp instead of a unique name next to the final destination.

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

10 years agoMake constant string pointer into an array to remove a pointer lookup for every access.
Craig Topper [Wed, 17 Jul 2013 03:11:32 +0000 (03:11 +0000)]
Make constant string pointer into an array to remove a pointer lookup for every access.

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

10 years agoraw_ostream.cpp: Introduce <fcntl.h> to let O_BINARY provided. Or, llvm::outs() would...
NAKAMURA Takumi [Wed, 17 Jul 2013 02:21:10 +0000 (02:21 +0000)]
raw_ostream.cpp: Introduce <fcntl.h> to let O_BINARY provided. Or, llvm::outs() would be set to O_TEXT by default.

llvm/test/Object/check_binary_output.ll is expected to pass on win32.

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

10 years agoSLPVectorizer: Accelerate the isConsecutive check by replacing the subtraction of...
Nadav Rotem [Wed, 17 Jul 2013 00:48:31 +0000 (00:48 +0000)]
SLPVectorizer: Accelerate the isConsecutive check by replacing the subtraction of the two values with a simple SCEV expression that adds the offset to one of the pointers that we compare.

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

10 years agoPPC: Implement base pointer and stack realignment
Hal Finkel [Wed, 17 Jul 2013 00:45:52 +0000 (00:45 +0000)]
PPC: Implement base pointer and stack realignment

This builds on some frame-lowering code that has existed since 2005 (r24224)
but was disabled in 2008 (r48188) because it needed base pointer support to
function correctly. This implementation follows the strategy suggested by Dale
Johannesen in r48188 where the following comment was added:

  This does not currently work, because the delta between old and new stack
  pointers is added to offsets that reference incoming parameters after the
  prolog is generated, and the code that does that doesn't handle a variable
  delta.  You don't want to do that anyway; a better approach is to reserve
  another register that retains to the incoming stack pointer, and reference
  parameters relative to that.

And now we do exactly that. If we don't need a frame pointer, then we use r31
as a base pointer. If we do need a frame pointer, then we use r30 as a base
pointer. The base pointer retains the value of the stack pointer before it was
decremented in the prologue. We then use the base pointer to resolve all
negative frame indicies. The basic scheme follows that for base pointers in the
X86 backend.

We use a base pointer when we need to dynamically realign the incoming stack
pointer. This currently applies only to static objects (dynamic allocas with
large alignments, and base-pointer support in SjLj lowering will come in future
commits).

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

10 years agollvm/test/CodeGen/X86/vec_setcc.ll: Add explicit -mtriple=x86_64-unknown-unknown...
NAKAMURA Takumi [Wed, 17 Jul 2013 00:42:37 +0000 (00:42 +0000)]
llvm/test/CodeGen/X86/vec_setcc.ll: Add explicit -mtriple=x86_64-unknown-unknown to satisfy win32-targeted configuration.

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

10 years agoMove string pointer from being a static class member to just a static global in the...
Craig Topper [Wed, 17 Jul 2013 00:31:35 +0000 (00:31 +0000)]
Move string pointer from being a static class member to just a static global in the one file its needed in.

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

10 years agoAdd getModuleFlag(StringRef Key) to query a module flag given Key.
Manman Ren [Tue, 16 Jul 2013 23:21:16 +0000 (23:21 +0000)]
Add getModuleFlag(StringRef Key) to query a module flag given Key.

No functionality change.

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

10 years agollvm/test/Object/ar-create.test: Relax a CHECK line to satisfy localized message...
NAKAMURA Takumi [Tue, 16 Jul 2013 23:17:22 +0000 (23:17 +0000)]
llvm/test/Object/ar-create.test: Relax a CHECK line to satisfy localized message catalogue.

For example, 'No such file or directory' cannot be seen on Japanese version of msvcrt.

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

10 years agollvm/test/Object/check_binary_output.ll: Mark it as XFAIL on Windows. Investigating.
NAKAMURA Takumi [Tue, 16 Jul 2013 23:16:57 +0000 (23:16 +0000)]
llvm/test/Object/check_binary_output.ll: Mark it as XFAIL on Windows. Investigating.

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

10 years agoflip the scev minus direction to simplify the code.
Nadav Rotem [Tue, 16 Jul 2013 22:57:06 +0000 (22:57 +0000)]
flip the scev minus direction to simplify the code.

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

10 years agoSLPVectorizer: Improve the compile time of isConsecutive by adding a simple constant...
Nadav Rotem [Tue, 16 Jul 2013 22:51:07 +0000 (22:51 +0000)]
SLPVectorizer: Improve the compile time of isConsecutive by adding a simple constant-gep check before using SCEV.
This check does not always work because not all of the GEPs use a constant offset, but it happens often enough to reduce the number of times we use SCEV.

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

10 years agoRelated to r181161 - Indirect branches may not be the last branch in a basic
Lang Hames [Tue, 16 Jul 2013 22:01:40 +0000 (22:01 +0000)]
Related to r181161 - Indirect branches may not be the last branch in a basic
block. Blocks that have an indirect branch terminator, even if it's not the
last terminator, should still be treated as unanalyzable.

<rdar://problem/14437274>

Reducing a useful regression test case is proving difficult - I hope to have
one soon.

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

10 years agoARM: Add support for the Thumb2 PLI alternate literal form.
Tilmann Scheller [Tue, 16 Jul 2013 21:52:34 +0000 (21:52 +0000)]
ARM: Add support for the Thumb2 PLI alternate literal form.

This adds an instruction alias to make the assembler recognize the alternate literal form: pli [PC, #+/-<imm>]

See A8.8.129 in the ARM ARM (DDI 0406C.b).

Fixes <rdar://problem/14403733>.

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

10 years agoUpdate the examples for an API change.
Rafael Espindola [Tue, 16 Jul 2013 20:22:35 +0000 (20:22 +0000)]
Update the examples for an API change.

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

10 years agoAdd a wrapper for open.
Rafael Espindola [Tue, 16 Jul 2013 19:44:17 +0000 (19:44 +0000)]
Add a wrapper for open.

This centralizes the handling of O_BINARY and opens the way for hiding more
differences (like how open behaves with directories).

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

10 years agoFinally, force the target for this test. Should unbreak non-x86 buildbots.
Benjamin Kramer [Tue, 16 Jul 2013 19:22:07 +0000 (19:22 +0000)]
Finally, force the target for this test. Should unbreak non-x86 buildbots.

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

10 years agoXFAIL this test on mingw.
Rafael Espindola [Tue, 16 Jul 2013 19:20:29 +0000 (19:20 +0000)]
XFAIL this test on mingw.

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

10 years agoLabel names also differ between platforms. Use a relaxed regex.
Benjamin Kramer [Tue, 16 Jul 2013 18:54:21 +0000 (18:54 +0000)]
Label names also differ between platforms. Use a relaxed regex.

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

10 years agoFix test not to fail when the target doesn't use leading underscores on symbols.
Benjamin Kramer [Tue, 16 Jul 2013 18:42:01 +0000 (18:42 +0000)]
Fix test not to fail when the target doesn't use leading underscores on symbols.

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

10 years agoCleanup testing case by using a shorter name for types.
Manman Ren [Tue, 16 Jul 2013 18:26:48 +0000 (18:26 +0000)]
Cleanup testing case by using a shorter name for types.

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

10 years agoRemove floats from live range splitting costs.
Jakob Stoklund Olesen [Tue, 16 Jul 2013 18:26:18 +0000 (18:26 +0000)]
Remove floats from live range splitting costs.

These floats all represented block frequencies anyway, so just use the
BlockFrequency class directly.

Some floating point computations remain in tryLocalSplit(). They are
estimating spill weights which are still floats.

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

10 years agoReapply r185393.
Jakob Stoklund Olesen [Tue, 16 Jul 2013 18:26:15 +0000 (18:26 +0000)]
Reapply r185393.

Original commit message:

Remove floating point computations from SpillPlacement.cpp.

Patch by Benjamin Kramer!

Use the BlockFrequency class instead of floats in the Hopfield network
computations. This rescales the node Bias field from a [-2;2] float
range to two block frequencies BiasN and BiasP pulling in opposite
directions. This construct has a more predictable behavior when block
frequencies saturate.

The per-node scaling factors are no longer necessary, assuming the block
frequencies around a bundle are consistent.

This patch can cause the register allocator to make different spilling
decisions. The differences should be small.

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

10 years ago[X86] Use min/max to optimze unsigend vector comparison on X86
Juergen Ributzka [Tue, 16 Jul 2013 18:20:45 +0000 (18:20 +0000)]
[X86] Use min/max to optimze unsigend vector comparison on X86

Use PMIN/PMAX for UGE/ULE vector comparions to reduce the number of required
instructions. This trick also works for UGT/ULT, but there is no advantage in
doing so. It wouldn't reduce the number of instructions and it would actually
reduce performance.

Reviewer: Ben

radar:5972691

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

10 years agoMake SpecialCaseList match full strings, as documented, using anchors.
Peter Collingbourne [Tue, 16 Jul 2013 17:56:07 +0000 (17:56 +0000)]
Make SpecialCaseList match full strings, as documented, using anchors.

Differential Revision: http://llvm-reviews.chandlerc.com/D1149

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

10 years agoTest commit to verify write access.
Juergen Ributzka [Tue, 16 Jul 2013 17:44:23 +0000 (17:44 +0000)]
Test commit to verify write access.

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

10 years ago[Support] Add a Unicode conversion wrapper from UTF16 to UTF8
Reid Kleckner [Tue, 16 Jul 2013 17:14:33 +0000 (17:14 +0000)]
[Support] Add a Unicode conversion wrapper from UTF16 to UTF8

This is to support parsing UTF16 response files in LLVM/lib/Option for
lld and clang.

Reviewers: hans

Differential Revision: http://llvm-reviews.chandlerc.com/D1138

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

10 years agoWhen the inliner merges allocas, it must keep the larger alignment
Hal Finkel [Tue, 16 Jul 2013 17:10:55 +0000 (17:10 +0000)]
When the inliner merges allocas, it must keep the larger alignment

For safety, the inliner cannot decrease the allignment on an alloca when
merging it with another.

I've included two variants of the test case for this: one with DataLayout
available, and one without. When DataLayout is not available, if only one of
the allocas uses the default alignment (getAlignment() == 0), then they cannot
be safely merged.

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

10 years agoOn error, close the temporary file descriptor.
Rafael Espindola [Tue, 16 Jul 2013 16:00:32 +0000 (16:00 +0000)]
On error, close the temporary file descriptor.

With this change llvm-ar can remove the temporary file on windows too.

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

10 years agoSLPVectorizer: Reduce the compile time of the consecutive store lookup.
Nadav Rotem [Tue, 16 Jul 2013 15:25:17 +0000 (15:25 +0000)]
SLPVectorizer: Reduce the compile time of the consecutive store lookup.

Process groups of stores in chunks of 16.

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

10 years agoCreate files with mode 666. This matches the behavior of other unix tools.
Rafael Espindola [Tue, 16 Jul 2013 14:10:07 +0000 (14:10 +0000)]
Create files with mode 666. This matches the behavior of other unix tools.

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

10 years ago[Support] Fix some warnings when self-hosting clang on Windows
Reid Kleckner [Tue, 16 Jul 2013 14:04:08 +0000 (14:04 +0000)]
[Support] Fix some warnings when self-hosting clang on Windows

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

10 years ago[APFloat] PR16573: Avoid losing mantissa bits in ppc_fp128 to double truncation
Ulrich Weigand [Tue, 16 Jul 2013 13:03:25 +0000 (13:03 +0000)]
[APFloat] PR16573: Avoid losing mantissa bits in ppc_fp128 to double truncation

When truncating to a format with fewer mantissa bits, APFloat::convert
will perform a right shift of the mantissa by the difference of the
precision of the two formats.  Usually, this will result in just the
mantissa bits needed for the target format.

One special situation is if the input number is denormal.  In this case,
the right shift may discard significant bits.  This is usually not a
problem, since truncating a denormal usually results in zero (underflow)
after normalization anyway, since the result format's exponent range is
usually smaller than the target format's.

However, there is one case where the latter property does not hold:
when truncating from ppc_fp128 to double.  In particular, truncating
a ppc_fp128 whose first double of the pair is denormal should result
in just that first double, not zero.  The current code however
performs an excessive right shift, resulting in lost result bits.
This is then caught in the APFloat::normalize call performed by
APFloat::convert and causes an assertion failure.

This patch checks for the scenario of truncating a denormal, and
attempts to (possibly partially) replace the initial mantissa
right shift by decrementing the exponent, if doing so will still
result in a valid *target format* exponent.

Index: test/CodeGen/PowerPC/pr16573.ll
===================================================================
--- test/CodeGen/PowerPC/pr16573.ll (revision 0)
+++ test/CodeGen/PowerPC/pr16573.ll (revision 0)
@@ -0,0 +1,11 @@
+; RUN: llc < %s | FileCheck %s
+
+target triple = "powerpc64-unknown-linux-gnu"
+
+define double @test() {
+  %1 = fptrunc ppc_fp128 0xM818F2887B9295809800000000032D000 to double
+  ret double %1
+}
+
+; CHECK: .quad -9111018957755033591
+
Index: lib/Support/APFloat.cpp
===================================================================
--- lib/Support/APFloat.cpp (revision 185817)
+++ lib/Support/APFloat.cpp (working copy)
@@ -1956,6 +1956,23 @@
     X86SpecialNan = true;
   }

+  // If this is a truncation of a denormal number, and the target semantics
+  // has larger exponent range than the source semantics (this can happen
+  // when truncating from PowerPC double-double to double format), the
+  // right shift could lose result mantissa bits.  Adjust exponent instead
+  // of performing excessive shift.
+  if (shift < 0 && isFiniteNonZero()) {
+    int exponentChange = significandMSB() + 1 - fromSemantics.precision;
+    if (exponent + exponentChange < toSemantics.minExponent)
+      exponentChange = toSemantics.minExponent - exponent;
+    if (exponentChange < shift)
+      exponentChange = shift;
+    if (exponentChange < 0) {
+      shift -= exponentChange;
+      exponent += exponentChange;
+    }
+  }
+
   // If this is a truncation, perform the shift before we narrow the storage.
   if (shift < 0 && (isFiniteNonZero() || category==fcNaN))
     lostFraction = shiftRight(significandParts(), oldPartCount, -shift);

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

10 years ago[XCore] Fix printing of inline asm operands.
Richard Osborne [Tue, 16 Jul 2013 12:48:34 +0000 (12:48 +0000)]
[XCore] Fix printing of inline asm operands.

Previously an asm operand with no operand modifier would give the error
"invalid operand in inline asm".

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

10 years agoARM: allow printing of ARM atomic DAG nodes.
Tim Northover [Tue, 16 Jul 2013 12:15:36 +0000 (12:15 +0000)]
ARM: allow printing of ARM atomic DAG nodes.

We'd forgotten to provide string representations for the special ARMISD atomic
nodes; this adds them in. No effect on CodeGen, just makes the output of
"-view-whatever-dags" slightly more readable.

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

10 years ago[SystemZ] Use ROSBG and non-zero form of RISBG for OR nodes
Richard Sandiford [Tue, 16 Jul 2013 11:55:57 +0000 (11:55 +0000)]
[SystemZ] Use ROSBG and non-zero form of RISBG for OR nodes

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

10 years agoFixing a buildbot failure:unused function.
Vladimir Medic [Tue, 16 Jul 2013 11:43:20 +0000 (11:43 +0000)]
Fixing a buildbot failure:unused function.

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

10 years ago[SystemZ] Add MC support for R[NOX]SBG
Richard Sandiford [Tue, 16 Jul 2013 11:28:08 +0000 (11:28 +0000)]
[SystemZ] Add MC support for R[NOX]SBG

CodeGen support will come later.

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

10 years ago[SystemZ] Use RISBG for (shift (and ...))
Richard Sandiford [Tue, 16 Jul 2013 11:02:24 +0000 (11:02 +0000)]
[SystemZ] Use RISBG for (shift (and ...))

Another patch in the series to make more use of R.SBG.  This one extends
r186072 and r186073 to handle cases where the AND is inside the shift.

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

10 years ago This patch represents Mips utilization of r186388 code that alows asm matcher to...
Vladimir Medic [Tue, 16 Jul 2013 10:07:14 +0000 (10:07 +0000)]
 This patch represents Mips utilization of r186388 code that alows asm matcher to emit mnemonics contain '.' characters. This makes asm parser code simpler and more efficient.

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

10 years agoPPCJITInfo.cpp: Tweak r186252 with s/__ppc/__powerpc/ to work on powerpc-linux Fedora 12.
NAKAMURA Takumi [Tue, 16 Jul 2013 09:59:51 +0000 (09:59 +0000)]
PPCJITInfo.cpp: Tweak r186252 with s/__ppc/__powerpc/ to work on powerpc-linux Fedora 12.

    g++ (GCC) 4.4.4 20100630 (Red Hat 4.4.4-10)

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

10 years agoARM: implement ldrex, strex and clrex intrinsics
Tim Northover [Tue, 16 Jul 2013 09:46:55 +0000 (09:46 +0000)]
ARM: implement ldrex, strex and clrex intrinsics

Intrinsics already existed for the 64-bit variants, so these support operations
of size at most 32-bits.

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

10 years agoARM EABI divmod support
Renato Golin [Tue, 16 Jul 2013 09:32:17 +0000 (09:32 +0000)]
ARM EABI divmod support

This patch enables calls to __aeabi_idivmod when in EABI mode,
by using the remainder value returned on registers (R1),
enabled by the ARM triple "none-eabi". Note that Darwin and
GNUEABI triples will continue lowering on GNU style, that is,
using the stack for the remainder.

Still need to add SREM/UREM support fix for 64-bit lowering.

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

10 years agoThis patch allows targets to define weather the instruction mnemonics in asm matcher...
Vladimir Medic [Tue, 16 Jul 2013 09:22:38 +0000 (09:22 +0000)]
This patch allows targets to define weather the instruction mnemonics in asm matcher tables will contain '.' character.

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

10 years agollvm/test/Object/directory.ll: Mark it as XFAIL:cygwin. Directories can be opened...
NAKAMURA Takumi [Tue, 16 Jul 2013 09:06:47 +0000 (09:06 +0000)]
llvm/test/Object/directory.ll: Mark it as XFAIL:cygwin. Directories can be opened on cygwin.

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

10 years agoUse open+fstat instead of stat+open.
Rafael Espindola [Tue, 16 Jul 2013 03:34:31 +0000 (03:34 +0000)]
Use open+fstat instead of stat+open.

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

10 years agoRemember that we have a null terminated string.
Rafael Espindola [Tue, 16 Jul 2013 03:30:10 +0000 (03:30 +0000)]
Remember that we have a null terminated string.

This is a micro optimization. Instead of going char*->StringRef->Twine->char*,
go char*->Twine->char* and avoid having to copy the filename on the stack.

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

10 years ago[Object/COFF] Add import_directory_table_entry.
Rui Ueyama [Tue, 16 Jul 2013 03:23:55 +0000 (03:23 +0000)]
[Object/COFF] Add import_directory_table_entry.

Summary: Add import_directory_table_entry to use for .idata section.

Reviewers: Bigcheese

CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1059

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

10 years agoAdd a version of sys::fs::status that uses fstat.
Rafael Espindola [Tue, 16 Jul 2013 03:20:13 +0000 (03:20 +0000)]
Add a version of sys::fs::status that uses fstat.

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

10 years agoCOFF: Add constants for optional data directory.
Rui Ueyama [Tue, 16 Jul 2013 03:11:55 +0000 (03:11 +0000)]
COFF: Add constants for optional data directory.

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

10 years agoInstead friending status, provide windows and posix constructors to file_status.
Rafael Espindola [Tue, 16 Jul 2013 02:55:33 +0000 (02:55 +0000)]
Instead friending status, provide windows and posix constructors to file_status.

This opens the way of having static helpers in the .inc files that can
construct a file_status.

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

10 years agounittests/Support: Add TimeValue.Win32FILETIME, corresponding to r186374.
NAKAMURA Takumi [Tue, 16 Jul 2013 02:44:23 +0000 (02:44 +0000)]
unittests/Support: Add TimeValue.Win32FILETIME, corresponding to r186374.

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

10 years agoFix TimeValue::toWin32Time() to be symmetric to fromWin32Time() and compatible to...
NAKAMURA Takumi [Tue, 16 Jul 2013 02:43:51 +0000 (02:43 +0000)]
Fix TimeValue::toWin32Time() to be symmetric to fromWin32Time() and compatible to Win32's FILETIME.

llvm-ar is the only user of toWin32Time() (via setLastModificationAndAccessTime), and r186298 can be reverted.
It had been buggy since the initial commit.

FIXME: Could we rename {from|to}Win32Time as {from|to}Win32FILETIME in TimeValue?

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

10 years agoRename Support.TimeValue to TimeValue.time_t in unittests/Support.
NAKAMURA Takumi [Tue, 16 Jul 2013 02:03:32 +0000 (02:03 +0000)]
Rename Support.TimeValue to TimeValue.time_t in unittests/Support.

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

10 years agoAdd 'const' qualifiers to static const char* variables.
Craig Topper [Tue, 16 Jul 2013 01:17:10 +0000 (01:17 +0000)]
Add 'const' qualifiers to static const char* variables.

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

10 years agoAdd mingw32 to the XFAIL. I forgot about it when adding win32.
Rafael Espindola [Mon, 15 Jul 2013 23:51:47 +0000 (23:51 +0000)]
Add mingw32 to the XFAIL. I forgot about it when adding win32.

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

10 years agoPEI: Support for non-zero SPAdj at beginning of a basic block.
Manman Ren [Mon, 15 Jul 2013 23:47:29 +0000 (23:47 +0000)]
PEI: Support for non-zero SPAdj at beginning of a basic block.

We can have a FrameSetup in one basic block and the matching FrameDestroy
in a different basic block when we have struct byval. In that case, SPAdj
is not zero at beginning of the basic block.

Modify PEI to correctly set SPAdj at beginning of each basic block using
DFS traversal. We used to assume SPAdj is 0 at beginning of each basic block.

PEI had an assert SPAdjCount || SPAdj == 0.
If we have a Destroy <n> followed by a Setup <m>, PEI will assert failure.
We can add an extra condition to make sure the pairs are matched:
  The pairs start with a FrameSetup.
But since we are doing a much better job in the verifier, this patch removes
the check in PEI.

PR16393

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

10 years agoPR16628: Fix a bug in the code that merges compares.
Nadav Rotem [Mon, 15 Jul 2013 22:52:48 +0000 (22:52 +0000)]
PR16628: Fix a bug in the code that merges compares.
Compares return i1 but they compare different types.

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

10 years agoPPC: Refactoring to support subtarget feature changing
Hal Finkel [Mon, 15 Jul 2013 22:29:40 +0000 (22:29 +0000)]
PPC: Refactoring to support subtarget feature changing

This change mirrors the changes that were made to the X86 and ARM targets to
support subtarget feature changing. As indicated in r182899, the mechanism is
still undergoing revision, and so as with the X86 and ARM targets, there is no
test case yet (there is no effective functionality change).

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

10 years agoFurther simplify test case from r186119/r186035.
David Blaikie [Mon, 15 Jul 2013 22:28:45 +0000 (22:28 +0000)]
Further simplify test case from r186119/r186035.

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

10 years agoXFAIL on windows too and document the XFAILs.
Rafael Espindola [Mon, 15 Jul 2013 22:16:53 +0000 (22:16 +0000)]
XFAIL on windows too and document the XFAILs.

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

10 years agoMachine Verifier: verify FrameSetup and FrameDestroy
Manman Ren [Mon, 15 Jul 2013 21:26:31 +0000 (21:26 +0000)]
Machine Verifier: verify FrameSetup and FrameDestroy

1> on every path through the CFG, a FrameSetup <n> is always followed by a
   FrameDestroy <n> and a FrameDestroy is always followed by a FrameSetup.
2> stack adjustments are identical on all CFG edges to a merge point.
3> frame is destroyed at end of a return block.

PR16393

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

10 years agoRemove an extra is_directory call.
Rafael Espindola [Mon, 15 Jul 2013 20:52:01 +0000 (20:52 +0000)]
Remove an extra is_directory call.

I checked that opening a directory on windows does fail, so this saves a "stat".

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

10 years agoFix register subclass handling in PPCInstrInfo::insertSelect
Hal Finkel [Mon, 15 Jul 2013 20:22:58 +0000 (20:22 +0000)]
Fix register subclass handling in PPCInstrInfo::insertSelect

PPCInstrInfo::insertSelect and PPCInstrInfo::canInsertSelect were computing the
common subclass of the true and false inputs, and then selecting either the
32-bit or the 64-bit isel variant based on the result of calling
PPC::GPRCRegClass.hasSubClassEq(RC) and PPC::G8RCRegClass.hasSubClassEq(RC)
(where RC is the common subclass). Unfortunately, this is not quite right: if
we have something like this:

  %vreg8<def> = SELECT_CC_I8 %vreg4<kill>, %vreg7<kill>, %vreg6<kill>, 76;
    G8RC_and_G8RC_NOX0:%vreg8 CRRC:%vreg4 G8RC_NOX0:%vreg7,%vreg6

then the common subclass of G8RC_and_G8RC_NOX0 and G8RC_NOX0 is G8RC_NOX0, and
G8RC_NOX0 is not a subclass of G8RC (because it also contains the ZERO8
pseudo-register). As a result, we also need to check the common subclass
against GPRC_NOR0 and G8RC_NOX0 explicitly.

This had not been a problem for clients of insertSelect that called
canInsertSelect first (because it had a compensating mistake), but insertSelect
is also used by the PPC pseudo-instruction expander, and this error was causing
a problem in that context.

This problem was found by csmith.

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

10 years ago[mc-coff] Resolve aliases when emitting COFF relocations
Reid Kleckner [Mon, 15 Jul 2013 19:41:21 +0000 (19:41 +0000)]
[mc-coff] Resolve aliases when emitting COFF relocations

This is consistent with the ELF object writer.

Add some COFF tests that relocate against an alias.

Reviewers: espindola

Differential Revision: http://llvm-reviews.chandlerc.com/D1079

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

10 years agoR600/SI: Add support for 64-bit loads
Tom Stellard [Mon, 15 Jul 2013 19:00:09 +0000 (19:00 +0000)]
R600/SI: Add support for 64-bit loads

https://bugs.freedesktop.org/show_bug.cgi?id=65873

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

10 years agoRemove invalid assert in DAGTypeLegalizer::RemapValue
Hal Finkel [Mon, 15 Jul 2013 18:57:05 +0000 (18:57 +0000)]
Remove invalid assert in DAGTypeLegalizer::RemapValue

There is a comment at the top of DAGTypeLegalizer::PerformExpensiveChecks
which, in part, says:

  // Note that these invariants may not hold momentarily when processing a node:
  // the node being processed may be put in a map before being marked Processed.

Unfortunately, this assert would be valid only if the above-mentioned invariant
held unconditionally. This was causing llc to assert when, in fact,
everything was fine.

Thanks to Richard Sandiford for investigating this issue!

Fixes PR16562.

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

10 years agoRemove trailing whitespace
Stephen Lin [Mon, 15 Jul 2013 17:55:02 +0000 (17:55 +0000)]
Remove trailing whitespace

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

10 years agoRevert r186316 while I track down an ASan failure and an assert from
Chandler Carruth [Mon, 15 Jul 2013 17:36:21 +0000 (17:36 +0000)]
Revert r186316 while I track down an ASan failure and an assert from
a bot.

This reverts the commit which introduced a new implementation of the
fancy SROA pass designed to reduce its overhead. I'll skip the huge
commit log here, refer to r186316 if you're looking for how this all
works and why it works that way.

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

10 years agoTeaching llvm-tblgen to not emit a switch statement when there are no case statements.
Aaron Ballman [Mon, 15 Jul 2013 16:53:32 +0000 (16:53 +0000)]
Teaching llvm-tblgen to not emit a switch statement when there are no case statements.

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

10 years agoRevert "[Option] Store arg strings in a set backed by a BumpPtrAllocator"
Reid Kleckner [Mon, 15 Jul 2013 16:40:52 +0000 (16:40 +0000)]
Revert "[Option] Store arg strings in a set backed by a BumpPtrAllocator"

This broke clang's crash-report.c test, and I haven't been able to
figure it out yet.

This reverts commit r186319.

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

10 years agoTest commit to see if write access works.
Job Noorman [Mon, 15 Jul 2013 14:25:26 +0000 (14:25 +0000)]
Test commit to see if write access works.

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

10 years ago[Option] Store arg strings in a set backed by a BumpPtrAllocator
Reid Kleckner [Mon, 15 Jul 2013 13:46:24 +0000 (13:46 +0000)]
[Option] Store arg strings in a set backed by a BumpPtrAllocator

No functionality change.

This is preparing to move response file parsing into lib/Option so it
can be shared between clang and lld.  This change isn't just a
micro-optimization.  Clang's driver uses a std::set<std::string> to
unique arguments while parsing response files, so this matches that.

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

10 years agoXFAIL this on freebsd to bring the bot back.
Rafael Espindola [Mon, 15 Jul 2013 12:18:30 +0000 (12:18 +0000)]
XFAIL this on freebsd to bring the bot back.

Joerg Sonnenberger tells me one can open a directory in freebsd. I will try
to centralize our calls to open so that we can handle O_BINARY in one place,
and will then handle this there too.

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

10 years agoReimplement SROA yet again. Same fundamental principle, but a totally
Chandler Carruth [Mon, 15 Jul 2013 10:30:19 +0000 (10:30 +0000)]
Reimplement SROA yet again. Same fundamental principle, but a totally
different core implementation strategy.

Previously, SROA would build a relatively elaborate partitioning of an
alloca, associate uses with each partition, and then rewrite the uses of
each partition in an attempt to break apart the alloca into chunks that
could be promoted. This was very wasteful in terms of memory and compile
time because regardless of how complex the alloca or how much we're able
to do in breaking it up, all of the datastructure work to analyze the
partitioning was done up front.

The new implementation attempts to form partitions of the alloca lazily
and on the fly, rewriting the uses that make up that partition as it
goes. This has a few significant effects:
1) Much simpler data structures are used throughout.
2) No more double walk of the recursive use graph of the alloca, only
   walk it once.
3) No more complex algorithms for associating a particular use with
   a particular partition.
4) PHI and Select speculation is simplified and happens lazily.
5) More precise information is available about a specific use of the
   alloca, removing the need for some side datastructures.

Ultimately, I think this is a much better implementation. It removes
about 300 lines of code, but arguably removes more like 500 considering
that some code grew in the process of being factored apart and cleaned
up for this all to work.

I've re-used as much of the old implementation as possible, which
includes the lion's share of code in the form of the rewriting logic.
The interesting new logic centers around how the uses of a partition are
sorted, and split into actual partitions.

Each instruction using a pointer derived from the alloca gets
a 'Partition' entry. This name is totally wrong, but I'll do a rename in
a follow-up commit as there is already enough churn here. The entry
describes the offset range accessed and the nature of the access. Once
we have all of these entries we sort them in a very specific way:
increasing order of begin offset, followed by whether they are
splittable uses (memcpy, etc), followed by the end offset or whatever.
Sorting by splittability is important as it simplifies the collection of
uses into a partition.

Once we have these uses sorted, we walk from the beginning to the end
building up a range of uses that form a partition of the alloca.
Overlapping unsplittable uses are merged into a single partition while
splittable uses are broken apart and carried from one partition to the
next. A partition is also introduced to bridge splittable uses between
the unsplittable regions when necessary.

I've looked at the performance PRs fairly closely. PR15471 no longer
will even load (the module is invalid). Not sure what is up there.
PR15412 improves by between 5% and 10%, however it is nearly impossible
to know what is holding it up as SROA (the entire pass) takes less time
than reading the IR for that test case. The analysis takes the same time
as running mem2reg on the final allocas. I suspect (without much
evidence) that the new implementation will scale much better however,
and it is just the small nature of the test cases that makes the changes
small and noisy. Either way, it is still simpler and cleaner I think.

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

10 years agoDebugInfo: Factor out parsing compile unit DIEs to a separate function. Improve code...
Alexey Samsonov [Mon, 15 Jul 2013 08:43:35 +0000 (08:43 +0000)]
DebugInfo: Factor out parsing compile unit DIEs to a separate function. Improve code style and comments.

No functionality change.

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

10 years agoAdd 'const' qualifier to some arrays.
Craig Topper [Mon, 15 Jul 2013 08:02:13 +0000 (08:02 +0000)]
Add 'const' qualifier to some arrays.

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

10 years agoMake some arrays 'static const'
Craig Topper [Mon, 15 Jul 2013 07:22:00 +0000 (07:22 +0000)]
Make some arrays 'static const'

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

10 years agoAdd include to hopefully fix windows build.
Craig Topper [Mon, 15 Jul 2013 07:15:05 +0000 (07:15 +0000)]
Add include to hopefully fix windows build.

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

10 years agoAdd const qualifier to some static arrays.
Craig Topper [Mon, 15 Jul 2013 07:02:45 +0000 (07:02 +0000)]
Add const qualifier to some static arrays.

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

10 years agoAdd 'static' keyword to some const arrays for consistency.
Craig Topper [Mon, 15 Jul 2013 06:54:12 +0000 (06:54 +0000)]
Add 'static' keyword to some const arrays for consistency.

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

10 years agoMake some arrays 'static const'
Craig Topper [Mon, 15 Jul 2013 06:39:13 +0000 (06:39 +0000)]
Make some arrays 'static const'

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

10 years agoRevert part of 186302 to fix buildbots.
Craig Topper [Mon, 15 Jul 2013 04:37:54 +0000 (04:37 +0000)]
Revert part of 186302 to fix buildbots.

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

10 years agoUse llvm::array_lengthof to replace sizeof(array)/sizeof(array[0]).
Craig Topper [Mon, 15 Jul 2013 04:27:47 +0000 (04:27 +0000)]
Use llvm::array_lengthof to replace sizeof(array)/sizeof(array[0]).

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

10 years agoMark llvm/test/Object/extract.ll as XFAIL:mingw32, for now.
NAKAMURA Takumi [Mon, 15 Jul 2013 03:04:13 +0000 (03:04 +0000)]
Mark llvm/test/Object/extract.ll as XFAIL:mingw32, for now.

FIXME: Investigate Win32's TimeValue stuff!

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

10 years agoClarify comments.
Eric Christopher [Sun, 14 Jul 2013 22:23:54 +0000 (22:23 +0000)]
Clarify comments.

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

10 years agoAdd DW_AT_GNU_odr_signature to the set of dwarf attributes.
Eric Christopher [Sun, 14 Jul 2013 22:02:31 +0000 (22:02 +0000)]
Add DW_AT_GNU_odr_signature to the set of dwarf attributes.

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

10 years agoCollapse temporary variable into call.
Eric Christopher [Sun, 14 Jul 2013 21:46:51 +0000 (21:46 +0000)]
Collapse temporary variable into call.

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

10 years agoUse conventional syntax for branches.
Anton Korobeynikov [Sun, 14 Jul 2013 18:19:44 +0000 (18:19 +0000)]
Use conventional syntax for branches.
Patch by Job!

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

10 years agoCorrect inaccurate statement in FileCheck docs.
Stephen Lin [Sun, 14 Jul 2013 18:12:25 +0000 (18:12 +0000)]
Correct inaccurate statement in FileCheck docs.

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

10 years agoProperly lower jump tables on MSP430. Patch by Job Noorman!
Anton Korobeynikov [Sun, 14 Jul 2013 15:11:00 +0000 (15:11 +0000)]
Properly lower jump tables on MSP430. Patch by Job Noorman!

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

10 years agoThe archive update test has a subtle race condition in it: if the test
Chandler Carruth [Sun, 14 Jul 2013 10:46:51 +0000 (10:46 +0000)]
The archive update test has a subtle race condition in it: if the test
is executed within the same second as the inputs for the test are
checked out from the source tree, it will fail to update due to being
below the resolution of the 'mtime' test used.

Now, this may seem improbably to you... ok, maybe *really* improbable,
but consider a system which does distributed execution of tests by
shipping their inputs to another machine and runs them. That might cause
the mtime to be quite recent during the test run. ;]

Instead, create two files directly in the test (allowing all platforms
to see the problem) and add either a use of the 'touch' command that
forces one mtime to some time quite a bit in the past, or it sleeps for
just over a second to be outside of the precision window.

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

10 years agoMass update to CodeGen tests to use CHECK-LABEL for labels corresponding to function...
Stephen Lin [Sun, 14 Jul 2013 06:24:09 +0000 (06:24 +0000)]
Mass update to CodeGen tests to use CHECK-LABEL for labels corresponding to function definitions for more informative error messages. No functionality change and all updated tests passed locally.

This update was done with the following bash script:

  find test/CodeGen -name "*.ll" | \
  while read NAME; do
    echo "$NAME"
    if ! grep -q "^; *RUN: *llc.*debug" $NAME; then
      TEMP=`mktemp -t temp`
      cp $NAME $TEMP
      sed -n "s/^define [^@]*@\([A-Za-z0-9_]*\)(.*$/\1/p" < $NAME | \
      while read FUNC; do
        sed -i '' "s/;\(.*\)\([A-Za-z0-9_-]*\):\( *\)$FUNC: *\$/;\1\2-LABEL:\3$FUNC:/g" $TEMP
      done
      sed -i '' "s/;\(.*\)-LABEL-LABEL:/;\1-LABEL:/" $TEMP
      sed -i '' "s/;\(.*\)-NEXT-LABEL:/;\1-NEXT:/" $TEMP
      sed -i '' "s/;\(.*\)-NOT-LABEL:/;\1-NOT:/" $TEMP
      sed -i '' "s/;\(.*\)-DAG-LABEL:/;\1-DAG:/" $TEMP
      mv $TEMP $NAME
    fi
  done

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

10 years agoSLPVectorizer: change the order in which we search for vectorization candidates....
Nadav Rotem [Sun, 14 Jul 2013 06:15:46 +0000 (06:15 +0000)]
SLPVectorizer: change the order in which we search for vectorization candidates. Do stores first and PHIs second.

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

10 years agoFix build by replacing '>>' with '> >'
Tobias Grosser [Sun, 14 Jul 2013 06:12:01 +0000 (06:12 +0000)]
Fix build by replacing '>>' with '> >'

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

10 years agoUse SmallVectorImpl& instead of SmallVector to avoid repeating small vector size.
Craig Topper [Sun, 14 Jul 2013 04:42:23 +0000 (04:42 +0000)]
Use SmallVectorImpl& instead of SmallVector to avoid repeating small vector size.

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

10 years agoRemove a bunch of old SCEVExpander FIXME's for preserving NoWrap.
Andrew Trick [Sun, 14 Jul 2013 03:10:08 +0000 (03:10 +0000)]
Remove a bunch of old SCEVExpander FIXME's for preserving NoWrap.

The great thing about the SCEVAddRec No-Wrap flag (unlike nsw/nuw) is
that is can be preserved while normalizing (reassociating and
factoring).

The bad thing is that is can't be tranfered back to IR, which is one
of the reasons I don't like the concept of SCEVExpander.

Sorry, I can't think of a direct way to test this, which is why these
were FIXMEs for so long. I just think it's a good time to finally
clean it up.

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

10 years agoTeach indvars to generate nsw/nuw flags when widening an induction variable.
Andrew Trick [Sun, 14 Jul 2013 02:50:07 +0000 (02:50 +0000)]
Teach indvars to generate nsw/nuw flags when widening an induction variable.

Fixes PR16600.

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