platform/upstream/llvm.git
9 years ago[SystemZ] Support all TLS access models - CodeGen part
Ulrich Weigand [Wed, 18 Feb 2015 09:13:27 +0000 (09:13 +0000)]
[SystemZ] Support all TLS access models - CodeGen part

The current SystemZ back-end only supports the local-exec TLS access model.
This patch adds all required CodeGen support for the other TLS models, which
means in particular:

- Expand initial-exec TLS accesses by loading TLS offsets from the GOT
  using @indntpoff relocations.

- Expand general-dynamic and local-dynamic accesses by generating the
  appropriate calls to __tls_get_offset.  Note that this routine has
  a non-standard ABI and requires loading the GOT pointer into %r12,
  so the patch also adds support for the GLOBAL_OFFSET_TABLE ISD node.

- Add a new platform-specific optimization pass to remove redundant
  __tls_get_offset calls in the local-dynamic model (modeled after
  the corresponding X86 pass).

- Add test cases verifying all access models and optimizations.

llvm-svn: 229654

9 years agoTesting commit access
Igor Laevsky [Wed, 18 Feb 2015 09:11:50 +0000 (09:11 +0000)]
Testing commit access

llvm-svn: 229653

9 years ago[SystemZ] Support all TLS access models - MC part
Ulrich Weigand [Wed, 18 Feb 2015 09:11:36 +0000 (09:11 +0000)]
[SystemZ] Support all TLS access models - MC part

The current SystemZ back-end only supports the local-exec TLS access model.
This patch adds all required MC support for the other TLS models, which
means in particular:

- Support additional relocation types for
  Initial-exec model: R_390_TLS_IEENT
  Local-dynamic-model: R_390_TLS_LDO32, R_390_TLS_LDO64,
                       R_390_TLS_LDM32, R_390_TLS_LDM64, R_390_TLS_LDCALL
  General-dynamic model: R_390_TLS_GD32, R_390_TLS_GD64, R_390_TLS_GDCALL

- Support assembler syntax to generate additional relocations
  for use with __tls_get_offset calls:
    :tls_gdcall:
    :tls_ldcall:

The patch also adds a new test to verify fixups and relocations,
and removes the (already unused) FK_390_PLT16DBL/FK_390_PLT32DBL
fixup kinds.

llvm-svn: 229652

9 years agoReformat.
NAKAMURA Takumi [Wed, 18 Feb 2015 08:36:14 +0000 (08:36 +0000)]
Reformat.

llvm-svn: 229651

9 years agoRevert r229622: "[LoopAccesses] Make VectorizerParams global" and others. r229622...
NAKAMURA Takumi [Wed, 18 Feb 2015 08:34:47 +0000 (08:34 +0000)]
Revert r229622: "[LoopAccesses] Make VectorizerParams global" and others. r229622 brought cyclic dependencies between Analysis and Vector.

  r229622: "[LoopAccesses] Make VectorizerParams global"
  r229623: "[LoopAccesses] Stash the report from the analysis rather than emitting it"
  r229624: "[LoopAccesses] Cache the result of canVectorizeMemory"
  r229626: "[LoopAccesses] Create the analysis pass"
  r229628: "[LoopAccesses] Change debug messages from LV to LAA"
  r229630: "[LoopAccesses] Add canAnalyzeLoop"
  r229631: "[LoopAccesses] Add missing const to APIs in VectorizationReport"
  r229632: "[LoopAccesses] Split out LoopAccessReport from VectorizerReport"
  r229633: "[LoopAccesses] Add -analyze support"
  r229634: "[LoopAccesses] Change LAA:getInfo to return a constant reference"
  r229638: "Analysis: fix buildbots"

llvm-svn: 229650

9 years agoNFC: Use range-based for loops and more consistent naming.
Daniel Jasper [Wed, 18 Feb 2015 08:19:16 +0000 (08:19 +0000)]
NFC: Use range-based for loops and more consistent naming.

No functional changes intended.

(I plan on doing some modifications to this function and would like to
have as few unrelated changes as possible in the patch)

llvm-svn: 229649

9 years agoRemove experimental options to control machine block placement.
Daniel Jasper [Wed, 18 Feb 2015 08:18:07 +0000 (08:18 +0000)]
Remove experimental options to control machine block placement.

This reverts r226034. Benchmarking with those flags has not revealed
anything interesting.

llvm-svn: 229648

9 years agoMinor fix after 229495.
Elena Demikhovsky [Wed, 18 Feb 2015 08:09:28 +0000 (08:09 +0000)]
Minor fix after 229495.
Removed metadata and function attributes from the test.

llvm-svn: 229647

9 years agoAddress post commit review on r229600.
Sanjoy Das [Wed, 18 Feb 2015 08:03:22 +0000 (08:03 +0000)]
Address post commit review on r229600.

llvm-svn: 229646

9 years agoAVX-512: Added support for FP instructions with embedded rounding mode.
Elena Demikhovsky [Wed, 18 Feb 2015 07:59:20 +0000 (07:59 +0000)]
AVX-512: Added support for FP instructions with embedded rounding mode.
By Asaf Badouh <asaf.badouh@intel.com>

llvm-svn: 229645

9 years agoItanium ABI: Mangle <mangled-name> according to the ABI
David Majnemer [Wed, 18 Feb 2015 07:47:09 +0000 (07:47 +0000)]
Itanium ABI: Mangle <mangled-name> according to the ABI

We attempted to be compatible with GCC's buggy mangling for templates
with a declaration for a template argument.

However, we weren't completely successful in copying their bug in cases
like:
  char foo;
  template <char &C> decltype(C) f() { return foo; };
  template char &f<foo>();

Instead, just follow the ABI specification.  This fixes PR22621.

llvm-svn: 229644

9 years ago[X86] Add another test case for the bug fixed in r229642. With the bug a vpsrldq...
Craig Topper [Wed, 18 Feb 2015 07:45:43 +0000 (07:45 +0000)]
[X86] Add another test case for the bug fixed in r229642. With the bug a vpsrldq was emitted instead of pslldq.

llvm-svn: 229643

9 years ago[x86] Rewrite the byte shift detection to not use boolean variables to
Chandler Carruth [Wed, 18 Feb 2015 07:13:48 +0000 (07:13 +0000)]
[x86] Rewrite the byte shift detection to not use boolean variables to
track state.

I didn't like this in the code review because the pattern tends to be
error prone, but I didn't see a clear way to rewrite it. Turns out that
there were bugs here, I found them when fuzz testing our shuffle
lowering for correctness on x86.

The core of the problem is that we need to consistently test all our
preconditions for the same directionality of shift and the same input
vector. Instead, formulate this as two predicates (one doesn't depend on
the input in any way), pass things like the directionality and input
vector as inputs, and loop over the alternatives.

This fixes a pattern of very rare miscompiles coming out of this code.
Turned up roughly 4 out of every 1 million v8 shuffles in my fuzz
testing. The new code is over half a million test runs with no failures
yet. I've also fuzzed every other function in the lowering code with
over 3.5 million test cases and not discovered any other miscompiles.

llvm-svn: 229642

9 years ago[X86] Remove AVX512 pslldq/psrldq shift intrinsics. They aren't implemented yet and...
Craig Topper [Wed, 18 Feb 2015 06:24:49 +0000 (06:24 +0000)]
[X86] Remove AVX512 pslldq/psrldq shift intrinsics. They aren't implemented yet and when they are they should be done with shuffles like SSE2 and AVX2.

llvm-svn: 229641

9 years ago[X86] Remove AVX2 and SSE2 pslldq and psrldq intrinsics. We can represent them in...
Craig Topper [Wed, 18 Feb 2015 06:24:44 +0000 (06:24 +0000)]
[X86] Remove AVX2 and SSE2 pslldq and psrldq intrinsics. We can represent them in IR with vector shuffles now. All their uses have been removed from clang in favor of shuffles.

llvm-svn: 229640

9 years agoPort r163224 to C++.
Nico Weber [Wed, 18 Feb 2015 05:19:40 +0000 (05:19 +0000)]
Port r163224 to C++.

The motivation is to fix a crash on

  struct S {} s;
  Foo S::~S() { s.~S(); }

What was happening here was that S::~S() was marked as invalid since its
return type is invalid, and as a consequence CheckFunctionDeclaration() wasn't
called and S::~S() didn't get merged into S's implicit destructor.  This way,
the class ended up with two destructors, which confused the overload printer
when it suddenly had to print two possible destructors for `s.~S()`.

In addition to fixing the crash, this change also seems to improve diagnostics
in a few other places, see test changes.

Crash found by SLi's bot.

llvm-svn: 229639

9 years agoAnalysis: fix buildbots
Saleem Abdulrasool [Wed, 18 Feb 2015 05:09:50 +0000 (05:09 +0000)]
Analysis: fix buildbots

This should fix the compilation failure on the MSVC buildbots which find a
std::make_unique and llvm::make_unique via ADL, resulting in ambiguity.

llvm-svn: 229638

9 years agoWrap to 80 columns. No behavior change.
Nico Weber [Wed, 18 Feb 2015 04:53:03 +0000 (04:53 +0000)]
Wrap to 80 columns. No behavior change.

llvm-svn: 229637

9 years agoSema: partially address post-commit comments
Saleem Abdulrasool [Wed, 18 Feb 2015 04:33:26 +0000 (04:33 +0000)]
Sema: partially address post-commit comments

Un-parameterize the warning as there is exactly one attribute added in C++14.
Partially addresses post-commit review comments from Richard Smith.

llvm-svn: 229636

9 years ago[ELF] Demangle: don't expose raw info when getter is available.
Davide Italiano [Wed, 18 Feb 2015 03:54:21 +0000 (03:54 +0000)]
[ELF] Demangle: don't expose raw info when getter is available.

Differential Revision: D7693
Reviewed by: shankarke

llvm-svn: 229635

9 years ago[LoopAccesses] Change LAA:getInfo to return a constant reference
Adam Nemet [Wed, 18 Feb 2015 03:44:33 +0000 (03:44 +0000)]
[LoopAccesses] Change LAA:getInfo to return a constant reference

As expected, this required a few more const-correctness fixes.

Based on Hal's feedback on D7684.

llvm-svn: 229634

9 years ago[LoopAccesses] Add -analyze support
Adam Nemet [Wed, 18 Feb 2015 03:44:30 +0000 (03:44 +0000)]
[LoopAccesses] Add -analyze support

The LoopInfo in combination with depth_first is used to enumerate the
loops.

Right now -analyze is not yet complete.  It only prints the result of
the analysis, the report and the run-time checks.  Printing the unsafe
depedences will require a bit more reshuffling which I'd like to do in a
follow-on to this patchset.  Unsafe dependences are currently checked
via -debug-only=loop-accesses in the new test.

This is part of the patchset that converts LoopAccessAnalysis into an
actual analysis pass.

llvm-svn: 229633

9 years ago[LoopAccesses] Split out LoopAccessReport from VectorizerReport
Adam Nemet [Wed, 18 Feb 2015 03:44:25 +0000 (03:44 +0000)]
[LoopAccesses] Split out LoopAccessReport from VectorizerReport

The only difference between these two is that VectorizerReport adds a
vectorizer-specific prefix to its messages.  When LAA is used in the
vectorizer context the prefix is added when we promote the
LoopAccessReport into a VectorizerReport via one of the constructors.

This is part of the patchset that converts LoopAccessAnalysis into an
actual analysis pass.

llvm-svn: 229632

9 years ago[LoopAccesses] Add missing const to APIs in VectorizationReport
Adam Nemet [Wed, 18 Feb 2015 03:44:20 +0000 (03:44 +0000)]
[LoopAccesses] Add missing const to APIs in VectorizationReport

When I split out LoopAccessReport from this, I need to create some temps
so constness becomes necessary.

This is part of the patchset that converts LoopAccessAnalysis into an
actual analysis pass.

llvm-svn: 229631

9 years ago[LoopAccesses] Add canAnalyzeLoop
Adam Nemet [Wed, 18 Feb 2015 03:44:08 +0000 (03:44 +0000)]
[LoopAccesses] Add canAnalyzeLoop

This allows the analysis to be attempted with any loop.  This feature
will be used with -analysis.  (LV only requests the analysis on loops
that have already satisfied these tests.)

This is part of the patchset that converts LoopAccessAnalysis into an
actual analysis pass.

llvm-svn: 229630

9 years ago[LoopAccesses] Factor out RuntimePointerCheck::needsChecking
Adam Nemet [Wed, 18 Feb 2015 03:43:58 +0000 (03:43 +0000)]
[LoopAccesses] Factor out RuntimePointerCheck::needsChecking

Will be used by the new RuntimePointerCheck::print.

This is part of the patchset that converts LoopAccessAnalysis into an
actual analysis pass.

llvm-svn: 229629

9 years ago[LoopAccesses] Change debug messages from LV to LAA
Adam Nemet [Wed, 18 Feb 2015 03:43:37 +0000 (03:43 +0000)]
[LoopAccesses] Change debug messages from LV to LAA

Also add pass name as an argument to VectorizationReport::emitAnalysis.

This is part of the patchset that converts LoopAccessAnalysis into an
actual analysis pass.

llvm-svn: 229628

9 years ago[LoopAccesses] Modify test to also check symbolic strides with memchecks
Adam Nemet [Wed, 18 Feb 2015 03:43:32 +0000 (03:43 +0000)]
[LoopAccesses] Modify test to also check symbolic strides with memchecks

See the comment in the code.

This is part of the patchset that converts LoopAccessAnalysis into an
actual analysis pass.

llvm-svn: 229627

9 years ago[LoopAccesses] Create the analysis pass
Adam Nemet [Wed, 18 Feb 2015 03:43:24 +0000 (03:43 +0000)]
[LoopAccesses] Create the analysis pass

This is a function pass that runs the analysis on demand.  The analysis
can be initiated by querying the loop access info via LAA::getInfo.  It
either returns the cached info or runs the analysis.

Symbolic stride information continues to reside outside of this analysis
pass. We may move it inside later but it's not a priority for me right
now.  The idea is that Loop Distribution won't support run-time stride
checking at least initially.

This means that when querying the analysis, symbolic stride information
can be provided optionally.  Whether stride information is used can
invalidate the cache entry and rerun the analysis.  Note that if the
loop does not have any symbolic stride, the entry should be preserved
across Loop Distribution and LV.

Since currently the only user of the pass is LV, I just check that the
symbolic stride information didn't change when using a cached result.

On the LV side, LoopVectorizationLegality requests the info object
corresponding to the loop from the analysis pass.  A large chunk of the
diff is due to LAI becoming a pointer from a reference.

A test will be added as part of the -analyze patch.

Also tested that with AVX, we generate identical assembly output for the
testsuite (including the external testsuite) before and after.

This is part of the patchset that converts LoopAccessAnalysis into an
actual analysis pass.

llvm-svn: 229626

9 years ago[LoopAccesses] Make blockNeedsPredication static
Adam Nemet [Wed, 18 Feb 2015 03:43:19 +0000 (03:43 +0000)]
[LoopAccesses] Make blockNeedsPredication static

blockNeedsPredication is in LoopAccess in order to share it with the
vectorizer.  It's a utility needed by LoopAccess not strictly provided
by it but it's a good place to share it.  This makes the function static
so that it no longer required to create an LoopAccessInfo instance in
order to access it from LV.

This was actually causing problems because it would have required
creating LAI much earlier that LV::canVectorizeMemory().

This is part of the patchset that converts LoopAccessAnalysis into an
actual analysis pass.

llvm-svn: 229625

9 years ago[LoopAccesses] Cache the result of canVectorizeMemory
Adam Nemet [Wed, 18 Feb 2015 03:42:57 +0000 (03:42 +0000)]
[LoopAccesses] Cache the result of canVectorizeMemory

LAA will be an on-demand analysis pass, so we need to cache the result
of the analysis.  canVectorizeMemory is renamed to analyzeLoop which
computes the result.  canVectorizeMemory becomes the query function for
the cached result.

This is part of the patchset that converts LoopAccessAnalysis into an
actual analysis pass.

llvm-svn: 229624

9 years ago[LoopAccesses] Stash the report from the analysis rather than emitting it
Adam Nemet [Wed, 18 Feb 2015 03:42:50 +0000 (03:42 +0000)]
[LoopAccesses] Stash the report from the analysis rather than emitting it

The transformation passes will query this and then emit them as part of
their own report.  The currently only user LV is modified to do just
that.

This is part of the patchset that converts LoopAccessAnalysis into an
actual analysis pass.

llvm-svn: 229623

9 years ago[LoopAccesses] Make VectorizerParams global
Adam Nemet [Wed, 18 Feb 2015 03:42:43 +0000 (03:42 +0000)]
[LoopAccesses] Make VectorizerParams global

As LAA is becoming a pass, we can no longer pass the params to its
constructor.  This changes the command line flags to have external
storage.  These can now be accessed both from LV and LAA.

VectorizerParams is moved out of LoopAccessInfo in order to shorten the
code to access it.

This is part of the patchset that converts LoopAccessAnalysis into an
actual analysis pass.

llvm-svn: 229622

9 years ago[LoopAccesses] Rename LoopAccessAnalysis to LoopAccessInfo
Adam Nemet [Wed, 18 Feb 2015 03:42:35 +0000 (03:42 +0000)]
[LoopAccesses] Rename LoopAccessAnalysis to LoopAccessInfo

LoopAccessAnalysis will be used as the name of the pass.

This is part of the patchset that converts LoopAccessAnalysis into an
actual analysis pass.

llvm-svn: 229621

9 years ago[LoopAccesses] Make raw_string_ostream local in VectorizationReport
Adam Nemet [Wed, 18 Feb 2015 03:42:15 +0000 (03:42 +0000)]
[LoopAccesses] Make raw_string_ostream local in VectorizationReport

Since VectorizationReport will be part of the result of the analysis it
will be stored in a container.  However, one of its members is a
raw_string_ostream which cannot be copy-constructed.

This makes the raw_string_ostream local to the << operator.

This is part of the patchset that converts LoopAccessAnalysis into an
actual analysis pass.

llvm-svn: 229620

9 years ago[InstCombine] Do not insert a GEP instruction before a landingpad instruction.
Akira Hatanaka [Wed, 18 Feb 2015 03:30:11 +0000 (03:30 +0000)]
[InstCombine] Do not insert a GEP instruction before a landingpad instruction.

InstCombiner::visitGetElementPtrInst was using getFirstNonPHI to compute the
insertion point, which caused the verifier to complain when a GEP was inserted
before a landingpad instruction. This commit fixes it to use getFirstInsertionPt
instead.

rdar://problem/19394964

llvm-svn: 229619

9 years ago[BDCE] Don't forget uses of root instructions seen before the instruction itself
Hal Finkel [Wed, 18 Feb 2015 03:12:28 +0000 (03:12 +0000)]
[BDCE] Don't forget uses of root instructions seen before the instruction itself

When visiting the initial list of "root" instructions (those which must always
be alive), for those that are integer-valued (such as invokes returning an
integer), we mark their bits as (initially) all dead (we might, obviously, find
uses of those bits later, but all bits are assumed dead until proven
otherwise). Don't do so, however, if we're already seen a use of those bits by
another root instruction (such as a store).

Fixes a miscompile of the sanitizer unit tests on x86_64.

Also, add a debug line for visiting the root instructions, and remove a debug
line which tried to print instructions being removed (printing dead
instructions is dangerous, and can sometimes crash).

llvm-svn: 229618

9 years agoCodeGen: Relax a FileCheck line for SystemZ
David Majnemer [Wed, 18 Feb 2015 02:28:15 +0000 (02:28 +0000)]
CodeGen: Relax a FileCheck line for SystemZ

llvm-svn: 229617

9 years agoSema: size_t is available in C when -fms-compatibility is enabled
David Majnemer [Wed, 18 Feb 2015 02:28:13 +0000 (02:28 +0000)]
Sema: size_t is available in C when -fms-compatibility is enabled

llvm-svn: 229616

9 years agoItanium ABI: Improve our mangling of <destructor-name>
David Majnemer [Wed, 18 Feb 2015 02:28:01 +0000 (02:28 +0000)]
Itanium ABI: Improve our mangling of <destructor-name>

Our mangling of <destructor-name> wasn't quite right: we'd introduce
mangling substitutions where one shouldn't be possible.  We also didn't
correctly handle the case where the destroyed type was not dependent but
still a TemplateSpecializationType.

N.B. There isn't a mangling for a template-template parameter showing up
as the destroyed type.  We do the 'obvious' thing and mangle the index
of the parameter.

llvm-svn: 229615

9 years agoR600/SI: Rename dst encoding field to be consistent with docs
Matt Arsenault [Wed, 18 Feb 2015 02:15:37 +0000 (02:15 +0000)]
R600/SI: Rename dst encoding field to be consistent with docs

The docs call this vdst instead of just dst.

llvm-svn: 229614

9 years agoR600/SI: Consistently capitalize encoding field names
Matt Arsenault [Wed, 18 Feb 2015 02:15:35 +0000 (02:15 +0000)]
R600/SI: Consistently capitalize encoding field names

Some formats capitalized these, but most didn't. Change
them all to be consistently lowercase.

Now, non-encoding fields and convenience bits are capitalized.
Also remove weird looking empty line in some of the formats.

llvm-svn: 229613

9 years agoR600/SI: Set noNamedPositionallyEncodedOperands
Matt Arsenault [Wed, 18 Feb 2015 02:15:32 +0000 (02:15 +0000)]
R600/SI: Set noNamedPositionallyEncodedOperands

llvm-svn: 229612

9 years agoR600/SI: Fix src1_modifiers for class instructions
Matt Arsenault [Wed, 18 Feb 2015 02:15:30 +0000 (02:15 +0000)]
R600/SI: Fix src1_modifiers for class instructions

src1 doesn't have modifiers, but the operand was missing
resulting in an encoding build error when all fields
are required.'

llvm-svn: 229611

9 years agoR600/SI: Fix not setting clamp / omod for v_cndmask_b32_e64
Matt Arsenault [Wed, 18 Feb 2015 02:15:27 +0000 (02:15 +0000)]
R600/SI: Fix not setting clamp / omod for v_cndmask_b32_e64

Rename the multiclass since it now applies to the output
modifiers as well.

llvm-svn: 229610

9 years agoR600: Fix operand encoding error
Matt Arsenault [Wed, 18 Feb 2015 02:10:42 +0000 (02:10 +0000)]
R600: Fix operand encoding error

llvm-svn: 229609

9 years agoR600/SI: Fix encoding error from glc bit on VI SMRD instructions
Matt Arsenault [Wed, 18 Feb 2015 02:10:40 +0000 (02:10 +0000)]
R600/SI: Fix encoding error from glc bit on VI SMRD instructions

llvm-svn: 229608

9 years agoR600/SI: Fix operand encoding for flat instructions
Matt Arsenault [Wed, 18 Feb 2015 02:10:37 +0000 (02:10 +0000)]
R600/SI: Fix operand encoding for flat instructions

llvm-svn: 229607

9 years agoR600/SI: Fix error from vdst on no return atomics
Matt Arsenault [Wed, 18 Feb 2015 02:10:35 +0000 (02:10 +0000)]
R600/SI: Fix error from vdst on no return atomics

Set the ignored field to 0 so we can enable
noNamedPositionallyEncodedOperands.

llvm-svn: 229606

9 years agoR600/SI: Add missing offset operand to buffer bothen
Matt Arsenault [Wed, 18 Feb 2015 02:04:38 +0000 (02:04 +0000)]
R600/SI: Add missing offset operand to buffer bothen

llvm-svn: 229605

9 years agoR600/SI: Add missing soffset operand to global atomics
Matt Arsenault [Wed, 18 Feb 2015 02:04:35 +0000 (02:04 +0000)]
R600/SI: Add missing soffset operand to global atomics

llvm-svn: 229604

9 years agoR600/SI: Fix brace identation
Matt Arsenault [Wed, 18 Feb 2015 02:04:31 +0000 (02:04 +0000)]
R600/SI: Fix brace identation

llvm-svn: 229603

9 years agoRe-apply "InstrProf: Add unit tests for the profile reader and writer"
Justin Bogner [Wed, 18 Feb 2015 01:58:17 +0000 (01:58 +0000)]
Re-apply "InstrProf: Add unit tests for the profile reader and writer"

Have the InstrProfWriter return a MemoryBuffer instead of a
std::string. This fixes the alignment issues the reader would hit, and
it's a more appropriate type for this anyway.

I've also removed an ugly helper function that's not needed since
we're allowing initializer lists now, and updated some error code
checks based on MSVC's issues with r229473.

This reverts r229483, reapplying r229478.

llvm-svn: 229602

9 years agoLiveRangeCalc: Rename some parameters from kill to use, NFC.
Matthias Braun [Wed, 18 Feb 2015 01:50:52 +0000 (01:50 +0000)]
LiveRangeCalc: Rename some parameters from kill to use, NFC.

Those parameters did not necessarily describe kill points but just uses.

llvm-svn: 229601

9 years agoGeneralize getExtendAddRecStart to work with both sign and zero
Sanjoy Das [Wed, 18 Feb 2015 01:47:07 +0000 (01:47 +0000)]
Generalize getExtendAddRecStart to work with both sign and zero
extensions.

This change also removes `DEBUG(dbgs() << "SCEV: untested prestart
overflow check\n");` because that case has a unit test now.

Differential Revision: http://reviews.llvm.org/D7645

llvm-svn: 229600

9 years ago[shuffles] Tweak my shufflevector fuzz test generation script to produce
Chandler Carruth [Wed, 18 Feb 2015 01:36:45 +0000 (01:36 +0000)]
[shuffles] Tweak my shufflevector fuzz test generation script to produce
more useful output. No more null bytes printed, and now with a newline.

llvm-svn: 229599

9 years agoDowngrade build system error message to a warning
Filipe Cabecinhas [Wed, 18 Feb 2015 01:12:38 +0000 (01:12 +0000)]
Downgrade build system error message to a warning

Instead of requiring MSVC 2013 U4, we simply warn users, since some might
not bt able to immediately upgrade.

llvm-svn: 229598

9 years agoRename flags and options to match current naming: from -fdef-sized-delete to -fdefine...
Larisse Voufo [Wed, 18 Feb 2015 01:04:10 +0000 (01:04 +0000)]
Rename flags and options to match current naming: from -fdef-sized-delete to -fdefine-sized-deallocation, and from DefaultSizedDelete to DefineSizedDeallocation.

llvm-svn: 229597

9 years agoMake the Mips AsmPrinter independent of global subtarget
Eric Christopher [Wed, 18 Feb 2015 01:01:57 +0000 (01:01 +0000)]
Make the Mips AsmPrinter independent of global subtarget
initialization. Initialize the subtarget once per function and
migrate EmitStartOfAsmFile to either use calls on the
TargetMachine or get information from the subtarget we'd use
for assembling.

The top-level-ness of the MIPS attribute output for assembly is,
by nature, contrary to how we'd want to do this for an LTO
situation where we have multiple cpu architectures so this
solution is good enough for now.

llvm-svn: 229596

9 years agoUnify selectMipsCPU implementations.
Eric Christopher [Wed, 18 Feb 2015 00:55:06 +0000 (00:55 +0000)]
Unify selectMipsCPU implementations.

llvm-svn: 229595

9 years agoBugfix: SCEV incorrectly marks certain expressions as nsw
Sanjoy Das [Wed, 18 Feb 2015 00:43:19 +0000 (00:43 +0000)]
Bugfix: SCEV incorrectly marks certain expressions as nsw

I could not come up with a test case for this one; but I don't think
`getPreStartForSignExtend` can assume `AR` is `nsw` -- there is one
place in scalar evolution that calls `getSignExtendAddRecStart(AR,
...)` without proving that `AR` is `nsw`

(line 1564)

   OperandExtendedAdd =
     getAddExpr(WideStart,
                getMulExpr(WideMaxBECount,
                           getZeroExtendExpr(Step, WideTy)));
   if (SAdd == OperandExtendedAdd) {
     // If AR wraps around then
     //
     //    abs(Step) * MaxBECount > unsigned-max(AR->getType())
     // => SAdd != OperandExtendedAdd
     //
     // Thus (AR is not NW => SAdd != OperandExtendedAdd) <=>
     // (SAdd == OperandExtendedAdd => AR is NW)

     const_cast<SCEVAddRecExpr *>(AR)->setNoWrapFlags(SCEV::FlagNW);

     // Return the expression with the addrec on the outside.
     return getAddRecExpr(getSignExtendAddRecStart(AR, Ty, this),
                          getZeroExtendExpr(Step, Ty),
                          L, AR->getNoWrapFlags());
   }

Differential Revision: http://reviews.llvm.org/D7640

llvm-svn: 229594

9 years ago[analyzer] Refactoring: clarified the way the proper check kind is chosen.
Anton Yartsev [Wed, 18 Feb 2015 00:39:06 +0000 (00:39 +0000)]
[analyzer] Refactoring: clarified the way the proper check kind is chosen.

llvm-svn: 229593

9 years ago[CMake] Remove debug message from CMakeLists.txt
Zachary Turner [Wed, 18 Feb 2015 00:27:11 +0000 (00:27 +0000)]
[CMake] Remove debug message from CMakeLists.txt

llvm-svn: 229592

9 years ago[modules] Fix typo in DIA exclusion in module map.
Richard Smith [Wed, 18 Feb 2015 00:21:45 +0000 (00:21 +0000)]
[modules] Fix typo in DIA exclusion in module map.

llvm-svn: 229591

9 years agoTwines should be passed by const ref.
Rafael Espindola [Tue, 17 Feb 2015 23:44:22 +0000 (23:44 +0000)]
Twines should be passed by const ref.

llvm-svn: 229590

9 years ago[X86][FastIsel] Teach how to select scalar integer to float/double conversions.
Andrea Di Biagio [Tue, 17 Feb 2015 23:40:58 +0000 (23:40 +0000)]
[X86][FastIsel] Teach how to select scalar integer to float/double conversions.

This patch teaches fast-isel how to select a (V)CVTSI2SSrr for an integer to
float conversion, and how to select a (V)CVTSI2SDrr for an integer to double
conversion.

Added test 'fast-isel-int-float-conversion.ll'.

Differential Revision: http://reviews.llvm.org/D7698

llvm-svn: 229589

9 years agoFix TestAttachDenied.py remote execution on Linux.
Oleksiy Vyalov [Tue, 17 Feb 2015 23:37:19 +0000 (23:37 +0000)]
Fix TestAttachDenied.py remote execution on Linux.

http://reviews.llvm.org/D7659

llvm-svn: 229587

9 years agoAdd r228939 back with a fix.
Rafael Espindola [Tue, 17 Feb 2015 23:34:51 +0000 (23:34 +0000)]
Add r228939 back with a fix.

The problem in the original patch was not switching back to .text after printing
an eh table.

Original message:

On ELF, put PIC jump tables in a non executable section.

Fixes PR22558.

llvm-svn: 229586

9 years agoRevert "Remove support for building sanitizers from Makefile/autoconf build."
Matthias Braun [Tue, 17 Feb 2015 23:30:51 +0000 (23:30 +0000)]
Revert "Remove support for building sanitizers from Makefile/autoconf build."

This reverts commit r229556.

Reverting this for now as internal apple builds rely on this
functionality.

llvm-svn: 229585

9 years agoWe require MSVC 2013 Update 4 due to previous versions miscompiling ASTMatchers
Filipe Cabecinhas [Tue, 17 Feb 2015 23:29:00 +0000 (23:29 +0000)]
We require MSVC 2013 Update 4 due to previous versions miscompiling ASTMatchers

Previous versions of MSVC 2013 would miscompile ASTMatchers (and/or their
tests). Bump up the requirement and make sure we know about the minor
revision.

Minimum required version found by Michael Edwards!

llvm-svn: 229584

9 years agoclang-cl: Map /wd4996 to -Wno-deprecated-declarations
Reid Kleckner [Tue, 17 Feb 2015 23:28:19 +0000 (23:28 +0000)]
clang-cl: Map /wd4996 to -Wno-deprecated-declarations

This is typically used to suppress warnings about calling snprintf and
other "deprecated" POSIX functions. Accepting this flag helps avoid tons
of useless warnings when trying out clang-cl on a new project.

Patch by Scott Graham!

llvm-svn: 229583

9 years agoRevert "Remove support for building sanitizers from Makefile/autoconf build."
Matthias Braun [Tue, 17 Feb 2015 23:27:37 +0000 (23:27 +0000)]
Revert "Remove support for building sanitizers from Makefile/autoconf build."

This reverts commit r229554.

Reverting this commit for now as several apple internal builds still
rely on this functionality.

llvm-svn: 229582

9 years ago[TSan] Provide default values for compile definitions.
Alexey Samsonov [Tue, 17 Feb 2015 23:23:10 +0000 (23:23 +0000)]
[TSan] Provide default values for compile definitions.

Provide defaults for TSAN_COLLECT_STATS and TSAN_NO_HISTORY.
Replace #ifdef directives with #if. This fixes a bug introduced
in r229112, where building TSan runtime with -DTSAN_COLLECT_STATS=0
would still enable stats collection and reporting.

llvm-svn: 229581

9 years agoAdd a test showing the problem in r228939.
Rafael Espindola [Tue, 17 Feb 2015 23:21:46 +0000 (23:21 +0000)]
Add a test showing the problem in r228939.

If an EH table is printed in between the function and the jump table we would
fail to switch back to the text section to print the jump table.

llvm-svn: 229580

9 years agoIR: Add missing clone() overloads
Duncan P. N. Exon Smith [Tue, 17 Feb 2015 23:10:13 +0000 (23:10 +0000)]
IR: Add missing clone() overloads

Add missing specialized node overloads for `MDNode::clone()` (they were
on most of the node types already, but missing from the others).
`MDNode::clone()` returns `TempMDNode` (`std::unique_ptr<MDNode,...>`),
while `TempMDSubrange::clone()` (for example) returns the more
convenient `TempMDSubrange` (`std::unique_ptr<TempMDSubrange,...>`).

llvm-svn: 229579

9 years agoMake PlatformPOSIX::KillProcess to delegate to a remote platform if connected.
Oleksiy Vyalov [Tue, 17 Feb 2015 22:57:56 +0000 (22:57 +0000)]
Make PlatformPOSIX::KillProcess to delegate to a remote platform if connected.

http://reviews.llvm.org/D7660

llvm-svn: 229577

9 years agoclang-cl: Disable frame pointer elimination at -O0
Reid Kleckner [Tue, 17 Feb 2015 22:40:42 +0000 (22:40 +0000)]
clang-cl: Disable frame pointer elimination at -O0

This wasn't kicking in because the _SLASH_O flag didn't match our check
for OPT_O0. Add an alias that does to keep the logic simple.

llvm-svn: 229575

9 years agorename variables again because these tables also deal with stores; NFC
Sanjay Patel [Tue, 17 Feb 2015 22:38:06 +0000 (22:38 +0000)]
rename variables again because these tables also deal with stores; NFC

Suggestion by Simon Pilgrim

llvm-svn: 229574

9 years agoIR: fieldIsMDNode() should be false for MDString
Duncan P. N. Exon Smith [Tue, 17 Feb 2015 22:34:15 +0000 (22:34 +0000)]
IR: fieldIsMDNode() should be false for MDString

Simplify the code.  It has been a while since the schema has been so
"flexible".

llvm-svn: 229573

9 years agoAsmPrinter: Take range in DwarfExpression::AddExpression(), NFC
Duncan P. N. Exon Smith [Tue, 17 Feb 2015 22:30:56 +0000 (22:30 +0000)]
AsmPrinter: Take range in DwarfExpression::AddExpression(), NFC

Previously `DwarfExpression::AddExpression()` relied on
default-constructing the end iterators for `DIExpression` -- once the
operands are represented explicitly via `MDExpression` (instead of via
the strange `StringRef` navigator in `DIHeaderIterator`) this won't
work.  Explicitly take an iterator for the end of the range.

llvm-svn: 229572

9 years ago[X86][SSE] Generalised unpckl/unpckh shuffle matching
Simon Pilgrim [Tue, 17 Feb 2015 22:24:32 +0000 (22:24 +0000)]
[X86][SSE] Generalised unpckl/unpckh shuffle matching

Added commuted unpckl/unpckh shuffle matching patterns as many cases containing undefined lanes fail to commute by themselves.

Differential Revision: http://reviews.llvm.org/D7564

llvm-svn: 229571

9 years agoWinASan: Fix escaping in dll_host.cc test to work with internal shell
Reid Kleckner [Tue, 17 Feb 2015 22:22:20 +0000 (22:22 +0000)]
WinASan: Fix escaping in dll_host.cc test to work with internal shell

llvm-svn: 229570

9 years ago[CMake] Create a custom target for generating extension module.
Zachary Turner [Tue, 17 Feb 2015 22:20:29 +0000 (22:20 +0000)]
[CMake] Create a custom target for generating extension module.

Previously we would create the extension module as a post-build
step of creating liblldb.  As part of this process, we created
symlinks and did other stuff.

This had several longstanding issues related to target
dependencies, such as not re-creating the symlink if liblldb.dll
failed to link, or if the build was Ctrl+C'ed from.

Then, the script that creates the symlinks began to grow to
include other things, such as argdumper, and it would try to
create symlinks before it had finished building the targets it
needed to symlink to.

This patches addresses all of these problems by creating an
explicit target for the script to run, and making it have a
dependency on all the targets it needs to create symlinks from/to.

llvm-svn: 229569

9 years agoRemove the CMake duplication for liblldb.
Zachary Turner [Tue, 17 Feb 2015 22:20:20 +0000 (22:20 +0000)]
Remove the CMake duplication for liblldb.

Previously the CMake had a lot of duplication for the public API
due to some differences regarding how we link on Windows.  This
fixes the issue, so making changes to the public API should be
much easier now.

llvm-svn: 229568

9 years agoAdd comment to explain a non-obvious setting; NFC.
Sanjay Patel [Tue, 17 Feb 2015 22:09:54 +0000 (22:09 +0000)]
Add comment to explain a non-obvious setting; NFC.

This is paraphrased from Simon Pilgrim's comment in:
http://reviews.llvm.org/D7492

llvm-svn: 229566

9 years agouse a triple instead of a cpu; less builbot sadness
Sanjay Patel [Tue, 17 Feb 2015 21:59:54 +0000 (21:59 +0000)]
use a triple instead of a cpu; less builbot sadness

llvm-svn: 229563

9 years agoSilence an MSVC warning about testing a function for truth without calling it
Reid Kleckner [Tue, 17 Feb 2015 21:57:42 +0000 (21:57 +0000)]
Silence an MSVC warning about testing a function for truth without calling it

In general, this is a reasonable warning, except real_pthread_create is
weak and can be null.  The existing usage is correct as it the function
is declared with SANITIZER_WEAK, but MSVC can't know that because it is
defined to nothing on Windows.

llvm-svn: 229562

9 years agoUse lit's internal shell when running tests on Windows
Reid Kleckner [Tue, 17 Feb 2015 21:57:10 +0000 (21:57 +0000)]
Use lit's internal shell when running tests on Windows

The internal shell is faster and more predictable than any copy of
bash.exe on the user's system.

LLVM and Clang use the internal shell by default, and have an
environment variable to disable it. I don't think compiler-rt needs that
complexity, so I left it out.

llvm-svn: 229560

9 years agoremove function names from comments; NFC
Sanjay Patel [Tue, 17 Feb 2015 21:55:20 +0000 (21:55 +0000)]
remove function names from comments; NFC

llvm-svn: 229558

9 years agoSema: Replace some push_backs of expensive to move objects with emplace_back.
Benjamin Kramer [Tue, 17 Feb 2015 21:55:18 +0000 (21:55 +0000)]
Sema: Replace some push_backs of expensive to move objects with emplace_back.

NFC.

llvm-svn: 229557

9 years agoRemove support for building sanitizers from Makefile/autoconf build.
Alexey Samsonov [Tue, 17 Feb 2015 21:53:45 +0000 (21:53 +0000)]
Remove support for building sanitizers from Makefile/autoconf build.

They autotools build has a number of missing features, supports less
OS, architectures, build configurations, doesn't have any tests and
is hard to support in sync with CMake build.

llvm-svn: 229556

9 years agoRemove support for building sanitizers from Makefile/autoconf build.
Alexey Samsonov [Tue, 17 Feb 2015 21:53:22 +0000 (21:53 +0000)]
Remove support for building sanitizers from Makefile/autoconf build.

They autotools build has a number of missing features, supports less
OS, architectures, build configurations, doesn't have any tests and
is hard to support in sync with CMake build.

llvm-svn: 229554

9 years ago[clang-tidy] Fixed two wrong fix-it cases in misc-inefficient-algorithm checker.
Gabor Horvath [Tue, 17 Feb 2015 21:45:38 +0000 (21:45 +0000)]
[clang-tidy] Fixed two wrong fix-it cases in misc-inefficient-algorithm checker.

llvm-svn: 229552

9 years agoRevert r229543.
Meador Inge [Tue, 17 Feb 2015 21:42:45 +0000 (21:42 +0000)]
Revert r229543.

Reverting this while build bot failures are investigated.

llvm-svn: 229550

9 years agoreplace meaningless variable names; NFCI
Sanjay Patel [Tue, 17 Feb 2015 21:37:28 +0000 (21:37 +0000)]
replace meaningless variable names; NFCI

llvm-svn: 229549

9 years agoAdd code to llvm-objdump so the -section option with -macho will dump literal pointer...
Kevin Enderby [Tue, 17 Feb 2015 21:35:48 +0000 (21:35 +0000)]
Add code to llvm-objdump so the -section option with -macho will dump literal pointer sections
with the Mach-O S_LITERAL_POINTERS section type.

Also fix the printing of the leading addresses for literal sections to be consistent and
not print the 0x prefix.  Updated test cases to match.

llvm-svn: 229548

9 years agoRe-apply "InstrProf: Use a test fixture in the coverage mapping tests"
Justin Bogner [Tue, 17 Feb 2015 21:33:43 +0000 (21:33 +0000)]
Re-apply "InstrProf: Use a test fixture in the coverage mapping tests"

This time we use a helper to format the assertion so we can just use
ASSERT_TRUE instead of relying on ASSERT_EQ being able to deal with
conversions between enum types.

This reverts r229496, re-applying r229473.

llvm-svn: 229547

9 years agoSema: Allow 'constexpr' variables in range loops
Meador Inge [Tue, 17 Feb 2015 21:02:56 +0000 (21:02 +0000)]
Sema: Allow 'constexpr' variables in range loops

This fixes PR22492, which is in response to CWG issue #1204.
Per the CWG issue 'contexpr' variables are now allowed in
for range loops.

llvm-svn: 229543

9 years agoAdd testcases I missed in r229541.
Rafael Espindola [Tue, 17 Feb 2015 20:50:39 +0000 (20:50 +0000)]
Add testcases I missed in r229541.

llvm-svn: 229542

9 years agoAdd r228980 back.
Rafael Espindola [Tue, 17 Feb 2015 20:48:01 +0000 (20:48 +0000)]
Add r228980 back.

Add support for having multiple sections with the same name and comdat.

Using this in combination with -ffunction-sections allows LLVM to output a .o
file with mulitple sections named .text. This saves space by avoiding long
unique names of the form .text.<C++ mangled name>.

llvm-svn: 229541