oota-llvm.git
11 years agoFix the build with c++03.
Rafael Espindola [Fri, 12 Jul 2013 20:28:02 +0000 (20:28 +0000)]
Fix the build with c++03.

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

11 years agoChange llvm-ar to use lib/Object.
Rafael Espindola [Fri, 12 Jul 2013 20:21:39 +0000 (20:21 +0000)]
Change llvm-ar to use lib/Object.

This fixes two bugs is lib/Object that the use in llvm-ar found:
* In OS X created archives, the name can be padded with nulls. Strip them.
* In the constructor, remember the first non special member and use that in
  begin_children. This makes sure we skip all special members, not just the
  first one.

The change to llvm-ar itself consist of
* Using lib/Object for reading archives instead of ArchiveReader.cpp.
* Writing the modified archive directly, instead of creating an in memory
  representation.

The old Archive library was way more general than what is needed, as can
be seen by the diffstat of this patch.

Having llvm-ar using lib/Object now opens the way for creating regular symbol
tables for both native objects and bitcode files so that we can use those
archives for LTO.

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

11 years agoR600: Remove unsafe type punning. No intended functionality change.
Benjamin Kramer [Fri, 12 Jul 2013 20:18:05 +0000 (20:18 +0000)]
R600: Remove unsafe type punning. No intended functionality change.

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

11 years agoAdd a test for llvm-ar's u option.
Rafael Espindola [Fri, 12 Jul 2013 19:34:24 +0000 (19:34 +0000)]
Add a test for llvm-ar's u option.

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

11 years agoR600: Remove the fpconst64.ll test which was failing on non-x86 buildbots
Tom Stellard [Fri, 12 Jul 2013 19:29:54 +0000 (19:29 +0000)]
R600: Remove the fpconst64.ll test which was failing on non-x86 buildbots

I'm guessing the failure had something to do with the double precision
floating point constant used in the test.

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

11 years agoX86 cost model: Add cost for vectorized gather/scather
Arnold Schwaighofer [Fri, 12 Jul 2013 19:16:07 +0000 (19:16 +0000)]
X86 cost model: Add cost for vectorized gather/scather

radar://14351991

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

11 years agoARM cost model: Add cost for gather/scather
Arnold Schwaighofer [Fri, 12 Jul 2013 19:16:04 +0000 (19:16 +0000)]
ARM cost model: Add cost for gather/scather

Fixes a 35% degradation compared to unvectorized code in
MiBench/automotive-susan and an equally serious regression on a private
image processing benchmark.

radar://14351991

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

11 years agoTargetTransformInfo: address calculation parameter for gather/scather
Arnold Schwaighofer [Fri, 12 Jul 2013 19:16:02 +0000 (19:16 +0000)]
TargetTransformInfo: address calculation parameter for gather/scather

Address calculation for gather/scather in vectorized code can incur a
significant cost making vectorization unbeneficial. Add infrastructure to add
cost.
Tests and cost model for targets will be in follow-up commits.

radar://14351991

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

11 years agoRelax the test a bit more to handle different UIDs and GIDs.
Rafael Espindola [Fri, 12 Jul 2013 19:13:16 +0000 (19:13 +0000)]
Relax the test a bit more to handle different UIDs and GIDs.

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

11 years agoRelax test a bit to handle umask differences.
Rafael Espindola [Fri, 12 Jul 2013 18:54:28 +0000 (18:54 +0000)]
Relax test a bit to handle umask differences.

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

11 years agoAdd a test for the 'o' option in llvm-ar.
Rafael Espindola [Fri, 12 Jul 2013 18:51:25 +0000 (18:51 +0000)]
Add a test for the 'o' option in llvm-ar.

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

11 years agoR600/SI: Add support for f64 kernel arguments
Tom Stellard [Fri, 12 Jul 2013 18:15:26 +0000 (18:15 +0000)]
R600/SI: Add support for f64 kernel arguments

Patch by: Niels Ole Salscheider

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186182 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600/SI: Implement select and compares for SI
Tom Stellard [Fri, 12 Jul 2013 18:15:19 +0000 (18:15 +0000)]
R600/SI: Implement select and compares for SI

Patch by: Niels Ole Salscheider

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186181 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600/SI: Add fsqrt pattern for SI
Tom Stellard [Fri, 12 Jul 2013 18:15:13 +0000 (18:15 +0000)]
R600/SI: Add fsqrt pattern for SI

Patch by: Niels Ole Salscheider

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186180 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600/SI: Add double precision fsub pattern for SI
Tom Stellard [Fri, 12 Jul 2013 18:15:08 +0000 (18:15 +0000)]
R600/SI: Add double precision fsub pattern for SI

Patch by: Niels Ole Salscheider

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186179 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600/SI: SI support for 64bit ConstantFP
Tom Stellard [Fri, 12 Jul 2013 18:15:02 +0000 (18:15 +0000)]
R600/SI: SI support for 64bit ConstantFP

Patch by: Niels Ole Salscheider

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186178 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600/SI: Add initial double precision support for SI
Tom Stellard [Fri, 12 Jul 2013 18:14:56 +0000 (18:14 +0000)]
R600/SI: Add initial double precision support for SI

Patch by: Niels Ole Salscheider

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186177 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600: Add ISA documents to the CompilerWriterInfo page
Tom Stellard [Fri, 12 Jul 2013 18:14:40 +0000 (18:14 +0000)]
R600: Add ISA documents to the CompilerWriterInfo page

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

11 years agoFixed comment in header of Block Frequency Impl and added text for C++ mode.
Michael Gottesman [Fri, 12 Jul 2013 18:11:14 +0000 (18:11 +0000)]
Fixed comment in header of Block Frequency Impl and added text for C++ mode.

This is a generic block implementation that works on more than machine blocks.
The C++ mode addition is a bonus due to the extra space provided.

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

11 years agoX86: Shrink certain forms of movsx.
Benjamin Kramer [Fri, 12 Jul 2013 18:06:44 +0000 (18:06 +0000)]
X86: Shrink certain forms of movsx.

In particular:
movsbw %al, %ax   --> cbtw
movswl %ax, %eax  --> cwtl
movslq %eax, %rax --> cltq

According to Intel's manual those have the same performance characteristics but
come with a smaller encoding.

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

11 years agoAdd static.
Rafael Espindola [Fri, 12 Jul 2013 16:29:27 +0000 (16:29 +0000)]
Add static.

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

11 years agoX86: fold SSE2/AVX2 logical shift by immediate amount into zero vector when possible
Stephen Lin [Fri, 12 Jul 2013 15:31:36 +0000 (15:31 +0000)]
X86: fold SSE2/AVX2 logical shift by immediate amount into zero vector when possible

Patch by Andrea Di Biagio

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

11 years agoStart using CHECK-LABEL in some tests.
Stephen Lin [Fri, 12 Jul 2013 14:54:12 +0000 (14:54 +0000)]
Start using CHECK-LABEL in some tests.

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

11 years agoAdd new directive called CHECK-LABEL to FileCheck.
Stephen Lin [Fri, 12 Jul 2013 14:51:05 +0000 (14:51 +0000)]
Add new directive called CHECK-LABEL to FileCheck.

CHECK-LABEL is meant to be used in place on CHECK on lines containing identifiers or other unique labels (they need not actually be labels in the source or output language, though.) This is used to break up the input stream into separate blocks delineated by CHECK-LABEL lines, each of which is checked independently. This greatly improves the accuracy of errors and fix-it hints in many cases, and allows for FileCheck to recover from errors in one block by continuing to subsequent blocks.

Some tests will be converted to use this new directive in forthcoming patches.

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

11 years agoDon't reject an empty archive.
Rafael Espindola [Fri, 12 Jul 2013 13:32:28 +0000 (13:32 +0000)]
Don't reject an empty archive.

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

11 years agoMark MDNode::getOperand as readonly.
Benjamin Kramer [Fri, 12 Jul 2013 12:05:13 +0000 (12:05 +0000)]
Mark MDNode::getOperand as readonly.

We can't inline it but we can still CSE calls to it.

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

11 years agoRevert "indvars: Improve LFTR by eliminating truncation when comparing
Chandler Carruth [Fri, 12 Jul 2013 11:18:55 +0000 (11:18 +0000)]
Revert "indvars: Improve LFTR by eliminating truncation when comparing
against a constant."

This reverts commit r186107. It didn't handle wrapping arithmetic in the
loop correctly and thus caused the following C program to count from
0 to UINT64_MAX instead of from 0 to 255 as intended:

  #include <stdio.h>
  int main() {
    unsigned char first = 0, last = 255;
    do { printf("%d\n", first); } while (first++ != last);
  }

Full test case and instructions to reproduce with just the -indvars pass
sent to the original review thread rather than to r186107's commit.

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

11 years agoAdd support for Mips break and syscall insructions. The corresponding test cases...
Vladimir Medic [Fri, 12 Jul 2013 09:25:35 +0000 (09:25 +0000)]
Add support for Mips break and syscall insructions. The corresponding test cases are added.

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

11 years ago[SystemZ] Add test missing from r186148
Richard Sandiford [Fri, 12 Jul 2013 09:20:14 +0000 (09:20 +0000)]
[SystemZ] Add test missing from r186148

Sigh, twice in two days sorry.  One day I'll remember...

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

11 years ago[SystemZ] Optimize sign-extends of vector setccs
Richard Sandiford [Fri, 12 Jul 2013 09:17:10 +0000 (09:17 +0000)]
[SystemZ] Optimize sign-extends of vector setccs

Normal (sext (setcc ...)) sequences are optimised into
(select_cc ..., -1, 0) by DAGCombiner::visitSIGN_EXTEND.
However, this is deliberately not done for vectors, and after
vector type legalization we have (sext_inreg (setcc ...)) instead.

I wondered about trying to extend DAGCombiner to handle this case too,
but it seemed to be a loss on some other targets I tried, even those for
which SETCC isn't "legal" and SELECT_CC is.

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

11 years ago[SystemZ] Fix parsing of inline asm registers
Richard Sandiford [Fri, 12 Jul 2013 09:08:12 +0000 (09:08 +0000)]
[SystemZ] Fix parsing of inline asm registers

GPR and FPR constraints like "{r2}" and "{f2}" weren't handled correctly
because the name-to-regno mapping depends on the value type and
(because of that) the internal names in RegStrings are not the
same as the AsmName.

CC constraints like "{cc}" didn't work either because there was no
associated register class.

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

11 years ago[SystemZ] Improve spilling of LGDR and LDGR
Richard Sandiford [Fri, 12 Jul 2013 08:37:17 +0000 (08:37 +0000)]
[SystemZ] Improve spilling of LGDR and LDGR

If the source of these instructions is spilled we should load the destination.
If the destination is spilled we should store the source.

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

11 years agoStylistic change.
Shuxin Yang [Fri, 12 Jul 2013 07:25:38 +0000 (07:25 +0000)]
Stylistic change.

Thank Nick for figuring out these problems.

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

11 years agoSLPVectorizer: Sink and enable CSE for ExtractElements.
Nadav Rotem [Fri, 12 Jul 2013 06:09:24 +0000 (06:09 +0000)]
SLPVectorizer: Sink and enable CSE for ExtractElements.

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

11 years agoTarget/X86: Add explicit Win64 and System V/x86-64 calling conventions.
Charles Davis [Fri, 12 Jul 2013 06:02:35 +0000 (06:02 +0000)]
Target/X86: Add explicit Win64 and System V/x86-64 calling conventions.

Summary:
This patch adds explicit calling convention types for the Win64 and
System V/x86-64 ABIs. This allows code to override the default, and use
the Win64 convention on a target that wants to use SysV (and
vice-versa). This is needed to implement the `ms_abi` and `sysv_abi` GNU
attributes.

Reviewers:

CC:

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

11 years agollvm/test/Object/archive-toc.test: Use env(1) to satisfy win32 hosts.
NAKAMURA Takumi [Fri, 12 Jul 2013 02:34:45 +0000 (02:34 +0000)]
llvm/test/Object/archive-toc.test: Use env(1) to satisfy win32 hosts.

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

11 years agoWindows/TimeValue.inc: Mute prefixed '0' on %d to emulate %e.
NAKAMURA Takumi [Fri, 12 Jul 2013 02:13:03 +0000 (02:13 +0000)]
Windows/TimeValue.inc: Mute prefixed '0' on %d to emulate %e.

It fixes compatibility in llvm/test/Object/archive-toc.test.

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

11 years agoPEI: refactor replaceFrameIndices(MF) to call replaceFrameIndices(BB).
Manman Ren [Fri, 12 Jul 2013 00:37:01 +0000 (00:37 +0000)]
PEI: refactor replaceFrameIndices(MF) to call replaceFrameIndices(BB).

replaceFrameIndices(MF) will iterate over the BBs and call
replaceFrameIndices(BB). No functionality change.

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

11 years agoSLPVectorize: Replace the code that checks for vectorization candidates in successor...
Nadav Rotem [Fri, 12 Jul 2013 00:04:18 +0000 (00:04 +0000)]
SLPVectorize: Replace the code that checks for vectorization candidates in successor blocks with code that scans PHINodes.
Before we could vectorize PHINodes scanning successors was a good way of finding candidates. Now we can vectorize the phinodes which is simpler.

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

11 years agoAdd the ability to use guarded malloc when running llvm lit tests.
David Dean [Thu, 11 Jul 2013 23:36:57 +0000 (23:36 +0000)]
Add the ability to use guarded malloc when running llvm lit tests.

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

11 years agollvm-ar: Clean up memory management with OwningPtr.
Benjamin Kramer [Thu, 11 Jul 2013 23:15:05 +0000 (23:15 +0000)]
llvm-ar: Clean up memory management with OwningPtr.

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

11 years agoSync SmallBitVector with BitVector. Add unit tests for the missing methods.
Benjamin Kramer [Thu, 11 Jul 2013 21:59:16 +0000 (21:59 +0000)]
Sync SmallBitVector with BitVector. Add unit tests for the missing methods.

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

11 years agoFixed up comments in TargetLowering.h to conform to the LLVM Style Guide.
Michael Gottesman [Thu, 11 Jul 2013 21:38:33 +0000 (21:38 +0000)]
Fixed up comments in TargetLowering.h to conform to the LLVM Style Guide.

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

11 years agoIn response to dblaikie's comment on r186035, replacing the
Adrian Prantl [Thu, 11 Jul 2013 21:16:14 +0000 (21:16 +0000)]
In response to dblaikie's comment on r186035, replacing the
(reduced LLVM IR) + (full source in comment)
with the
(full LLVM IR) + (reduced src in comment)

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

11 years agoAdd tests for the before and after modifiers.
Rafael Espindola [Thu, 11 Jul 2013 21:11:55 +0000 (21:11 +0000)]
Add tests for the before and after modifiers.

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

11 years agoRemove an argument that we dont use anymore.
Nadav Rotem [Thu, 11 Jul 2013 20:56:13 +0000 (20:56 +0000)]
Remove an argument that we dont use anymore.

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

11 years agoUse %llu to print a 64 bit number. Should fix the ARM bots.
Rafael Espindola [Thu, 11 Jul 2013 20:01:30 +0000 (20:01 +0000)]
Use %llu to print a 64 bit number. Should fix the ARM bots.

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

11 years agoAdd a test for llvm-ar's m operation.
Rafael Espindola [Thu, 11 Jul 2013 19:09:04 +0000 (19:09 +0000)]
Add a test for llvm-ar's m operation.

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

11 years agoPPC: Add some missing V_SET0 patterns
Hal Finkel [Thu, 11 Jul 2013 17:43:32 +0000 (17:43 +0000)]
PPC: Add some missing V_SET0 patterns

We had patterns to match v4i32 immAllZerosV -> V_SET0, but not patterns for
v8i16 (which occurs in the test case) or v16i8. The same was true for
V_SETALLONES (so I added the associated patterns for those as well).

Another bug found by llvm-stress.

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

11 years agoindvars: Improve LFTR by eliminating truncation when comparing against a constant.
Andrew Trick [Thu, 11 Jul 2013 17:08:59 +0000 (17:08 +0000)]
indvars: Improve LFTR by eliminating truncation when comparing against a constant.

Patch by Michele Scandale!

Adds a special handling of the case where, during the loop exit
condition rewriting, the exit value is a constant of bitwidth lower
than the type of the induction variable: instead of introducing a
trunc operation in order to match correctly the operand types, it
allows to convert the constant value to an equivalent constant,
depending on the initial value of the induction variable and the trip
count, in order have an equivalent comparison between the induction
variable and the new constant.

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

11 years agoPPCDAGToDAGISel::isRunOfOnes should return false on zero
Hal Finkel [Thu, 11 Jul 2013 16:31:51 +0000 (16:31 +0000)]
PPCDAGToDAGISel::isRunOfOnes should return false on zero

This fixes a bug (found by csmith) at -O0 where we attempt to create a RLWIMI
with an out-of-range operand. Most uses of the isRunOfOnes function are guarded
by a condition that the value is not zero. This was not true in two places, and
in both places a zero input would result in an out-of-rage MB value (= 32).

To fix this, isRunOfOnes returns false on a zero input (and I've remove one
now-redundant guard).

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

11 years agoUse SmallVectorImpl& instead of SmallVector to avoid repeating small vector size.
Craig Topper [Thu, 11 Jul 2013 16:22:38 +0000 (16:22 +0000)]
Use SmallVectorImpl& instead of SmallVector to avoid repeating small vector size.

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

11 years agoAdd back code for supporting old mingw versions. Should bring the bots back.
Rafael Espindola [Thu, 11 Jul 2013 16:11:21 +0000 (16:11 +0000)]
Add back code for supporting old mingw versions. Should bring the bots back.

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

11 years agoDon't use a potentially expensive shift if all we want is one set bit.
Benjamin Kramer [Thu, 11 Jul 2013 16:05:50 +0000 (16:05 +0000)]
Don't use a potentially expensive shift if all we want is one set bit.

No functionality change.

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

11 years agoInsertBefore is the same as AddBefore. Delete it.
Rafael Espindola [Thu, 11 Jul 2013 15:54:53 +0000 (15:54 +0000)]
InsertBefore is the same as AddBefore. Delete it.

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

11 years agoLooks like some versions of mingw don't have errno_t. Use int.
Rafael Espindola [Thu, 11 Jul 2013 15:47:04 +0000 (15:47 +0000)]
Looks like some versions of mingw don't have errno_t. Use int.

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

11 years agoUse move semantics if possible to construct ConstantRanges.
Benjamin Kramer [Thu, 11 Jul 2013 15:37:27 +0000 (15:37 +0000)]
Use move semantics if possible to construct ConstantRanges.

Arithmetic on ConstantRanges creates a lot of large temporary APInts that
benefit from move semantics.

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

11 years agoFix a FIXME about the format and add a test.
Rafael Espindola [Thu, 11 Jul 2013 15:35:23 +0000 (15:35 +0000)]
Fix a FIXME about the format and add a test.

While at it, use strftime on Unix too and use the thread safe versions
of localtime.

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

11 years agoLoopVectorize: Vectorize all accesses in address space zero with unit stride
Arnold Schwaighofer [Thu, 11 Jul 2013 15:21:55 +0000 (15:21 +0000)]
LoopVectorize: Vectorize all accesses in address space zero with unit stride

We can vectorize them because in the case where we wrap in the address space the
unvectorized code would have had to access a pointer value of zero which is
undefined behavior in address space zero according to the LLVM IR semantics.
(Thank you Duncan, for pointing this out to me).

Fixes PR16592.

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

11 years agoMerge these tests.
Rafael Espindola [Thu, 11 Jul 2013 13:44:10 +0000 (13:44 +0000)]
Merge these tests.

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

11 years agoUse a more unique name to avoid conflicting with directory.ll tests when running
Rafael Espindola [Thu, 11 Jul 2013 13:31:38 +0000 (13:31 +0000)]
Use a more unique name to avoid conflicting with directory.ll tests when running
in parallel.

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

11 years agoAdd a test for llvm-ar's 'd' operation.
Rafael Espindola [Thu, 11 Jul 2013 13:24:27 +0000 (13:24 +0000)]
Add a test for llvm-ar's 'd' operation.

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

11 years agoAdd tests for the 'x' operation.
Rafael Espindola [Thu, 11 Jul 2013 13:13:09 +0000 (13:13 +0000)]
Add tests for the 'x' operation.

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

11 years agoRemove the 'N' modifier from llvm-ar.
Rafael Espindola [Thu, 11 Jul 2013 13:03:27 +0000 (13:03 +0000)]
Remove the 'N' modifier from llvm-ar.

* It is not present on OS X.
* It is untested.
* It is not needed for using ar in a build system.

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

11 years agoDelete dead code.
Rafael Espindola [Thu, 11 Jul 2013 12:54:11 +0000 (12:54 +0000)]
Delete dead code.

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

11 years agoRemove support for truncating names in archives.
Rafael Espindola [Thu, 11 Jul 2013 12:38:02 +0000 (12:38 +0000)]
Remove support for truncating names in archives.

* All systems we support have some form of long name support.
* The options has different names and semantics in different implementations
  ('f' on gnu, 'T' on OS X), which makes it unlikely it is normally used on
  build systems.
* It was completely untested.

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

11 years agoSync llvm-ar's help string with the options it supports.
Rafael Espindola [Thu, 11 Jul 2013 12:28:36 +0000 (12:28 +0000)]
Sync llvm-ar's help string with the options it supports.

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

11 years agoReduce the number of indirections in the attributes implementation.
Benjamin Kramer [Thu, 11 Jul 2013 12:13:16 +0000 (12:13 +0000)]
Reduce the number of indirections in the attributes implementation.

- Coallocate entires for AttributeSetImpls and Nodes after the class itself.
- Remove mutable iterators from immutable classes.
- Remove unused context field from AttributeImpl.
- Derive Enum/Align/String attribute implementations from AttributeImpl instead
  of having a whole new inheritance tree for them.
- Derive AlignAttributeImpl from EnumAttributeImpl.

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

11 years ago[SystemZ] Add testcase missing from r186073
Richard Sandiford [Thu, 11 Jul 2013 09:10:38 +0000 (09:10 +0000)]
[SystemZ] Add testcase missing from r186073

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

11 years ago[SystemZ] Use zeroing form of RISBG for shift-and-AND sequences
Richard Sandiford [Thu, 11 Jul 2013 09:10:09 +0000 (09:10 +0000)]
[SystemZ] Use zeroing form of RISBG for shift-and-AND sequences

Extend r186072 to handle shifts and ANDs.

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

11 years ago[SystemZ] Use zeroing form of RISBG for some AND sequences
Richard Sandiford [Thu, 11 Jul 2013 08:59:12 +0000 (08:59 +0000)]
[SystemZ] Use zeroing form of RISBG for some AND sequences

RISBG can handle some ANDs for which no AND IMMEDIATE exists.
It also acts as a three-operand AND for some cases where an
AND IMMEDIATE could be used instead.

It might be worth adding a pass to replace RISBG with AND IMMEDIATE
in cases where the register operands end up being the same and where
AND IMMEDIATE is smaller.

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

11 years ago[SystemZ] Allow 8-bit operands to RISBG
Richard Sandiford [Thu, 11 Jul 2013 08:37:13 +0000 (08:37 +0000)]
[SystemZ] Allow 8-bit operands to RISBG

RISBG has three 8-bit operands (I3, I4 and I5).  I'd originally
restricted all three to 6 bits, since that's the only range we intended
to use at the time.  However, the top bit of I4 acts as a "zero" flag for
RISBG, while the top bit of I3 acts as a "test" flag for RNSBG & co.
This patch therefore allows them to have the full 8-bit range.
I've left the fifth operand as a 6-bit value for now since the
upper 2 bits have no defined meaning.

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

11 years agoTryToSimplifyUncondBranchFromEmptyBlock was checking that any common
Duncan Sands [Thu, 11 Jul 2013 08:28:20 +0000 (08:28 +0000)]
TryToSimplifyUncondBranchFromEmptyBlock was checking that any common
predecessors of the two blocks it is attempting to merge supply the
same incoming values to any phi in the successor block.  This change
allows merging in the case where there is one or more incoming values
that are undef.  The undef values are rewritten to match the non-undef
value that flows from the other edge.  Patch by Mark Lacey.

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

11 years agoInitialize AsmPrinter::MF in the constructor
Hal Finkel [Thu, 11 Jul 2013 06:41:14 +0000 (06:41 +0000)]
Initialize AsmPrinter::MF in the constructor

MF is normally initialized in AsmPrinter::SetupMachineFunction, but if the file
contains only globals (no functions), then we need this to be initialized
because, when encountering an error, lowerConstant() references it.

This should fix the non-deterministic failures of
test/CodeGen/X86/nonconst-static-iv.ll, etc.

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

11 years agoRegScavenger should not exclude undef uses
Hal Finkel [Thu, 11 Jul 2013 05:55:57 +0000 (05:55 +0000)]
RegScavenger should not exclude undef uses

When computing currently-live registers, the register scavenger excludes undef
uses. As a result, undef uses are ignored when computing the restore points of
registers spilled into the emergency slots. While the register scavenger
normally excludes from consideration, when scavenging, registers used by the
current instruction, we need to not exclude undef uses. Otherwise, we might end
up requiring more emergency spill slots than we have (in the case where the
undef use *is* the currently-spilled register).

Another bug found by llvm-stress.

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

11 years agoFix indentation. No functional change.
Craig Topper [Thu, 11 Jul 2013 05:39:44 +0000 (05:39 +0000)]
Fix indentation. No functional change.

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

11 years agoFix a warning.
Nadav Rotem [Thu, 11 Jul 2013 05:39:02 +0000 (05:39 +0000)]
Fix a warning.

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

11 years agoConsolidate more lit tests.
Nadav Rotem [Thu, 11 Jul 2013 05:15:11 +0000 (05:15 +0000)]
Consolidate more lit tests.

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

11 years agoConsolidate some of the lit tests.
Nadav Rotem [Thu, 11 Jul 2013 05:11:33 +0000 (05:11 +0000)]
Consolidate some of the lit tests.

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

11 years agoConsolidate some of the lit tests.
Nadav Rotem [Thu, 11 Jul 2013 05:01:50 +0000 (05:01 +0000)]
Consolidate some of the lit tests.

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

11 years agoSLPVectorizer: refactor the code that places extracts. Place the code that decides...
Nadav Rotem [Thu, 11 Jul 2013 04:54:05 +0000 (04:54 +0000)]
SLPVectorizer: refactor the code that places extracts. Place the code that decides where to put extracts in the build-tree phase. This allows us to take the cost of the extracts into account.

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

11 years agoTeach TailRecursionElimination to handle certain cases of nocapture escaping allocas.
Michael Gottesman [Thu, 11 Jul 2013 04:40:01 +0000 (04:40 +0000)]
Teach TailRecursionElimination to handle certain cases of nocapture escaping allocas.

Without the changes introduced into this patch, if TRE saw any allocas at all,
TRE would not perform TRE *or* mark callsites with the tail marker.

Because TRE runs after mem2reg, this inadequacy is not a death sentence. But
given a callsite A without escaping alloca argument, A may not be able to have
the tail marker placed on it due to a separate callsite B having a write-back
parameter passed in via an argument with the nocapture attribute.

Assume that B is the only other callsite besides A and B only has nocapture
escaping alloca arguments (*NOTE* B may have other arguments that are not passed
allocas). In this case not marking A with the tail marker is unnecessarily
conservative since:

  1. By assumption A has no escaping alloca arguments itself so it can not
     access the caller's stack via its arguments.

  2. Since all of B's escaping alloca arguments are passed as parameters with
     the nocapture attribute, we know that B does not stash said escaping
     allocas in a manner that outlives B itself and thus could be accessed
     indirectly by A.

With the changes introduced by this patch:

  1. If we see any escaping allocas passed as a capturing argument, we do
     nothing and bail early.

  2. If we do not see any escaping allocas passed as captured arguments but we
     do see escaping allocas passed as nocapture arguments:

       i. We do not perform TRE to avoid PR962 since the code generator produces
          significantly worse code for the dynamic allocas that would be created
          by the TRE algorithm.

       ii. If we do not return twice, mark call sites without escaping allocas
           with the tail marker. *NOTE* This excludes functions with escaping
           nocapture allocas.

  3. If we do not see any escaping allocas at all (whether captured or not):

       i. If we do not have usage of setjmp, mark all callsites with the tail
          marker.

       ii. If there are no dynamic/variable sized allocas in the function,
           attempt to perform TRE on all callsites in the function.

Based off of a patch by Nick Lewycky.

rdar://14324281.

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

11 years agoMove r186044 tests into CodeGen/X86
Hal Finkel [Thu, 11 Jul 2013 01:55:55 +0000 (01:55 +0000)]
Move r186044 tests into CodeGen/X86

I had thought that these tests could be target-neutral, but in practice this is
not the case (on some targets, like Hexagon and Darwin), they trigger an assert
(a different assert than the one that r186044 fixes).

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

11 years agoSet REQUIRES shell on the test cases for r186044
Hal Finkel [Wed, 10 Jul 2013 23:25:03 +0000 (23:25 +0000)]
Set REQUIRES shell on the test cases for r186044

Trying to fix the i686-mingw32 build.

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

11 years agoXFAIL the test cases for r186044 on Hexagon
Hal Finkel [Wed, 10 Jul 2013 23:11:14 +0000 (23:11 +0000)]
XFAIL the test cases for r186044 on Hexagon

For some reason, the Hexagon backend does not reject these invalid static
initializer expressions, but instead crashes in AsmPrinter::EmitGlobalConstant.

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

11 years agoDon't assert if we can't constant fold extract/insertvalue
Hal Finkel [Wed, 10 Jul 2013 22:51:01 +0000 (22:51 +0000)]
Don't assert if we can't constant fold extract/insertvalue

A non-constant-foldable static initializer expression containing insertvalue or
extractvalue had been causing an assert:

  Constants.cpp:1971: Assertion `FC && "ExtractValue constant expr couldn't be
                                 folded!"' failed.

Now we report a more-sensible "Unsupported expression in static initializer"
error instead.

Fixes PR15417.

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

11 years agoRemove this test for now.
Rafael Espindola [Wed, 10 Jul 2013 22:15:29 +0000 (22:15 +0000)]
Remove this test for now.

It is not reliable to depend on the output of llvm_unreachable. The original
change will have proper tests when llvm-ar moves to lib/Object (soon).

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

11 years agoCommandLine.rst: remove tiny bit of bad mark-up
Hans Wennborg [Wed, 10 Jul 2013 22:09:22 +0000 (22:09 +0000)]
CommandLine.rst: remove tiny bit of bad mark-up

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

11 years agoFind the symbol table on archives created on OS X.
Rafael Espindola [Wed, 10 Jul 2013 22:07:59 +0000 (22:07 +0000)]
Find the symbol table on archives created on OS X.

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

11 years agoMove tests from test/Archive to test/Object.
Rafael Espindola [Wed, 10 Jul 2013 21:47:16 +0000 (21:47 +0000)]
Move tests from test/Archive to test/Object.

There is no lib/Archive anymore and some archive tests were in test/Archive and
others in test/Object. Since archive is just one of the formats supported by
lib/Object, test/Object is probably the best location.

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

11 years agoAdd a comment.
Adrian Prantl [Wed, 10 Jul 2013 21:08:02 +0000 (21:08 +0000)]
Add a comment.

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

11 years agoPut ELF COMDAT relocations into the relevant COMDAT group.
Tim Northover [Wed, 10 Jul 2013 20:58:17 +0000 (20:58 +0000)]
Put ELF COMDAT relocations into the relevant COMDAT group.

Patch from Игорь Пашев  (I do hope we support utf-8 commit messages; I
also hope he'll forgive me for transliterating it as Igor Pashev in
case things go horribly wrong).

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

11 years agoRemove trailing whitespac
Stephen Lin [Wed, 10 Jul 2013 20:47:39 +0000 (20:47 +0000)]
Remove trailing whitespac

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

11 years agoAdd a testcase for r186014.
Adrian Prantl [Wed, 10 Jul 2013 20:43:29 +0000 (20:43 +0000)]
Add a testcase for r186014.

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

11 years agoDon't crash in 'llvm -s' when an archive has no symtab.
Rafael Espindola [Wed, 10 Jul 2013 20:14:22 +0000 (20:14 +0000)]
Don't crash in 'llvm -s' when an archive has no symtab.

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

11 years agoFix %t typo in Ocaml bindings test.
Reid Kleckner [Wed, 10 Jul 2013 18:55:06 +0000 (18:55 +0000)]
Fix %t typo in Ocaml bindings test.

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

11 years ago[objc-arc] Changed 'mode: c++' => 'C++' at Nick Lewycky's suggestion. Also removed...
Michael Gottesman [Wed, 10 Jul 2013 18:49:00 +0000 (18:49 +0000)]
[objc-arc] Changed 'mode: c++' => 'C++' at Nick Lewycky's suggestion. Also removed unnecessary mode: c++ lines from .cpp files.

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

11 years agoChanged "mode: c++" => "C++" at the suggestion of Nick Lewycky.
Michael Gottesman [Wed, 10 Jul 2013 18:40:49 +0000 (18:40 +0000)]
Changed "mode: c++" => "C++" at the suggestion of Nick Lewycky.

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

11 years agoUpdate doxygen comment to match renamed parameters.
Benjamin Kramer [Wed, 10 Jul 2013 18:01:16 +0000 (18:01 +0000)]
Update doxygen comment to match renamed parameters.

Found by -Wdocumentation.

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

11 years agoMemoryBuffer::getFile handles zero sized files, no need to duplicate the test.
Rafael Espindola [Wed, 10 Jul 2013 17:30:39 +0000 (17:30 +0000)]
MemoryBuffer::getFile handles zero sized files, no need to duplicate the test.

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