platform/upstream/llvm.git
9 years agoRevert r247218: "Fix Clang-tidy misc-use-override warnings, other minor fixes"
Hans Wennborg [Thu, 10 Sep 2015 00:37:18 +0000 (00:37 +0000)]
Revert r247218: "Fix Clang-tidy misc-use-override warnings, other minor fixes"

Seems it broke the Polly build.
From http://lab.llvm.org:8011/builders/perf-x86_64-penryn-O3-polly-fast/builds/11687/steps/compile/logs/stdio:

In file included from /home/grosser/buildslave/perf-x86_64-penryn-O3-polly-fast/llvm.src/lib/TableGen/Record.cpp:14:0:
/home/grosser/buildslave/perf-x86_64-penryn-O3-polly-fast/llvm.src/include/llvm/TableGen/Record.h:369:3: error: looser throw specifier for 'virtual llvm::TypedInit::~TypedInit()'
/home/grosser/buildslave/perf-x86_64-penryn-O3-polly-fast/llvm.src/include/llvm/TableGen/Record.h:270:11: error:   overriding 'virtual llvm::Init::~Init() noexcept (true)'

llvm-svn: 247222

9 years ago[RewriteStatepointsForGC] Strengthen a confusingly weak assertion [NFC]
Philip Reames [Thu, 10 Sep 2015 00:32:56 +0000 (00:32 +0000)]
[RewriteStatepointsForGC] Strengthen a confusingly weak assertion [NFC]

The assertion was weaker than it should be and gave the impression we're growing the number of base defining values being considered during the fixed point interation.  That's not true.  The tighter form of the assert is useful documentation.

llvm-svn: 247221

9 years ago[RewriteStatepointsForGC] One last bit of naming [NFCI]
Philip Reames [Thu, 10 Sep 2015 00:27:50 +0000 (00:27 +0000)]
[RewriteStatepointsForGC] One last bit of naming [NFCI]

llvm-svn: 247220

9 years ago[WinEH] Add codegen support for cleanuppad and cleanupret
Reid Kleckner [Thu, 10 Sep 2015 00:25:23 +0000 (00:25 +0000)]
[WinEH] Add codegen support for cleanuppad and cleanupret

All of the complexity is in cleanupret, and it mostly follows the same
codepaths as catchret, except it doesn't take a return value in RAX.

This small example now compiles and executes successfully on win32:
  extern "C" int printf(const char *, ...) noexcept;
  struct Dtor {
    ~Dtor() { printf("~Dtor\n"); }
  };
  void has_cleanup() {
    Dtor o;
    throw 42;
  }
  int main() {
    try {
      has_cleanup();
    } catch (int) {
      printf("caught it\n");
    }
  }

Don't try to put the cleanup in the same function as the catch, or Bad
Things will happen.

llvm-svn: 247219

9 years agoFix Clang-tidy misc-use-override warnings, other minor fixes
Hans Wennborg [Thu, 10 Sep 2015 00:24:40 +0000 (00:24 +0000)]
Fix Clang-tidy misc-use-override warnings, other minor fixes

Patch by Eugene Zelenko!

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

llvm-svn: 247218

9 years ago[RewriteStatepointsForGC] Further style/naming fixup [NFCI]
Philip Reames [Thu, 10 Sep 2015 00:22:49 +0000 (00:22 +0000)]
[RewriteStatepointsForGC] Further style/naming fixup [NFCI]

llvm-svn: 247217

9 years agoFix Clang-tidy misc-use-override warnings, other minor fixes
Hans Wennborg [Thu, 10 Sep 2015 00:12:56 +0000 (00:12 +0000)]
Fix Clang-tidy misc-use-override warnings, other minor fixes

Patch by Eugene Zelenko!

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

llvm-svn: 247216

9 years agoBitcode Writer: EmitRecordWith* takes an ArrayRef instead of a SmallVector (NFC)
Mehdi Amini [Thu, 10 Sep 2015 00:05:09 +0000 (00:05 +0000)]
Bitcode Writer: EmitRecordWith* takes an ArrayRef instead of a SmallVector (NFC)

This reapply commit r247178 after post-commit review from D.Blaikie
in a way that makes it compatible with the existing API.

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 247215

9 years agoAdd makeArrayRef() overload for ArrayRef input (no-op/identity) NFC
Mehdi Amini [Thu, 10 Sep 2015 00:05:04 +0000 (00:05 +0000)]
Add makeArrayRef() overload for ArrayRef input (no-op/identity) NFC

The purpose is to allow templated wrapper to work with either
ArrayRef or any convertible operation:

template<typename Container>
void wrapper(const Container &Arr) {
  impl(makeArrayRef(Arr));
}

with Container being a std::vector, a SmallVector, or an ArrayRef.

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 247214

9 years ago[RewriteStatepointsForGC] More naming cleanup [NFCI]
Philip Reames [Thu, 10 Sep 2015 00:01:53 +0000 (00:01 +0000)]
[RewriteStatepointsForGC] More naming cleanup [NFCI]

llvm-svn: 247213

9 years ago[RewriteStatepointsForGC] Code cleanup [NFC]
Philip Reames [Wed, 9 Sep 2015 23:57:18 +0000 (23:57 +0000)]
[RewriteStatepointsForGC] Code cleanup [NFC]

Factor out common code related to naming values, fix a small style issue.  More to follow in separate changes.

llvm-svn: 247211

9 years ago[RewriteStatepointsForGC] Extend base pointer inference to handle insertelement
Philip Reames [Wed, 9 Sep 2015 23:40:12 +0000 (23:40 +0000)]
[RewriteStatepointsForGC] Extend base pointer inference to handle insertelement

This change is simply enhancing the existing inference algorithm to handle insertelement instructions by conservatively inserting a new instruction to propagate the vector of associated base pointers. In the process, I'm ripping out the peephole optimizations which mostly helped cover the fact this hadn't been done.

Note that most of the newly inserted nodes will be nearly immediately removed by the post insertion optimization pass introduced in 246718. Arguably, we should be trying harder to avoid the malloc traffic here, but I'd rather get the code correct, then worry about compile time.

Unlike previous extensions of the algorithm to handle more case, I discovered the existing code was causing miscompiles in some cases. In particular, we had an implicit assumption that the peephole covered *all* insert element instructions, so if we had a value directly based on a insert element the peephole didn't cover, we proceeded as if it were a base anyways. Not good. I believe we had the same issue with shufflevector which is why I adjusted the predicate for them as well.

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

llvm-svn: 247210

9 years agoARC: Fix the precise-lifetime suppression of returns_inner_pointer
John McCall [Wed, 9 Sep 2015 23:37:17 +0000 (23:37 +0000)]
ARC: Fix the precise-lifetime suppression of returns_inner_pointer
receiver extension for message sends via property syntax.

rdar://22172983

llvm-svn: 247209

9 years ago[RewriteStatepointsForGC] Make base pointer inference deterministic
Philip Reames [Wed, 9 Sep 2015 23:26:08 +0000 (23:26 +0000)]
[RewriteStatepointsForGC] Make base pointer inference deterministic

Previously, the base pointer algorithm wasn't deterministic. The core fixed point was (of course), but we were inserting new nodes and optimizing them in an order which was unspecified and variable. We'd somewhat hacked around this for testing by sorting by value name, but that doesn't solve the general determinism problem.

Instead, we can use the order of traversal over the def/use graph to give us a single consistent ordering. Today, this is a DFS order, but the exact order doesn't mater provided it's deterministic for a given input.

(Q: It is safe to rely on a deterministic order of operands right?)

Note that this only fixes the determinism within a single inference step. The inference step is currently invoked many times in a non-deterministic order. That's a future change in the sequence. :)

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

llvm-svn: 247208

9 years agoFix access control for lookups using the Microsoft __super extension.
John McCall [Wed, 9 Sep 2015 23:04:17 +0000 (23:04 +0000)]
Fix access control for lookups using the Microsoft __super extension.

rdar://22464808

llvm-svn: 247207

9 years agoFix a small comment typo in Windows Process code.
Stephane Sezer [Wed, 9 Sep 2015 22:58:23 +0000 (22:58 +0000)]
Fix a small comment typo in Windows Process code.

llvm-svn: 247206

9 years agoChange the load addr into something that works on linux x86_64.
Rafael Espindola [Wed, 9 Sep 2015 22:53:55 +0000 (22:53 +0000)]
Change the load addr into something that works on linux x86_64.

With this simple static programs run again.

llvm-svn: 247205

9 years agothread_local is not implemented for targeting cygwin yet.
NAKAMURA Takumi [Wed, 9 Sep 2015 22:51:31 +0000 (22:51 +0000)]
thread_local is not implemented for targeting cygwin yet.

llvm-svn: 247204

9 years agoconvert builtin_unpredictable on a switch into metadata for LLVM
Sanjay Patel [Wed, 9 Sep 2015 22:39:06 +0000 (22:39 +0000)]
convert builtin_unpredictable on a switch into metadata for LLVM

llvm-svn: 247203

9 years agoFix the build-llvm.pl to not create one monster .a file from all of the llvm and...
Greg Clayton [Wed, 9 Sep 2015 22:35:25 +0000 (22:35 +0000)]
Fix the build-llvm.pl to not create one monster .a file from all of the llvm and clang .a files. We now just make a file list which we pass to the linker.

llvm-svn: 247202

9 years agoLowerBitSets: Fix non-determinism bug.
Peter Collingbourne [Wed, 9 Sep 2015 22:30:32 +0000 (22:30 +0000)]
LowerBitSets: Fix non-determinism bug.

Visit disjoint sets in a deterministic order based on the maximum BitSetNM
index, otherwise the order in which we visit them will depend on pointer
comparisons. This was being exposed by MSan.

llvm-svn: 247201

9 years agoIntroduce the notion of an escape helper. Different languages have different notion...
Enrico Granata [Wed, 9 Sep 2015 22:30:24 +0000 (22:30 +0000)]
Introduce the notion of an escape helper. Different languages have different notion of what to print in a string and how to escape non-printable things. The escape helper is where this notion is provided to LLDB

This is NFC, other than a code re-org

llvm-svn: 247200

9 years agoGenerating assumption loads of vptr after ctor call (fixed)
Piotr Padlewski [Wed, 9 Sep 2015 22:20:28 +0000 (22:20 +0000)]
Generating assumption loads of vptr after ctor call (fixed)

Generating call assume(icmp %vtable, %global_vtable) after constructor
call for devirtualization purposes.

For more info go to:
http://lists.llvm.org/pipermail/cfe-dev/2015-July/044227.html

Edit:
Fixed version because of PR24479.
After this patch got reverted because of ScalarEvolution bug (D12719)
Merged after John McCall big patch (Added Address).

http://reviews.llvm.org/D11859

llvm-svn: 247199

9 years ago[PM] Update Polly for the new AA infrastructure landed in r247167.
Chandler Carruth [Wed, 9 Sep 2015 22:13:56 +0000 (22:13 +0000)]
[PM] Update Polly for the new AA infrastructure landed in r247167.

llvm-svn: 247198

9 years agoRemove unused function.
Greg Clayton [Wed, 9 Sep 2015 22:13:36 +0000 (22:13 +0000)]
Remove unused function.

llvm-svn: 247197

9 years agoNow that CompilerType uses a "TypeSystem *" and a "void *" instead of a "clang::ASTCo...
Greg Clayton [Wed, 9 Sep 2015 22:13:01 +0000 (22:13 +0000)]
Now that CompilerType uses a "TypeSystem *" and a "void *" instead of a "clang::ASTContext *" and a "void *", we need to know if anyone is trying to create a CompilerType from a clang::ASTContext that has no backing ClangASTContext.

This assert will fire if this is the case and we will need to fix the offending code.

llvm-svn: 247196

9 years agoRemove Target::GetBasicType()
Enrico Granata [Wed, 9 Sep 2015 22:00:18 +0000 (22:00 +0000)]
Remove Target::GetBasicType()
I was experimenting with it briefly, and then settled on Target::GetTypeSystem + TypeSystem::GetBasicType, so this API is not necessary to have

Thanks to Ryan Brown for bringing it to my attention

llvm-svn: 247195

9 years ago[Concepts] Add diagnostic; invalid specifier on function or variable concept declaration
Nathan Wilson [Wed, 9 Sep 2015 21:48:31 +0000 (21:48 +0000)]
[Concepts] Add diagnostic; invalid specifier on function or variable concept declaration

Summary: Diagnose variable and function concept declarations when an invalid specifier appears

Reviewers: rsmith, aaron.ballman, faisalv, fraggamuffin, hubert.reinterpretcast

Subscribers: cfe-commits

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

llvm-svn: 247194

9 years agoRemove a call to deleted function.
Greg Clayton [Wed, 9 Sep 2015 21:34:32 +0000 (21:34 +0000)]
Remove a call to deleted function.

llvm-svn: 247193

9 years ago[SEH] Emit 32-bit SEH tables for the new EH IR
Reid Kleckner [Wed, 9 Sep 2015 21:10:03 +0000 (21:10 +0000)]
[SEH] Emit 32-bit SEH tables for the new EH IR

The 32-bit tables don't actually contain PC range data, so emitting them
is incredibly simple.

The 64-bit tables, on the other hand, use the same table for state
numbering as well as label ranges. This makes things more difficult, so
it will be implemented later.

llvm-svn: 247192

9 years agoFor now skip ThreadSpecificBreakTestCase on FreeBSD
Ed Maste [Wed, 9 Sep 2015 21:00:10 +0000 (21:00 +0000)]
For now skip ThreadSpecificBreakTestCase on FreeBSD

It often hangs or times out, and obscures issues with other tests.
Just skip it for now (until the FreeBSD test suite is producing
consistent results) so that we can get a buildbot back.

Previous investigation (for failures) in llvm.org/pr18522

llvm-svn: 247190

9 years agoPreparatory work for letting language plugins help the StringPrinter with formatting...
Enrico Granata [Wed, 9 Sep 2015 20:59:49 +0000 (20:59 +0000)]
Preparatory work for letting language plugins help the StringPrinter with formatting special characters

llvm-svn: 247189

9 years ago[MS ABI] Don't crash on references to pointers to members in args
David Majnemer [Wed, 9 Sep 2015 20:57:59 +0000 (20:57 +0000)]
[MS ABI] Don't crash on references to pointers to members in args

We know that a reference can always be dereferenced.  However, we don't
always know the number of bytes if the reference's pointee type is
incomplete.  This case was correctly handled but we didn't consider the
case where the type is complete but we cannot calculate its size for ABI
specific reasons.  In this specific case, a member pointer's size is
available only under certain conditions.

This fixes PR24703.

llvm-svn: 247188

9 years ago[WebAssembly] Update target datalayout strings.
Dan Gohman [Wed, 9 Sep 2015 20:54:31 +0000 (20:54 +0000)]
[WebAssembly] Update target datalayout strings.

llvm-svn: 247187

9 years agoChange EmitRecordWithAbbrevImpl to take Optional record code. NFC.
Teresa Johnson [Wed, 9 Sep 2015 20:53:31 +0000 (20:53 +0000)]
Change EmitRecordWithAbbrevImpl to take Optional record code. NFC.

This change enables EmitRecord to pass the supplied record Code to
EmitRecordWithAbbrevImpl, rather than insert it into the Vals array.
It is an enabler for changing EmitRecord to take an ArrayRef<uintty> instead
of a SmallVectorImpl<uintty>&

Patch suggested by Duncan P. N. Exon Smith, modified by myself a bit to get
correct assertion checking.

llvm-svn: 247186

9 years ago[elf2] Assign output sections to PHDRs.
Michael J. Spencer [Wed, 9 Sep 2015 20:48:09 +0000 (20:48 +0000)]
[elf2] Assign output sections to PHDRs.

This is a minimal implementation to produce legal output. Future patches will combine multiple compatible PT_LOADs.

llvm-svn: 247185

9 years agoScalarEvolution assume hanging bugfix
Piotr Padlewski [Wed, 9 Sep 2015 20:47:30 +0000 (20:47 +0000)]
ScalarEvolution assume hanging bugfix

http://reviews.llvm.org/D12719

llvm-svn: 247184

9 years agoRevert "EmitRecordWith* API change: takes an ArrayRef instead of a SmallVector (NFC)"
Mehdi Amini [Wed, 9 Sep 2015 20:35:37 +0000 (20:35 +0000)]
Revert "EmitRecordWith* API change: takes an ArrayRef instead of a SmallVector (NFC)"

This reverts commit r247179.

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 247183

9 years agoRevert "Bitcode Writer: EmitRecordWith* takes an ArrayRef instead of a SmallVector...
Mehdi Amini [Wed, 9 Sep 2015 20:35:15 +0000 (20:35 +0000)]
Revert "Bitcode Writer: EmitRecordWith* takes an ArrayRef instead of a SmallVector (NFC)"

This reverts commit r247178.

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 247182

9 years agoAdd the DT_NEEDED entries to the dynamic table.
Rafael Espindola [Wed, 9 Sep 2015 20:26:23 +0000 (20:26 +0000)]
Add the DT_NEEDED entries to the dynamic table.

llvm-svn: 247181

9 years agoRevert trunc(lshr (sext A), Cst) to ashr A, Cst
David Majnemer [Wed, 9 Sep 2015 20:20:08 +0000 (20:20 +0000)]
Revert trunc(lshr (sext A), Cst) to ashr A, Cst

This reverts commit r246997, it introduced a regression (PR24763).

llvm-svn: 247180

9 years agoEmitRecordWith* API change: takes an ArrayRef instead of a SmallVector (NFC)
Mehdi Amini [Wed, 9 Sep 2015 20:08:51 +0000 (20:08 +0000)]
EmitRecordWith* API change: takes an ArrayRef instead of a SmallVector (NFC)

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 247179

9 years agoBitcode Writer: EmitRecordWith* takes an ArrayRef instead of a SmallVector (NFC)
Mehdi Amini [Wed, 9 Sep 2015 20:08:39 +0000 (20:08 +0000)]
Bitcode Writer: EmitRecordWith* takes an ArrayRef instead of a SmallVector (NFC)

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 247178

9 years agoRevert "AVX512: Implemented encoding and intrinsics for vextracti64x4 ,vextracti64x...
Renato Golin [Wed, 9 Sep 2015 19:44:40 +0000 (19:44 +0000)]
Revert "AVX512: Implemented encoding and intrinsics for   vextracti64x4 ,vextracti64x2, vextracti32x8, vextracti32x4, vextractf64x4, vextractf64x2, vextractf32x8, vextractf32x4 Added tests for intrinsics and encoding."

This reverts commit r247149, as it was breaking numerous buildbots of varied architectures.

llvm-svn: 247177

9 years ago[libclang] Add missing clang_CompileCommand_* functions in libclang.exports.
Argyrios Kyrtzidis [Wed, 9 Sep 2015 18:54:16 +0000 (18:54 +0000)]
[libclang] Add missing clang_CompileCommand_* functions in libclang.exports.

llvm-svn: 247176

9 years agoMake sure to flush the stream to make sure the string is up to date when we query...
Greg Clayton [Wed, 9 Sep 2015 18:41:50 +0000 (18:41 +0000)]
Make sure to flush the stream to make sure the string is up to date when we query its size.

llvm-svn: 247175

9 years agoallow unpredictable metadata on switch statements
Sanjay Patel [Wed, 9 Sep 2015 18:38:30 +0000 (18:38 +0000)]
allow unpredictable metadata on switch statements

llvm-svn: 247174

9 years agoDon't allow duplicate names for tests.
Zachary Turner [Wed, 9 Sep 2015 18:25:13 +0000 (18:25 +0000)]
Don't allow duplicate names for tests.

We had 2 tests named TestCPPBreakpoints.py.  If one of those tests
failed, both of them would be reported as failures and contribute
to the failure count.  There may be other examples of duplicate
test names, and we should fix those as we find them.

llvm-svn: 247173

9 years agoFix typo: zycle -> cycle [NFC]
Michael Kruse [Wed, 9 Sep 2015 18:20:31 +0000 (18:20 +0000)]
Fix typo: zycle -> cycle [NFC]

llvm-svn: 247172

9 years agoSave LaneMask with livein registers
Matthias Braun [Wed, 9 Sep 2015 18:08:03 +0000 (18:08 +0000)]
Save LaneMask with livein registers

With subregister liveness enabled we can detect the case where only
parts of a register are live in, this is expressed as a 32bit lanemask.
The current code only keeps registers in the live-in list and therefore
enumerated all subregisters affected by the lanemask. This turned out to
be too conservative as the subregister may also cover additional parts
of the lanemask which are not live. Expressing a given lanemask by
enumerating a minimum set of subregisters is computationally expensive
so the best solution is to simply change the live-in list to store the
lanemasks as well. This will reduce memory usage for targets using
subregister liveness and slightly increase it for other targets

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

llvm-svn: 247171

9 years agoVirtRegMap: Improve addMBBLiveIns() using SlotIndex::MBBIndexIterator; NFC
Matthias Braun [Wed, 9 Sep 2015 18:07:54 +0000 (18:07 +0000)]
VirtRegMap: Improve addMBBLiveIns() using SlotIndex::MBBIndexIterator; NFC

Now that we have an explicit iterator over the idx2MBBMap in SlotIndices
we can use the fact that segments and the idx2MBBMap is sorted by
SlotIndex position so can advance both simultaneously instead of
starting from the beginning for each segment.

This complicates the code for the subregister case somewhat but should
be more efficient and has the advantage that we get the final lanemask
for each block immediately which will be important for a subsequent
change.

Removes the now unused SlotIndexes::findMBBLiveIns function.

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

llvm-svn: 247170

9 years agoFix indentation.
Rui Ueyama [Wed, 9 Sep 2015 18:02:23 +0000 (18:02 +0000)]
Fix indentation.

llvm-svn: 247169

9 years agoELF2: Reduce nesting by returning early. NFC.
Rui Ueyama [Wed, 9 Sep 2015 17:55:09 +0000 (17:55 +0000)]
ELF2: Reduce nesting by returning early. NFC.

llvm-svn: 247168

9 years ago[PM/AA] Rebuild LLVM's alias analysis infrastructure in a way compatible
Chandler Carruth [Wed, 9 Sep 2015 17:55:00 +0000 (17:55 +0000)]
[PM/AA] Rebuild LLVM's alias analysis infrastructure in a way compatible
with the new pass manager, and no longer relying on analysis groups.

This builds essentially a ground-up new AA infrastructure stack for
LLVM. The core ideas are the same that are used throughout the new pass
manager: type erased polymorphism and direct composition. The design is
as follows:

- FunctionAAResults is a type-erasing alias analysis results aggregation
  interface to walk a single query across a range of results from
  different alias analyses. Currently this is function-specific as we
  always assume that aliasing queries are *within* a function.

- AAResultBase is a CRTP utility providing stub implementations of
  various parts of the alias analysis result concept, notably in several
  cases in terms of other more general parts of the interface. This can
  be used to implement only a narrow part of the interface rather than
  the entire interface. This isn't really ideal, this logic should be
  hoisted into FunctionAAResults as currently it will cause
  a significant amount of redundant work, but it faithfully models the
  behavior of the prior infrastructure.

- All the alias analysis passes are ported to be wrapper passes for the
  legacy PM and new-style analysis passes for the new PM with a shared
  result object. In some cases (most notably CFL), this is an extremely
  naive approach that we should revisit when we can specialize for the
  new pass manager.

- BasicAA has been restructured to reflect that it is much more
  fundamentally a function analysis because it uses dominator trees and
  loop info that need to be constructed for each function.

All of the references to getting alias analysis results have been
updated to use the new aggregation interface. All the preservation and
other pass management code has been updated accordingly.

The way the FunctionAAResultsWrapperPass works is to detect the
available alias analyses when run, and add them to the results object.
This means that we should be able to continue to respect when various
passes are added to the pipeline, for example adding CFL or adding TBAA
passes should just cause their results to be available and to get folded
into this. The exception to this rule is BasicAA which really needs to
be a function pass due to using dominator trees and loop info. As
a consequence, the FunctionAAResultsWrapperPass directly depends on
BasicAA and always includes it in the aggregation.

This has significant implications for preserving analyses. Generally,
most passes shouldn't bother preserving FunctionAAResultsWrapperPass
because rebuilding the results just updates the set of known AA passes.
The exception to this rule are LoopPass instances which need to preserve
all the function analyses that the loop pass manager will end up
needing. This means preserving both BasicAAWrapperPass and the
aggregating FunctionAAResultsWrapperPass.

Now, when preserving an alias analysis, you do so by directly preserving
that analysis. This is only necessary for non-immutable-pass-provided
alias analyses though, and there are only three of interest: BasicAA,
GlobalsAA (formerly GlobalsModRef), and SCEVAA. Usually BasicAA is
preserved when needed because it (like DominatorTree and LoopInfo) is
marked as a CFG-only pass. I've expanded GlobalsAA into the preserved
set everywhere we previously were preserving all of AliasAnalysis, and
I've added SCEVAA in the intersection of that with where we preserve
SCEV itself.

One significant challenge to all of this is that the CGSCC passes were
actually using the alias analysis implementations by taking advantage of
a pretty amazing set of loop holes in the old pass manager's analysis
management code which allowed analysis groups to slide through in many
cases. Moving away from analysis groups makes this problem much more
obvious. To fix it, I've leveraged the flexibility the design of the new
PM components provides to just directly construct the relevant alias
analyses for the relevant functions in the IPO passes that need them.
This is a bit hacky, but should go away with the new pass manager, and
is already in many ways cleaner than the prior state.

Another significant challenge is that various facilities of the old
alias analysis infrastructure just don't fit any more. The most
significant of these is the alias analysis 'counter' pass. That pass
relied on the ability to snoop on AA queries at different points in the
analysis group chain. Instead, I'm planning to build printing
functionality directly into the aggregation layer. I've not included
that in this patch merely to keep it smaller.

Note that all of this needs a nearly complete rewrite of the AA
documentation. I'm planning to do that, but I'd like to make sure the
new design settles, and to flesh out a bit more of what it looks like in
the new pass manager first.

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

llvm-svn: 247167

9 years agoMachineVerifier: Check that SlotIndex MBBIndexList is sorted.
Matthias Braun [Wed, 9 Sep 2015 17:49:46 +0000 (17:49 +0000)]
MachineVerifier: Check that SlotIndex MBBIndexList is sorted.

This introduces a check that the MBBIndexList is sorted as proposed in
http://reviews.llvm.org/D12443 but split up into a separate commit.

llvm-svn: 247166

9 years agoELF2: Return early. NFC.
Rui Ueyama [Wed, 9 Sep 2015 17:40:51 +0000 (17:40 +0000)]
ELF2: Return early. NFC.

llvm-svn: 247165

9 years agoFix some compiler warnings.
Zachary Turner [Wed, 9 Sep 2015 17:25:43 +0000 (17:25 +0000)]
Fix some compiler warnings.

llvm-svn: 247164

9 years ago[clang-tidy] Fix PR22785.
Alexander Kornienko [Wed, 9 Sep 2015 17:06:09 +0000 (17:06 +0000)]
[clang-tidy] Fix PR22785.

Fix http://llvm.org/PR22785. Bug 22785 - readability-braces-around-statements
doesn't work well with macros.

http://reviews.llvm.org/D12729

Patch by Marek Kurdej!

llvm-svn: 247163

9 years agoAMDGPU: Extract full 64-bit subregister and use subregs
Matt Arsenault [Wed, 9 Sep 2015 17:03:29 +0000 (17:03 +0000)]
AMDGPU: Extract full 64-bit subregister and use subregs

Instead of extracting both 32-bit components from the 128-bit
register. This produces fewer copies and is easier for
the copy peephole optimizer to understand and see the actual uses
as extracts from a reg_sequence.

This avoids needing to handle subregister composing in the
PeepholeOptimizer's ValueTracker for this case.

llvm-svn: 247162

9 years agoAMDGPU: Remove unused multiclass argument
Matt Arsenault [Wed, 9 Sep 2015 17:03:18 +0000 (17:03 +0000)]
AMDGPU: Remove unused multiclass argument

llvm-svn: 247161

9 years agoFix a small bug in clang where generating some temporary files would have an extra...
Argyrios Kyrtzidis [Wed, 9 Sep 2015 16:48:47 +0000 (16:48 +0000)]
Fix a small bug in clang where generating some temporary files would have an extra period before the extension.

Patch by Cameron Esfahani!

llvm-svn: 247160

9 years agollvm-config: Add --build-system option
Tom Stellard [Wed, 9 Sep 2015 16:39:30 +0000 (16:39 +0000)]
llvm-config: Add --build-system option

Summary:
This can be used for distinguishing between cmake and autoconf builds.
Users may need this in order to handle inconsistencies between the
outputs of the two build systems.

Reviewers: echristo, chandlerc, beanz

Subscribers: llvm-commits

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

llvm-svn: 247159

9 years ago[WebAssembly] Implement calls with void return types.
Dan Gohman [Wed, 9 Sep 2015 16:13:47 +0000 (16:13 +0000)]
[WebAssembly] Implement calls with void return types.

llvm-svn: 247158

9 years agoAMDGPU/SI: Fold operands through REG_SEQUENCE instructions
Tom Stellard [Wed, 9 Sep 2015 15:43:26 +0000 (15:43 +0000)]
AMDGPU/SI: Fold operands through REG_SEQUENCE instructions

Summary:
This helps mostly when we use add instructions for address calculations
that contain immediates.

Reviewers: arsenm

Subscribers: arsenm, llvm-commits

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

llvm-svn: 247157

9 years ago[CostModel][AArch64] Remove amortization factor for some of the vector select instruc...
Silviu Baranga [Wed, 9 Sep 2015 15:35:02 +0000 (15:35 +0000)]
[CostModel][AArch64] Remove amortization factor for some of the vector select instructions

Summary:
We are not scalarizing the wide selects in codegen for i16 and i32 and
therefore we can remove the amortization factor. We still have issues
with i64 vectors in codegen though.

Reviewers: mcrosier

Subscribers: mcrosier, aemerson, llvm-commits, rengolin

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

llvm-svn: 247156

9 years agoStart adding content to the dynamic section.
Rafael Espindola [Wed, 9 Sep 2015 15:33:08 +0000 (15:33 +0000)]
Start adding content to the dynamic section.

With this patch we create a dynamic string table (it is allocated, unlike
the regular one) and the dynamic section has a DT_STRTAB pointing to it.

llvm-svn: 247155

9 years agodon't repeat function names in comments; NFC
Sanjay Patel [Wed, 9 Sep 2015 15:24:36 +0000 (15:24 +0000)]
don't repeat function names in comments; NFC

llvm-svn: 247154

9 years ago[clang-tidy] Automatically redirect to the new page.
Alexander Kornienko [Wed, 9 Sep 2015 15:23:39 +0000 (15:23 +0000)]
[clang-tidy] Automatically redirect to the new page.

llvm-svn: 247153

9 years ago[WebAssembly] Tidy up some unneeded newline characters.
Dan Gohman [Wed, 9 Sep 2015 15:13:36 +0000 (15:13 +0000)]
[WebAssembly] Tidy up some unneeded newline characters.

llvm-svn: 247152

9 years ago[CMake] Flag recursive cmake invocations for cross-compile
Joseph Tremoulet [Wed, 9 Sep 2015 14:57:06 +0000 (14:57 +0000)]
[CMake] Flag recursive cmake invocations for cross-compile

Summary:
Cross-compilation uses recursive cmake invocations to build native host
tools.  These recursive invocations only forward a fixed set of
variables/options, since the native environment is generally the default.
This change adds -DLLVM_TARGET_IS_CROSSCOMPILE_HOST=TRUE to the recursive
cmake invocations, so that cmake files can distinguish these recursive
invocations from top-level ones, which can explain why expected options
are unset.

LLILC will use this to avoid trying to generate its build rules in the
crosscompile native host target (where it is not needed), which would fail
if attempted because LLILC requires a cmake variable passed on the command
line, which is not forwarded in the recursive invocation.

Reviewers: rnk, beanz

Subscribers: llvm-commits

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

llvm-svn: 247151

9 years agofunction names start with a lower case letter; NFC
Sanjay Patel [Wed, 9 Sep 2015 14:54:29 +0000 (14:54 +0000)]
function names start with a lower case letter; NFC

llvm-svn: 247150

9 years agoAVX512: Implemented encoding and intrinsics for
Igor Breger [Wed, 9 Sep 2015 14:35:09 +0000 (14:35 +0000)]
AVX512: Implemented encoding and intrinsics for
  vextracti64x4 ,vextracti64x2, vextracti32x8, vextracti32x4, vextractf64x4, vextractf64x2, vextractf32x8, vextractf32x4
Added tests for intrinsics and encoding.

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

llvm-svn: 247149

9 years agodon't repeat function names in comments; NFC
Sanjay Patel [Wed, 9 Sep 2015 14:34:26 +0000 (14:34 +0000)]
don't repeat function names in comments; NFC

llvm-svn: 247148

9 years agoDisable support for pointer expressions
Johannes Doerfert [Wed, 9 Sep 2015 14:19:04 +0000 (14:19 +0000)]
Disable support for pointer expressions

  The support for pointer expressions is broken as it can only handle
  some patterns in the IslExprBuilder. We should to treat pointers in
  expressions the same as integers at some point and revert this patch.

llvm-svn: 247147

9 years ago[mips][microMIPS] Implement ADDU16, AND16, ANDI16, NOT16, OR16, SLL16 and SRL16 instr...
Zoran Jovanovic [Wed, 9 Sep 2015 13:55:45 +0000 (13:55 +0000)]
[mips][microMIPS] Implement ADDU16, AND16, ANDI16, NOT16, OR16, SLL16 and SRL16 instructions
Differential Revision: http://reviews.llvm.org/D11178

llvm-svn: 247146

9 years agoFix PR 24633 - Handle undef values when parsing standalone constants.
Alex Lorenz [Wed, 9 Sep 2015 13:44:33 +0000 (13:44 +0000)]
Fix PR 24633 - Handle undef values when parsing standalone constants.

llvm-svn: 247145

9 years ago[Solaris] Use the GCC Installation detector to add the C++ include paths.
Rafael Espindola [Wed, 9 Sep 2015 13:36:00 +0000 (13:36 +0000)]
[Solaris] Use the GCC Installation detector to add the C++ include paths.

Patch by Xan López!

llvm-svn: 247144

9 years agoUpdate expectedFailureFreeBSD to expectedFlakeyFreeBSD for intermittent tests
Ed Maste [Wed, 9 Sep 2015 13:15:14 +0000 (13:15 +0000)]
Update expectedFailureFreeBSD to expectedFlakeyFreeBSD for intermittent tests

Due to LLDB or test race conditions these tests do not pass
consistently.

llvm.org/pr15037
llvm.org/pr19310
llvm.org/pr22611

llvm-svn: 247143

9 years agoGenerate gitversion.h in autoconf builds
Michael Kruse [Wed, 9 Sep 2015 13:15:11 +0000 (13:15 +0000)]
Generate gitversion.h in autoconf builds

Add a custom makefile rule to generate lib/External/isl/gitversion.h
from GIT_HEAD_ID and trigger it using BULIT_SOURCES to ensure the file
exists before compilation starts.

The latest ISL creates gitversion.h from Makefile.am only, instead also
from configure.ac in previous version. While the Polly build invokes
configure, it does not invoke ISL's make such that the file was missing.

Invoking ISL's make would come with additional problems such as
triggering automake because of not preserved file time stamps.
Re-running automake might not be successful on other system
configurations for instance because it was preconfigured without
--with-clang option.

llvm-svn: 247142

9 years agoXFAIL TestFormatters on FreeBSD
Ed Maste [Wed, 9 Sep 2015 13:10:33 +0000 (13:10 +0000)]
XFAIL TestFormatters on FreeBSD

The test is hitting an assertion in Clang.  This is an extension of
r246766.

llvm.org/pr24691

llvm-svn: 247141

9 years agoRename ExitCount to BackedgeTakenCount, because that's what it is.
James Molloy [Wed, 9 Sep 2015 12:51:10 +0000 (12:51 +0000)]
Rename ExitCount to BackedgeTakenCount, because that's what it is.

We called a variable ExitCount, stored the backedge count in it, then redefined it to be the exit count again.

llvm-svn: 247140

9 years agoDelay predication of stores until near the end of vector code generation
James Molloy [Wed, 9 Sep 2015 12:51:06 +0000 (12:51 +0000)]
Delay predication of stores until near the end of vector code generation

Predicating stores requires creating extra blocks. It's much cleaner if we do this in one pass instead of mutating the CFG while writing vector instructions.

Besides which we can make use of helper functions to update domtree for us, reducing the work we need to do.

llvm-svn: 247139

9 years ago[ARM] "cortex-r5f" and "cortex-m4f" are unknown names for clang.
Alexandros Lamprineas [Wed, 9 Sep 2015 11:29:06 +0000 (11:29 +0000)]
[ARM] "cortex-r5f" and "cortex-m4f" are unknown names for clang.
The tests in test/CodeGen/arm-target-features.c are currently
passing but warning messages are suppressed. These tests are now
synchronized with the corresponding changes in Target Parser.

This patch will fix the regressions in clang caused by r247136

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

llvm-svn: 247138

9 years agoFix type in include header name
Tamas Berghammer [Wed, 9 Sep 2015 11:28:52 +0000 (11:28 +0000)]
Fix type in include header name

llvm-svn: 247137

9 years agoLLVM does not distinguish Cortex-M4 from Cortex-M4F neither Cortex-R5 from R5F.
Alexandros Lamprineas [Wed, 9 Sep 2015 11:20:48 +0000 (11:20 +0000)]
LLVM does not distinguish Cortex-M4 from Cortex-M4F neither Cortex-R5 from R5F.
Removed "cortex-r5f" and "cortex-m4f" from Target Parser, sinced they are
unknown cpu names for llvm and clang. Also updated default FPUs for R5 and M4
accordingly.

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

Change-Id: Ib81c7216521a361d8ee1296e4b6a2aa00bd479c5
llvm-svn: 247136

9 years agoAdd missing include after rL247131
Tamas Berghammer [Wed, 9 Sep 2015 11:16:32 +0000 (11:16 +0000)]
Add missing include after rL247131

llvm-svn: 247135

9 years ago[LLDB][MIPS] Added support for the debugging of N32/O32 applications on MIPS64 target.
Mohit K. Bhakkad [Wed, 9 Sep 2015 10:32:20 +0000 (10:32 +0000)]
[LLDB][MIPS] Added support for the debugging of N32/O32 applications on MIPS64 target.
Patch by Nitesh Jain

Reviewers: clayborg, ovyalov.
Subscribers: jaydeep, bhushan, mohit.bhakkad, sagar, nitesh.jain, lldb-commits.
Differential Revision: http://reviews.llvm.org/D12671

llvm-svn: 247134

9 years agoChange the looping stack detection code
Tamas Berghammer [Wed, 9 Sep 2015 10:26:50 +0000 (10:26 +0000)]
Change the looping stack detection code

In some special case (e.g. signal handlers, hand written assembly) it is
valid to have 2 stack frame with the same CFA value. This CL change the
looping stack detection code to report a loop only if at least 3
consecutive frames have the same CFA.

Differential revision: http://reviews.llvm.org/D12699

llvm-svn: 247133

9 years agoAdd basic fission support to SymbolFileDWARF
Tamas Berghammer [Wed, 9 Sep 2015 10:20:48 +0000 (10:20 +0000)]
Add basic fission support to SymbolFileDWARF

* Create new dwo symbol file class
* Add handling for .dwo sections
* Change indexes in SymbolFileDWARF to store compile unit offset next to
  DIE offset
* Propagate queries from dwarf compile unit to the dwo compile unit
  where applicable

Differential revision: http://reviews.llvm.org/D12291

llvm-svn: 247132

9 years agoCode cleanup in preparation of adding split dwarf support
Tamas Berghammer [Wed, 9 Sep 2015 10:20:36 +0000 (10:20 +0000)]
Code cleanup in preparation of adding split dwarf support

* Remove some unused code
* Remove usage of DWARFDebugInfoEntry::Attributes where usage isn't
  reasonable
* Cleanup DWARFMappedHash with separating it to header and implementation
  file and fixing the visibility of the functions

Differential revision: http://reviews.llvm.org/D12374

llvm-svn: 247131

9 years agoRemove the dwo files in the cleanup stage of the tests
Tamas Berghammer [Wed, 9 Sep 2015 10:20:30 +0000 (10:20 +0000)]
Remove the dwo files in the cleanup stage of the tests

The dwo files are generated when the tests run with split dwarf info.

llvm-svn: 247130

9 years ago[LLDB][MIPS] MIPS load/store instruction emulation for hardware watchpoints
Mohit K. Bhakkad [Wed, 9 Sep 2015 10:17:58 +0000 (10:17 +0000)]
[LLDB][MIPS] MIPS load/store instruction emulation for hardware watchpoints

Reviewers: clayborg.
Subscribers: jaydeep, bhushan, sagar, nitesh.jain, lldb-commits.
Differential Revision: http://reviews.llvm.org/D12670

llvm-svn: 247129

9 years agoFix vector splitting for extract_vector_elt and vector elements of <8-bits.
Daniel Sanders [Wed, 9 Sep 2015 09:53:20 +0000 (09:53 +0000)]
Fix vector splitting for extract_vector_elt and vector elements of <8-bits.

Summary:
One of the vector splitting paths for extract_vector_elt tries to lower:
    define i1 @via_stack_bug(i8 signext %idx) {
      %1 = extractelement <2 x i1> <i1 false, i1 true>, i8 %idx
      ret i1 %1
    }
to:
    define i1 @via_stack_bug(i8 signext %idx) {
      %base = alloca <2 x i1>
      store <2 x i1> <i1 false, i1 true>, <2 x i1>* %base
      %2 = getelementptr <2 x i1>, <2 x i1>* %base, i32 %idx
      %3 = load i1, i1* %2
      ret i1 %3
    }
However, the elements of <2 x i1> are not byte-addressible. The result of this
is that the getelementptr expands to '%base + %idx * (1 / 8)' which simplifies
to '%base + %idx * 0', and then simply '%base' causing all values of %idx to
extract element zero.

This commit fixes this by promoting the vector elements of <8-bits to i8 before
splitting the vector.

This fixes a number of test failures in pocl.

Reviewers: pekka.jaaskelainen

Subscribers: pekka.jaaskelainen, llvm-commits

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

llvm-svn: 247128

9 years agoFix a typo I spotted when hacking on SROA. Somewhat alarming that
Chandler Carruth [Wed, 9 Sep 2015 09:46:16 +0000 (09:46 +0000)]
Fix a typo I spotted when hacking on SROA. Somewhat alarming that
nothing broke.

llvm-svn: 247127

9 years agoIslNodeBuilder: Add virtual function to obtain the schedule of an ast node
Tobias Grosser [Wed, 9 Sep 2015 09:24:38 +0000 (09:24 +0000)]
IslNodeBuilder: Add virtual function to obtain the schedule of an ast node

Not all users of our IslNodeBuilder will attach scheduling information to the
AST in the same way IslAstInfo is doing it today. By going through a virtual
function when extracting the schedule of an AST node other users can provide
their own functions for extract scheduling information in case they attach
scheduling information in a different way to the AST nodes.

No functional change for Polly itself intended.

llvm-svn: 247126

9 years ago[mips][microMIPS] Implement CACHEE and PREFE instructions
Zoran Jovanovic [Wed, 9 Sep 2015 09:10:46 +0000 (09:10 +0000)]
[mips][microMIPS] Implement CACHEE and PREFE instructions
Differential Revision: http://reviews.llvm.org/D11628

llvm-svn: 247125

9 years agoRemove an invalid check in DW_OP_piece processing.
Hafiz Abid Qadeer [Wed, 9 Sep 2015 09:06:05 +0000 (09:06 +0000)]
Remove an invalid check in DW_OP_piece processing.

Summary:
When lldb is processing a location containing DW_OP_piece, the result is being
stored in the 'pieces' variable. The location is popped from the 'stack' variable.
So this check to see that 'stack' is not empty was invalid and caused the pieces
after the first to not get processed.

I am working on an architecture which has 16-bit and 8-bit registers. So this
problem was quite easy to see. But I was able to re-produce this issue on x86
too with long long variable and compiling woth -m32. It resulted in following
location list.
00000014 08048496 080484b5 (DW_OP_reg6 (esi); DW_OP_piece: 4; DW_OP_reg7 (edi); DW_OP_piece: 4)

and lldb was only showing the contents of first register when I evaluated the
variable as it does not process the 2nd piece due to this check.

Reviewers: clayborg, aprantl

Subscribers: lldb-commits

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

llvm-svn: 247124

9 years agoAMDGPU: Fix not encoding src2 of VOP3b instructions
Matt Arsenault [Wed, 9 Sep 2015 08:39:49 +0000 (08:39 +0000)]
AMDGPU: Fix not encoding src2 of VOP3b instructions

Broken by r247074. Should include an assembler test,
but the assembler is currently broken for VOP3b apparently.

llvm-svn: 247123

9 years ago[IRCE] Add INITIALIZE_PASS_DEPENDENCY invocations.
Sanjoy Das [Wed, 9 Sep 2015 03:47:18 +0000 (03:47 +0000)]
[IRCE] Add INITIALIZE_PASS_DEPENDENCY invocations.

IRCE was just using INITIALIZE_PASS(), which is incorrect.

llvm-svn: 247122

9 years agoWhen lldb gets the register definitions from the response of a
Jason Molenda [Wed, 9 Sep 2015 03:36:24 +0000 (03:36 +0000)]
When lldb gets the register definitions from the response of a
qXfer:features:read:target.xml packet, or via the
plugin.process.gdb-remote.target-definition-file setting, if the
register definition doesn't give us eh_frame or DWARF register
numbers for that register, try to get that information from the ABI
plugin.

The DWARF/eh_frame register numbers are defined in the ABI
standardization documents - so getting this from the ABI plugin is
reasonable.  There's little value in having the remote stub inform
us of this generic information, as long as we can all agree on the
names of the registers.

There's some additional information we could get from the ABI.  For
instance, on ABIs where function arguments are passed in registers,
lldb defines alternate names like "arg1", "arg2", "arg3" for these
registers so they can be referred to that way by the user.  We could
get this from the ABI if the remote stub doesn't provide that.  That
may be something worth doing in the future - but for now, I'm keeping
this a little more minimal.

Thinking about this, what we want/need from the remote stub at a
minimum are:

 1. The names of the register
 2. The number that the stub will use to refer to the register with
    the p/P packets and in the ? response packets (T/S) where
    expedited register values are provided
 3. The size of the register in bytes

(nice to have, to remove any doubt)
 4. The offset of the register in the g/G packet if we're going to
    use that for reading/writing registers.

debugserver traditionally provides a lot more information in
addition to this via the qRegisterInfo packet, and debugserver
augments its response to the qXfer:features:read:target.xml
query to include this information.  Including:

DWARF regnum, eh_frame regnum, stabs regnum, encoding (ieee754,
Uint, Vector, Sint), format (hex, unsigned, pointer, vectorof*,
float), registers that should be marked as invalid if this
register is modified, and registers that contain this register.

We might want to get all of this from the ABI - I'm not convinced
that it makes sense for the remote stub to provide any of these
details, as long as the ABI and remote stub can agree on register
names.

Anyway, start with eh_frame and DWARF coming from the ABI if
they're not provided by the remote stub.  We can look at doing
more in the future.

<rdar://problem/22566585>

llvm-svn: 247121