Commit Graph

154973 Commits

Author SHA1 Message Date
Tom Stellard 28d06de6f6 R600: Implement TargetLowering::getVectorIdxTy()
We use MVT::i32 for the vector index type, because we use 32-bit
operations to caculate offsets when dynamically indexing vectors.

llvm-svn: 187749
2013-08-05 22:22:07 +00:00
Tom Stellard d42c594960 TargetLowering: Add getVectorIdxTy() function v2
This virtual function can be implemented by targets to specify the type
to use for the index operand of INSERT_VECTOR_ELT, EXTRACT_VECTOR_ELT,
INSERT_SUBVECTOR, EXTRACT_SUBVECTOR.  The default implementation returns
the result from TargetLowering::getPointerTy()

The previous code was using TargetLowering::getPointerTy() for vector
indices, because this is guaranteed to be legal on all targets.  However,
using TargetLowering::getPointerTy() can be a problem for targets with
pointer sizes that differ across address spaces.  On such targets,
when vectors need to be loaded or stored to an address space other than the
default 'zero' address space (which is the address space assumed by
TargetLowering::getPointerTy()), having an index that
is a different size than the pointer can lead to inefficient
pointer calculations, (e.g. 64-bit adds for a 32-bit address space).

There is no intended functionality change with this patch.

llvm-svn: 187748
2013-08-05 22:22:01 +00:00
Eric Christopher 432c99af0b Revert "Use existing builtin hashing functions to make this routine more"
This reverts commit r187745.

llvm-svn: 187747
2013-08-05 22:07:30 +00:00
Arnold Schwaighofer 30448e607e Reverting r187736. It broke some public bots:
http://lab.llvm.org:8011/builders/clang-native-arm-cortex-a9/builds/10248
http://bb.pgr.jp/builders/cmake-clang-i686-mingw32/builds/3327

llvm-svn: 187746
2013-08-05 22:03:41 +00:00
Eric Christopher d728355a1c Use existing builtin hashing functions to make this routine more
simple.

llvm-svn: 187745
2013-08-05 22:00:50 +00:00
Eric Christopher 0369ad7053 Change parent hashing algorithm to be non-recursive and elaborate
greatly on many comments in the code.

llvm-svn: 187742
2013-08-05 21:40:57 +00:00
David Majnemer ae465ef7cc [ms-cxxabi] Mangle nullptr template arguments
MSVC mangles nullptr template arguments identically to zero literals.

llvm-svn: 187741
2013-08-05 21:33:59 +00:00
Marshall Clow 0c37cfd8b8 Implement NULL iterators for <list> re: N3644
llvm-svn: 187740
2013-08-05 21:23:28 +00:00
Michael Gottesman 6964f33fc9 [bugpoint] Allow the user to specify the path to opt on the commandline.
llvm-svn: 187739
2013-08-05 21:07:07 +00:00
Daniel Jasper 07e6c407bc Add option to disable module loading.
This patch was created by Lawrence Crowl and reviewed in:
http://llvm-reviews.chandlerc.com/D963

llvm-svn: 187738
2013-08-05 20:26:17 +00:00
Hans Wennborg dffe59932b lit.cfg: better check for MSYS
When running the tests under Cygwin using non-Cygwin python,
the platform would be Windows and there would be bash on the path,
so this check for MSYS would not work correctly.

llvm-svn: 187737
2013-08-05 20:14:43 +00:00
John Thompson ea8e668516 Fixed incorrect include file exit detection. Added work-around to avoid error on header guard in nested include. Fixed a couple of coding standard issues on variable names.
llvm-svn: 187736
2013-08-05 19:15:50 +00:00
Richard Smith d7293d7fcb Implement C++'s restrictions on the type of an expression passed to a vararg
function: it can't be 'void' and it can't be an initializer list. We give a
hard error for these rather than treating them as undefined behavior (we can
and probably should do the same for non-POD types in C++11, but as of this
change we don't).

Slightly rework the checking of variadic arguments in a function with a format
attribute to ensure that certain kinds of format string problem (non-literal
string, too many/too few arguments, ...) don't suppress this error.

llvm-svn: 187735
2013-08-05 18:49:43 +00:00
Serge Pavlov 518b26cdcd Regression test for PR12699
llvm-svn: 187734
2013-08-05 18:38:16 +00:00
Peter Collingbourne bace606657 Introduce an optimisation for special case lists with large numbers of literal entries.
Our internal regex implementation does not cope with large numbers
of anchors very efficiently.  Given a ~3600-entry special case list,
regex compilation can take on the order of seconds.  This patch solves
the problem for the special case of patterns matching literal global
names (i.e. patterns with no regex metacharacters).  Rather than
forming regexes from literal global name patterns, add them to
a StringSet which is checked before matching against the regex.
This reduces regex compilation time by an order of roughly thousands
when reading the aforementioned special case list, according to a
completely unscientific study.

No test cases.  I figure that any new tests for this code should
check that regex metacharacters are properly recognised.  However,
I could not find any documentation which documents the fact that the
syntax of global names in special case lists is based on regexes.
The extent to which regex syntax is supported in special case lists
should probably be decided on/documented before writing tests.

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

llvm-svn: 187732
2013-08-05 17:48:04 +00:00
Peter Collingbourne fe8cd75971 Introduce Regex::isLiteralERE function.
This will be used to implement an optimisation for literal entries
in special case lists.

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

llvm-svn: 187731
2013-08-05 17:47:59 +00:00
Andrew Kaylor bd6389b11f Additional fixes/xfails for icc tests
llvm-svn: 187730
2013-08-05 17:12:35 +00:00
Jordan Rose 74ef34f2be [analyzer] Clarify that r187624 is a hack and should be fixed better later.
Tracked by <rdar://problem/14648821>.

llvm-svn: 187729
2013-08-05 16:02:02 +00:00
Tobias Grosser e42ddb9ad3 ScopInfo: Split start value from SCEVAddRecExpr to enable parameter sharing.
SCoP invariant parameters with the different start value would deter parameter
sharing. For example, when compiling the following C code:

  void foo(float *input) {
    for (long j = 0; j < 8; j++) {
      // SCoP begin
      for (long i = 0; i < 8; i++) {
        float x = input[j * 64 + i + 1];
        input[j * 64 + i] = x * x;
      }
    }
  }

Polly would creat two parameters for these memory accesses:

    p_0: {0,+,256}
    p_2: {4,+,256}
    [j * 64 + i + 1] => MemRef_input[o0] : 4o0 = p_1 + 4i0
    [j * 64 + i]     => MemRef_input[o0] : 4o0 = p_0 + 4i0

These parameters only differ from start value. To enable parameter sharing,
we split the start value from SCEVAddRecExpr, so they would share a single
parameter that always has zero start value:

    p0: {0,+,256}<%for.cond1.preheader>
    [j * 64 + i + 1] => MemRef_input[o0] : 4o0 = 4 + p_1 + 4i0
    [j * 64 + i]     => MemRef_input[o0] : 4o0 = p_0 + 4i0

Such translation can make the polly-dependence much faster.

Contributed-by: Star Tan <tanmx_star@yeah.net>
llvm-svn: 187728
2013-08-05 15:14:15 +00:00
Aaron Ballman 5b4634576e Silencing an MSVC11 type conversion warning.
llvm-svn: 187727
2013-08-05 13:47:03 +00:00
Alexey Samsonov b42ea7ef21 Lint fixes
llvm-svn: 187726
2013-08-05 13:20:39 +00:00
Alexey Samsonov f52b717db3 80-cols
llvm-svn: 187725
2013-08-05 13:19:49 +00:00
Elena Demikhovsky 62d19c8bdf LLVM Interpreter: This patch implements vector support for cast operations (zext, sext, uitofp, sitofp, trunc, fpext, fptosi, fptrunc, bitcast) and shift operations (shl, ashr, lshr) for integer and floating point data types.
Added tests.

Done by Yuri Veselov (mailto:Yuri.Veselov@intel.com).

llvm-svn: 187724
2013-08-05 12:17:06 +00:00
Richard Sandiford c212125d27 [SystemZ] Use BRCT and BRCTG to eliminate add-&-compare sequences
This patch just uses a peephole test for "add; compare; branch" sequences
within a single block.  The IR optimizers already convert loops to
decrement-and-branch-on-nonzero form in some cases, so even this
simplistic test triggers many times during a clang bootstrap and
projects/test-suite run.  It looks like there are still cases where we
need to more strongly prefer branches on nonzero though.  E.g. I saw a
case where a loop that started out with a check for 0 ended up with a
check for -1.  I'll try to look at that sometime.

I ended up adding the Reference class because MachineInstr::readsRegister()
doesn't check for subregisters (by design, as far as I could tell).

llvm-svn: 187723
2013-08-05 11:23:46 +00:00
Benjamin Kramer 483b9fbddb Don't leak passes if added outside of the area determined by Started/Stopped flags.
llvm-svn: 187722
2013-08-05 11:11:11 +00:00
Richard Sandiford 9795d8e611 [SystemZ] Add definitions for BRCT and BRCTG
llvm-svn: 187721
2013-08-05 11:07:38 +00:00
Richard Sandiford b49a3ab262 [SystemZ] Use LOAD AND TEST to eliminate comparisons against zero
llvm-svn: 187720
2013-08-05 11:03:20 +00:00
Richard Sandiford c62c64a038 [SystemZ] Add LOAD AND TEST instructions
Just the definitions and MC support.  The next patch uses them for codegen.

llvm-svn: 187719
2013-08-05 11:00:53 +00:00
Richard Sandiford bdbb8af7e6 [SystemZ] Split out comparison elimination into a separate pass
Perhaps predictably, doing comparison elimination on the fly during
SystemZLongBranch turned out to be a bad idea.  The next patches make
use of LOAD AND TEST and BRANCH ON COUNT, both of which require
changes to earlier instructions.

No functionality change intended.

llvm-svn: 187718
2013-08-05 10:58:53 +00:00
Elena Demikhovsky 40864b690b AVX-512 set: added mask operations, lowering BUILD_VECTOR for i1 vector types.
Added intrinsics and tests.

llvm-svn: 187717
2013-08-05 08:52:21 +00:00
Craig Topper c5244512c8 Use a shuffle with undef elements instead of inserting 0s in the 128-bit to 256-bit casting intrinsics to improve performance. Thanks to Katya Romanova for identifying this issue.
llvm-svn: 187716
2013-08-05 06:17:21 +00:00
David Majnemer 1365781b5b Sema: Don't assume a nested name specifier holds a type
Sema::PerformObjectMemberConversion assumed that the Qualifier it was
given holds a type. However, the specifier could hold just a namespace.
In this case, we should ignore the qualifier and not attempt to cast to
it.

llvm-svn: 187715
2013-08-05 04:53:41 +00:00
Nadav Rotem eae928acd2 Update the release notes about the status of the vectorizers.
llvm-svn: 187714
2013-08-05 04:31:05 +00:00
Nadav Rotem 2da8b3e99e Update the docs.
llvm-svn: 187713
2013-08-05 04:27:34 +00:00
Reed Kotler 9c285b300d Add the saving of S2. This is needed for some of the floating point
helper functions. This can be optimized out later when the remaining
parts of the helper function work is moved into the Mips16HardFloat pass.
For now it forces us to use the 32 bit save/restore instructions instead
of the 16 bit ones.

llvm-svn: 187712
2013-08-04 23:56:53 +00:00
Bob Wilson b9549baf7f Remove "lto_on_osx" xfails, now that -rdynamic works on Darwin.
Note that this will require a recent version of the linker for Darwin
builds with LTO to pass these tests.

llvm-svn: 187711
2013-08-04 23:55:24 +00:00
Bob Wilson 9fcf545575 Build with the $RDYNAMIC flag on Darwin as well as other platforms.
Part of <rdar://problem/14620988>

llvm-svn: 187710
2013-08-04 22:06:11 +00:00
Timur Iskhodzhanov 40f2fa9a45 Emit the constructor for abstract classes when using -cxx-abi microsoft, fixes PR16735
llvm-svn: 187709
2013-08-04 17:30:04 +00:00
Benjamin Kramer d989ef4373 clang-tidy's modules depend on it.
Fixes shared cmake build.

llvm-svn: 187708
2013-08-04 16:06:43 +00:00
Daniel Jasper 89bbab09dd Fix clang-tidy dependencies and bad file comment.
This addresses comments in post-commit review of r187345.

llvm-svn: 187707
2013-08-04 15:56:30 +00:00
Benjamin Kramer 5bc180c14f X86: Turn fp selects into mask operations.
double test(double a, double b, double c, double d) { return a<b ? c : d; }

before:
_test:
	ucomisd	%xmm0, %xmm1
	ja	LBB0_2
	movaps	%xmm3, %xmm2
LBB0_2:
	movaps	%xmm2, %xmm0

after:
_test:
	cmpltsd	%xmm1, %xmm0
	andpd	%xmm0, %xmm2
	andnpd	%xmm3, %xmm0
	orpd	%xmm2, %xmm0

Small speedup on Benchmarks/SmallPT

llvm-svn: 187706
2013-08-04 12:05:16 +00:00
Elena Demikhovsky cd46691728 AVX-512 set: added VEXTRACTPS instruction
llvm-svn: 187705
2013-08-04 10:46:07 +00:00
Tim Northover adb550068a X86: specify CPU on new test to fix atom buildbot
Apparently Atoms use lea for stack adjustment, which we weren't
looking for.

llvm-svn: 187704
2013-08-04 10:00:45 +00:00
Tim Northover ecc018c7b7 X86: correct tail return address calculation
Due to the weird and wondeful usual arithmetic conversions, some
calculations involving negative values were getting performed in
uint32_t and then promoted to int64_t, which is really not a good
idea.

Patch by Katsuhiro Ueno.

llvm-svn: 187703
2013-08-04 09:35:57 +00:00
Benjamin Kramer 1df3a1f678 AsmParser: Store MacroLikeBodies on the side so they don't get leaked.
llvm-svn: 187702
2013-08-04 09:06:29 +00:00
Reed Kotler 30cedf65ef Clean up code for Mips16 large frame handling.
llvm-svn: 187701
2013-08-04 01:13:25 +00:00
Benjamin Kramer 72d45cc846 PPCAsmParser: Stop leaking names.
Store them in a place that gets cleaned up properly.

llvm-svn: 187700
2013-08-03 22:43:29 +00:00
Benjamin Kramer 5d62ad2aff Unbreak llvm-rtdyld build.
llvm-svn: 187699
2013-08-03 22:18:45 +00:00
Benjamin Kramer 097e09abba MachObjectFile: Don't leak on error.
llvm-svn: 187698
2013-08-03 22:16:37 +00:00
Benjamin Kramer 9ce7708abb llvm-rtdyld: Don't leak memory managers.
Dyld never outlives MemMgr, just put both on the stack.

llvm-svn: 187697
2013-08-03 22:16:31 +00:00