platform/upstream/llvm.git
8 years agoLowerBitSets: Don't bother to do any work if the llvm.bitset.test intrinsic is unused.
Peter Collingbourne [Wed, 3 Feb 2016 03:48:46 +0000 (03:48 +0000)]
LowerBitSets: Don't bother to do any work if the llvm.bitset.test intrinsic is unused.

llvm-svn: 259625

8 years agoMake CF constant string decl visible to name lookup to fix module errors
Ben Langmuir [Wed, 3 Feb 2016 03:26:19 +0000 (03:26 +0000)]
Make CF constant string decl visible to name lookup to fix module errors

The return type of the __builtin___*StringMakeConstantString functions
is a pointer to a struct, so we need that struct to be visible to name
lookup so that we will correctly merge multiple declarations of that
type if they come from different modules.

Incidentally, to make this visible to name lookup we need to rename the
type to __NSConstantString, since the real NSConstantString is an
Objective-C interface type.  This shouldn't affect anyone outside the
compiler since users of the constant string builtins cast the result
immediately to CFStringRef.

Since this struct type is otherwise implicitly created by the AST
context and cannot access namelookup, we make this a predefined type
and initialize it in Sema.

Note: this issue of builtins that refer to types not visible to name
lookup technically also affects other builtins (e.g. objc_msgSendSuper),
but in all other cases the builtin is a library builtin and the issue
goes away if you include the library that defines the types it uses,
unlike for these constant string builtins.

rdar://problem/24425801

llvm-svn: 259624

8 years agoAdd #include "llvm/Support/raw_ostream.h" to fix Windows build.
Peter Collingbourne [Wed, 3 Feb 2016 03:16:37 +0000 (03:16 +0000)]
Add #include "llvm/Support/raw_ostream.h" to fix Windows build.

llvm-svn: 259623

8 years agoFix miscompile and rejects-valids when disambiguating after an ambiguous
Richard Smith [Wed, 3 Feb 2016 02:58:20 +0000 (02:58 +0000)]
Fix miscompile and rejects-valids when disambiguating after an ambiguous
C-style-cast to function/array type or parenthesized function-style cast/array
indexing.

llvm-svn: 259622

8 years agoTransforms: Move GlobalOpt's Evaluator to Utils where it can be reused.
Peter Collingbourne [Wed, 3 Feb 2016 02:51:00 +0000 (02:51 +0000)]
Transforms: Move GlobalOpt's Evaluator to Utils where it can be reused.

llvm-svn: 259621

8 years agoFix typo in comment. NFC
Nick Lewycky [Wed, 3 Feb 2016 02:15:49 +0000 (02:15 +0000)]
Fix typo in comment. NFC

llvm-svn: 259620

8 years agodocs: Document how bitsets may be used to encode type information.
Peter Collingbourne [Wed, 3 Feb 2016 02:01:08 +0000 (02:01 +0000)]
docs: Document how bitsets may be used to encode type information.

llvm-svn: 259619

8 years agoFix typo in OpenCL type mangling. This is still bogus (we should either use the
Richard Smith [Wed, 3 Feb 2016 01:43:59 +0000 (01:43 +0000)]
Fix typo in OpenCL type mangling. This is still bogus (we should either use the
actual source name of the typedef or a vendor mangling) but at least it stands
a chance of demangling now.

We would also benefit from some test coverage of this (OpenCL +
__attribute__((overloadable)) is probably required to reach this).

llvm-svn: 259618

8 years agoCodegen: [PPC] Fix PPCVSXFMAMutate to handle duplicates.
Kyle Butt [Wed, 3 Feb 2016 01:41:09 +0000 (01:41 +0000)]
Codegen: [PPC] Fix PPCVSXFMAMutate to handle duplicates.

The purpose of PPCVSXFMAMutate is to elide copies by changing FMA forms
on PPC.

    %vreg6<def> = COPY %vreg96
    %vreg6<def,tied1> = XSMADDASP %vreg6<tied0>, %vreg5<kill>, %vreg7
    ;v6 = v6 + v5 * v7

is replaced by

    %vreg5<def,tied1> = XSMADDMSP %vreg5<tied0>, %vreg7, %vreg96
    ;v5 = v5 * v7 + v96

This was broken in the case where the target register was also used as a
multiplicand. Fix this case by checking for it and replacing both uses
with the copied register.

    %vreg6<def> = COPY %vreg96
    %vreg6<def,tied1> = XSMADDASP %vreg6<tied0>, %vreg5<kill>, %vreg6
    ;v6 = v6 + v5 * v6

is replaced by

    %vreg5<def,tied1> = XSMADDMSP %vreg5<tied0>, %vreg96, %vreg96
    ;v5 = v5 * v96 + v96

llvm-svn: 259617

8 years agoFix Itanium RTTI emission so that we emit fundamental type information into the
Richard Smith [Wed, 3 Feb 2016 01:32:42 +0000 (01:32 +0000)]
Fix Itanium RTTI emission so that we emit fundamental type information into the
C++ ABI library for the same set of types for which we expect the C++ ABI
library to provide the RTTI.

Specifically:
 1) __int128 and unsigned __int128 are now emitted into the ABI library. We
    always expected them to be there but never actually made sure to emit them.
 2) Do not expect OpenCL builtin types to have type info in the C++ ABI library.
    Neither libc++abi nor libstdc++ puts them there when built with either GCC
    or Clang.

This matches GCC's behavior.

llvm-svn: 259616

8 years agoRevert r259576: Disable the vzeroupper insertion pass on PS4.
Yunzhong Gao [Wed, 3 Feb 2016 01:25:12 +0000 (01:25 +0000)]
Revert r259576: Disable the vzeroupper insertion pass on PS4.
Will re-implement based on review feedback.

llvm-svn: 259615

8 years agoRegCoalescer: Making sure re-materialization defines all subranges
Marcello Maggioni [Wed, 3 Feb 2016 00:22:32 +0000 (00:22 +0000)]
RegCoalescer: Making sure re-materialization defines all subranges

The register coalescer can rematerialize constants that define
more of a register than the copy it is going to replace was going
to do.
This is valid in the case the register was undef before the
copy happened.
This patch makes sure that all the subranges defined by the new
rematerialization instructions have at least a dead def.

Review: http://reviews.llvm.org/D16693
llvm-svn: 259614

8 years agoDefine SymbolBody::getSize instead of getSymSize(SymbolBody&). NFC.
Rui Ueyama [Wed, 3 Feb 2016 00:12:24 +0000 (00:12 +0000)]
Define SymbolBody::getSize instead of getSymSize(SymbolBody&). NFC.

llvm-svn: 259613

8 years agoDiagnosticInfoWithDebugLocBase: Appease Twine for now.
NAKAMURA Takumi [Wed, 3 Feb 2016 00:09:22 +0000 (00:09 +0000)]
DiagnosticInfoWithDebugLocBase: Appease Twine for now.

FIXME: We should get rid of Twine in the record.
llvm-svn: 259612

8 years agoThe compiler may use "line number 0" to indicate compiler generated goo that it can't
Jim Ingham [Wed, 3 Feb 2016 00:07:23 +0000 (00:07 +0000)]
The compiler may use "line number 0" to indicate compiler generated goo that it can't
track a source for.  When we are pushing breakpoints and stepping past function prologues,
also push past code from line 0 immediately following the prologue end.

<rdar://problem/23730696>

llvm-svn: 259611

8 years ago[LoopVersioning] Expose loop versioning as a pass too
Adam Nemet [Wed, 3 Feb 2016 00:06:10 +0000 (00:06 +0000)]
[LoopVersioning] Expose loop versioning as a pass too

Summary:
LoopVersioning is a transform utility that transform passes can use to
run-time disambiguate may-aliasing accesses. I'd like to also expose as
pass to allow it to be unit-tested.

I am planning to add support for non-aliasing annotation in
LoopVersioning and I'd like to be able to write tests directly using
this pass.

(After that feature is done, the pass could also be used to look for
optimization opportunities that are hidden behind incomplete alias
information at compile time.)

The pass drives LoopVersioning in its default way which is to fully
disambiguate may-aliasing accesses no matter how many checks are
required.

Reviewers: hfinkel, ashutosh.nema, sbaranga

Subscribers: zzheng, mssimpso, llvm-commits, sanjoy

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

llvm-svn: 259610

8 years agoPR24989: Stop trying to use the C++11 rules for lambda return type inference in
Richard Smith [Tue, 2 Feb 2016 23:58:56 +0000 (23:58 +0000)]
PR24989: Stop trying to use the C++11 rules for lambda return type inference in
C++14 generic lambdas. It conflicts with the C++14 return type deduction
mechanism, and results in us failing to actually deduce the lambda's return
type in some cases.

llvm-svn: 259609

8 years agoFix inverted conditional in TestInferiorAssert.py
Zachary Turner [Tue, 2 Feb 2016 23:56:45 +0000 (23:56 +0000)]
Fix inverted conditional in TestInferiorAssert.py

llvm-svn: 259608

8 years agoFix a thinko in StackFrame::GetInScopeVariableList.
Siva Chandra [Tue, 2 Feb 2016 23:49:41 +0000 (23:49 +0000)]
Fix a thinko in StackFrame::GetInScopeVariableList.

Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 259607

8 years agoELF: Write about the current policy to README.
Rui Ueyama [Tue, 2 Feb 2016 23:45:54 +0000 (23:45 +0000)]
ELF: Write about the current policy to README.

llvm-svn: 259606

8 years agoSet correct thread stop info when single-step lands on a breakpoint [Windows]
Adrian McCarthy [Tue, 2 Feb 2016 23:38:08 +0000 (23:38 +0000)]
Set correct thread stop info when single-step lands on a breakpoint [Windows]

I don't understand how this worked before, but this fixes the recent test regressions on Windows in TestConsecutiveBreakpoints.py.

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

llvm-svn: 259605

8 years agoFix rejects-valid when forming a pointer-to-member with 'decltype(expr)::*'.
Richard Smith [Tue, 2 Feb 2016 23:34:49 +0000 (23:34 +0000)]
Fix rejects-valid when forming a pointer-to-member with 'decltype(expr)::*'.

llvm-svn: 259604

8 years agoAttempt #2 to unbreak r259595.
George Burgess IV [Tue, 2 Feb 2016 23:26:01 +0000 (23:26 +0000)]
Attempt #2 to unbreak r259595.

llvm-svn: 259602

8 years ago[codeview] Improve readability of codeview assembly output
David Majnemer [Tue, 2 Feb 2016 23:18:23 +0000 (23:18 +0000)]
[codeview] Improve readability of codeview assembly output

Strictly speaking, this is not an improvement in functionality per se
but a usability improvement to those debugging codeview.

llvm-svn: 259601

8 years ago[libFuzzer] don't create too many trace-based mutations as it may be too slow
Kostya Serebryany [Tue, 2 Feb 2016 23:17:45 +0000 (23:17 +0000)]
[libFuzzer] don't create too many trace-based mutations as it may be too slow

llvm-svn: 259600

8 years agoAttempt to fix builds broken by r259595.
George Burgess IV [Tue, 2 Feb 2016 23:15:26 +0000 (23:15 +0000)]
Attempt to fix builds broken by r259595.

llvm-svn: 259599

8 years agoWork around build failure due to GCC 4.8.1 bug. We don't completely understand
Richard Smith [Tue, 2 Feb 2016 23:11:49 +0000 (23:11 +0000)]
Work around build failure due to GCC 4.8.1 bug. We don't completely understand
the details of the bug, but avoiding overloading llvm::cast with another
function template sidesteps it.

See gcc.gnu.org/PR58022 for details of the bug, and llvm.org/PR26362 for more
backgound on how it manifested in Clang. Patch by Igor Sugak!

llvm-svn: 259598

8 years agoELF: Make link() to take an output stream to which error messages are written.
Rui Ueyama [Tue, 2 Feb 2016 22:49:32 +0000 (22:49 +0000)]
ELF: Make link() to take an output stream to which error messages are written.

http://reviews.llvm.org/D16668

llvm-svn: 259597

8 years agoELF: Do not exit if it cannot open an output file.
Rui Ueyama [Tue, 2 Feb 2016 22:48:04 +0000 (22:48 +0000)]
ELF: Do not exit if it cannot open an output file.

It can fail to open an output file for various reasons, including
lack of permission, too long filename, or the output file is not
a mmap'able file.

llvm-svn: 259596

8 years agoThis patch adds MemorySSA to LLVM.
George Burgess IV [Tue, 2 Feb 2016 22:46:49 +0000 (22:46 +0000)]
This patch adds MemorySSA to LLVM.

Please see include/llvm/Transforms/Utils/MemorySSA.h for a description
of MemorySSA, and what it does.

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

llvm-svn: 259595

8 years ago[LVI] Fix debug output
Philip Reames [Tue, 2 Feb 2016 22:43:08 +0000 (22:43 +0000)]
[LVI] Fix debug output

Due to staleness in a patch I committed yesterday, the debug output was reporting overdefined cases as being undefined.  Confusing to say the least.  The mistake appears to have only effected the debug output thankfully.

llvm-svn: 259594

8 years ago[TSan] Use darwin_filter_host_arch to restrict set of test arch on Mac OS.
Alexey Samsonov [Tue, 2 Feb 2016 22:42:25 +0000 (22:42 +0000)]
[TSan] Use darwin_filter_host_arch to restrict set of test arch on Mac OS.

This also reverts r259577 which was a quick-fix to fix buildbots.

llvm-svn: 259593

8 years ago[CUDA] Do not allow dynamic initialization of global device side variables.
Artem Belevich [Tue, 2 Feb 2016 22:29:48 +0000 (22:29 +0000)]
[CUDA] Do not allow dynamic initialization of global device side variables.

In general CUDA does not allow dynamic initialization of
global device-side variables. One exception is that CUDA allows
records with empty constructors as described in section E2.2.1 of
CUDA 7.5 Programming guide.

This patch applies initializer checks for all device-side variables.
Empty constructors are accepted, but no code is generated for them.

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

llvm-svn: 259592

8 years agoObjCXX: fix a crash during typo correction.
Manman Ren [Tue, 2 Feb 2016 22:23:03 +0000 (22:23 +0000)]
ObjCXX: fix a crash during typo correction.

For ObjCXX, we can create a CastExpr with Kind being CK_UserDefinedConversion
and SubExpr being BlockExpr. Specifically one can return BlockExpr from
BuildCXXMemberCallExpr and the result can be used to build a CastExpr.

Fix the assumption in CastExpr::getSubExprAsWritten that SubExpr can only
be CXXMemberCallExpr.

rdar://problem/24364077

llvm-svn: 259591

8 years agoDon't return a tuple from the skip test function.
Zachary Turner [Tue, 2 Feb 2016 22:22:53 +0000 (22:22 +0000)]
Don't return a tuple from the skip test function.

Previously we were returning a tuple of (bool, skip_reason) from
the tuple function.  This makes for some awkward code, especially
since a value of True for the first argument implies that the
second argument is None, and a value of False implies that the
second argument is not None.  So it was basically redundant, and
with this patch we simply return the skip reason or None directly.

llvm-svn: 259590

8 years ago__mh_execute_header atoms should be global and never dead strippped.
Pete Cooper [Tue, 2 Feb 2016 22:19:01 +0000 (22:19 +0000)]
__mh_execute_header atoms should be global and never dead strippped.

In r259574 I fixed some of the issues with the mach header symbols
and DSO handles.

This is the next issue whereby the __mh_execute_header has to not
be dead stripped, and (to match ld64) should be dynamically referenced.

The test here should also have been added in r259574 to make sure that
we emit this symbol.  But checking that it is not only emitted but also
has the correct reference type is fine.

llvm-svn: 259589

8 years ago[asan] Remove redundant elif
Anna Zaks [Tue, 2 Feb 2016 22:05:47 +0000 (22:05 +0000)]
[asan] Remove redundant elif

This is a fixup to r259451.

llvm-svn: 259588

8 years agoSupport loads with differently sized types from a single array
Tobias Grosser [Tue, 2 Feb 2016 22:05:29 +0000 (22:05 +0000)]
Support loads with differently sized types from a single array

We support now code such as:

void multiple_types(char *Short, char *Float, char *Double) {
  for (long i = 0; i < 100; i++) {
    Short[i] = *(short *)&Short[2 * i];
    Float[i] = *(float *)&Float[4 * i];
    Double[i] = *(double *)&Double[8 * i];
  }
}

To support such code we use as element type of the modeled array the smallest
element type of all original array accesses. Accesses with larger types are
modeled as multiple accesses with the smaller type.

For example the second load access is modeled as:

  { Stmt_bb2[i0] -> MemRef_Float[o0] : 4i0 <= o0 <= 3 + 4i0 }

To support jscop-rewritable memory accesses we need each statement instance to
only be assigned a single memory location, which will be the address at which
we load the value. Currently we obtain this address by taking the lexmin of
the access function. We may consider keeping track of the memory location more
explicitly in the future.

llvm-svn: 259587

8 years ago[asan] Add iOS support to AddressSanitzier
Anna Zaks [Tue, 2 Feb 2016 22:05:07 +0000 (22:05 +0000)]
[asan] Add iOS support to AddressSanitzier

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

llvm-svn: 259586

8 years ago[LVI] Code motion only [NFC]
Philip Reames [Tue, 2 Feb 2016 22:03:19 +0000 (22:03 +0000)]
[LVI] Code motion only [NFC]

I introduced a declaration in 259583 to keep the diff readable.  This change just moves the definition up to remove the declaration again.

llvm-svn: 259585

8 years agoAdd "REQUIRES: shell" to fix Windows buildbot.
Rui Ueyama [Tue, 2 Feb 2016 21:58:39 +0000 (21:58 +0000)]
Add "REQUIRES: shell" to fix Windows buildbot.

llvm-svn: 259584

8 years ago[LVI] Refactor to use newly introduced intersect utility
Philip Reames [Tue, 2 Feb 2016 21:57:37 +0000 (21:57 +0000)]
[LVI] Refactor to use newly introduced intersect utility

This patch uses the newly introduced 'intersect' utility (from 259461: [LVI] Introduce an intersect operation on lattice values) to simplify existing code in LVI.

While not introducing any new concepts, this change is probably not NFC.  The common 'intersect' function is more powerful that the ad-hoc implementations we'd had in a couple of places.  Given that, we may see optimizations triggering a bit more often.

llvm-svn: 259583

8 years agoRemove utils/buildit
Justin Bogner [Tue, 2 Feb 2016 21:56:16 +0000 (21:56 +0000)]
Remove utils/buildit

The autoconf build system was removed - this doesn't even work and
doesn't need to be here.

llvm-svn: 259582

8 years agoCorrect size calculations for ELF files
Hemant Kulkarni [Tue, 2 Feb 2016 21:41:49 +0000 (21:41 +0000)]
Correct size calculations for ELF files

llvm-svn: 259578

8 years ago[tsan] Disable x86_64h build that was enabled as part of r259542.
Daniel Sanders [Tue, 2 Feb 2016 21:41:17 +0000 (21:41 +0000)]
[tsan] Disable x86_64h build that was enabled as part of r259542.

It fails almost every test on clang-stage1-cmake-RA_check.

llvm-svn: 259577

8 years agoDisable the vzeroupper insertion pass on PS4.
Yunzhong Gao [Tue, 2 Feb 2016 21:39:23 +0000 (21:39 +0000)]
Disable the vzeroupper insertion pass on PS4.
See comments in test/CodeGen/X86/avx-vzeroupper.ll for more explanation.

Original patch by: Sean Silva

llvm-svn: 259576

8 years ago[Orc] Stub addresses should be based on stub size, not pointer size.
Lang Hames [Tue, 2 Feb 2016 21:38:30 +0000 (21:38 +0000)]
[Orc] Stub addresses should be based on stub size, not pointer size.

This didn't affect X86_64, which is the only client of this code at the moment,
as stubs and pointers are both 8-bytes there. It will affect other platforms
though.

llvm-svn: 259575

8 years agoFix handling of mach header and DSO handle symbols.
Pete Cooper [Tue, 2 Feb 2016 21:37:15 +0000 (21:37 +0000)]
Fix handling of mach header and DSO handle symbols.

The magic file which contained these symbols inherited from archive
which meant that the resolver didn't add the required atoms as archive
members only get added when referenced.  Instead we now inherit from
SimpleFile which always links in the atoms needed.

The second issue was in the handling of these symbols when we emit
the MachO.  The mach header symbol needs to be in the atom list as
it gets an offset (0), and being in the atom list makes sure it is
emitted to the symbol table.  DSO handles are not emitted to the
symbol table.

rdar://problem/24450654

llvm-svn: 259574

8 years agoAMDGPU: Do not promote allocas with non-inbounds GEPs
Matt Arsenault [Tue, 2 Feb 2016 21:16:12 +0000 (21:16 +0000)]
AMDGPU: Do not promote allocas with non-inbounds GEPs

If we can't assume the pointer value isn't within the bounds
of the object, it seems risky to try to replace the pointer
calculations.

llvm-svn: 259573

8 years agoRe-submit ELF: Report multiple errors from the driver.
Rui Ueyama [Tue, 2 Feb 2016 21:13:09 +0000 (21:13 +0000)]
Re-submit ELF: Report multiple errors from the driver.

This reverts r259395 which reverted r259143.

llvm-svn: 259572

8 years agoELF: Rewrite "echo" command arguments in hope that would fix a test breakage.
Rui Ueyama [Tue, 2 Feb 2016 21:03:56 +0000 (21:03 +0000)]
ELF: Rewrite "echo" command arguments in hope that would fix a test breakage.

Previously, we used both single quotes and double quotes, and
some single-quoted tokens are concatenated with next tokens because
there were no spaces between them. That may be a cause of test flakiness
on Windows, which is reported as https://llvm.org/bugs/show_bug.cgi?id=26388.

The new test commands are more straightforward than before.

llvm-svn: 259559

8 years agoAMDGPU: Handle promoting memmove
Matt Arsenault [Tue, 2 Feb 2016 20:28:10 +0000 (20:28 +0000)]
AMDGPU: Handle promoting memmove

Also add missing tests for the others.

llvm-svn: 259558

8 years agoELF: Do not use fatal in LinkerScript.cpp.
Rui Ueyama [Tue, 2 Feb 2016 20:27:59 +0000 (20:27 +0000)]
ELF: Do not use fatal in LinkerScript.cpp.

This patch adds "Error" field to LinkerScript class. That field
is false by default, and set to true if there is a syntax error
in an input file. The linker script parser is a recursive-descedent
parser. Each function returns if Error is true -- so that
eventually the whole parser returns to a caller.

http://reviews.llvm.org/D16667

llvm-svn: 259557

8 years agoRevert "[NFC] Cleanup RangeMap.h"
Todd Fiala [Tue, 2 Feb 2016 20:26:50 +0000 (20:26 +0000)]
Revert "[NFC] Cleanup RangeMap.h"

This reverts commit r259538.  Caused 92 test failures on
the OS X testbot.

llvm-svn: 259556

8 years agoDo not use filename in a lit test.
Rui Ueyama [Tue, 2 Feb 2016 20:24:33 +0000 (20:24 +0000)]
Do not use filename in a lit test.

So that the file is move-safe.

llvm-svn: 259555

8 years agoELF: Use StringRef instead of std::string.
Rui Ueyama [Tue, 2 Feb 2016 20:24:31 +0000 (20:24 +0000)]
ELF: Use StringRef instead of std::string.

All MemoryBuffers for archive files are guaranteed to exist as long
as their children are used in the linker. So we don't need to copy
strings here. Thanks to Sean Silva for pointing this out.

llvm-svn: 259554

8 years ago[X86] Fix the merging of SP updates in prologue/epilogue insertions.
Quentin Colombet [Tue, 2 Feb 2016 20:11:17 +0000 (20:11 +0000)]
[X86] Fix the merging of SP updates in prologue/epilogue insertions.
When the merging was involving LEAs, we were taking the wrong immediate
from the list of operands.

rdar://problem/24446069

llvm-svn: 259553

8 years agoMachineVerifier: Check that defs/uses are live in subregisters as well.
Matthias Braun [Tue, 2 Feb 2016 20:04:51 +0000 (20:04 +0000)]
MachineVerifier: Check that defs/uses are live in subregisters as well.

llvm-svn: 259552

8 years agoAMDGPU: Skip promote alloca with no optimizations
Matt Arsenault [Tue, 2 Feb 2016 19:32:42 +0000 (19:32 +0000)]
AMDGPU: Skip promote alloca with no optimizations

llvm-svn: 259551

8 years agoAMDGPU: Minor cleanups for AMDGPUPromoteAlloca
Matt Arsenault [Tue, 2 Feb 2016 19:32:35 +0000 (19:32 +0000)]
AMDGPU: Minor cleanups for AMDGPUPromoteAlloca

Mostly convert to use range loops.

llvm-svn: 259550

8 years ago[Orc] Turn OrcX86_64::IndirectStubsInfo into a template helper class:
Lang Hames [Tue, 2 Feb 2016 19:31:15 +0000 (19:31 +0000)]
[Orc] Turn OrcX86_64::IndirectStubsInfo into a template helper class:
GenericIndirectStubsInfo.

This will allow architecture support classes for other architectures to re-use
this code.

llvm-svn: 259549

8 years ago[codeview] Correctly handle inlining functions post-dominated by unreachable
David Majnemer [Tue, 2 Feb 2016 19:22:34 +0000 (19:22 +0000)]
[codeview] Correctly handle inlining functions post-dominated by unreachable

CodeView requires us to accurately describe the extent of the inlined
code.  We did this by grabbing the next debug location in source order
and using *that* to denote where we stopped inlining.  However, this is
not sufficient or correct in instances where there is no next debug
location or the next debug location belongs to the start of another
function.

To get this correct, use the end symbol of the function to denote the
last possible place the inlining could have stopped at.

llvm-svn: 259548

8 years agoAMDGPU: Report AMDGPUPromoteAlloca changed the function
Matt Arsenault [Tue, 2 Feb 2016 19:18:57 +0000 (19:18 +0000)]
AMDGPU: Report AMDGPUPromoteAlloca changed the function

llvm-svn: 259547

8 years agoAMDGPU: Whitelist handled intrinsics
Matt Arsenault [Tue, 2 Feb 2016 19:18:53 +0000 (19:18 +0000)]
AMDGPU: Whitelist handled intrinsics

We shouldn't crash on unhandled intrinsics.
Also simplify failure handling in loop.

llvm-svn: 259546

8 years agoAMDGPU: Use inbounds when calculating workitem offset
Matt Arsenault [Tue, 2 Feb 2016 19:18:48 +0000 (19:18 +0000)]
AMDGPU: Use inbounds when calculating workitem offset

When promoting allocas to LDS, we know we are indexing
into a specific area just created, and the calculation
will also never overflow.

Also emit some of the muls as nsw nuw, because instcombine
infers this already from the range metadata. I think
putting this on the other adds and muls might be OK too,
but I'm not 100% sure.

llvm-svn: 259545

8 years agoReverting r259529 (Marking the mmap_stress.cc TSan test as unsupported on OS X)
Kuba Brecka [Tue, 2 Feb 2016 18:52:48 +0000 (18:52 +0000)]
Reverting r259529 (Marking the mmap_stress.cc TSan test as unsupported on OS X)

llvm-svn: 259544

8 years agoRe-write many skip decorators to use shared code.
Zachary Turner [Tue, 2 Feb 2016 18:50:34 +0000 (18:50 +0000)]
Re-write many skip decorators to use shared code.

This should be no functional change, just a refactoring of the
skip decorators to all centralize on a single function,
`skipTestIfFn` that does all the logic.  This allows easier
maintenance of the decorators and also centralizes all the
hard-to-understand logic in one place.

Reviewed by: Pavel Labath
Differential Revision: http://reviews.llvm.org/D16741

llvm-svn: 259543

8 years agoRe-commit r259512: [tsan] Add a libc++ and lit testsuite for each ${TSAN_SUPPORTED_ARCH}.
Daniel Sanders [Tue, 2 Feb 2016 18:43:53 +0000 (18:43 +0000)]
Re-commit r259512: [tsan] Add a libc++ and lit testsuite for each ${TSAN_SUPPORTED_ARCH}.

Summary:
This is a workaround to a problem in the 3.8 release that affects MIPS and
possibly other targets where the default is not supported but a sibling is
supported.

When TSAN_SUPPORTED_ARCH is not empty, cmake currently attempts to build a
tsan'd libcxx as well as test tsan for the default target regardless of whether
the default target is supported or not. This causes problems on MIPS32 since
tsan is supported for MIPS64 but not MIPS32.

This patch causes cmake to only build the libcxx and run the lit test-suite for
archictures in ${TSAN_SUPPORTED_ARCH}

This re-commit fixes an issue where 'check-tsan' continued to look for the
tsan'd libc++ in the directory it used to be built in.

Reviewers: hans, samsonov

Subscribers: tberghammer, llvm-commits, danalbert, srhines, dvyukov

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

llvm-svn: 259542

8 years agoCast the fifth arg to mremap to void *
Alexey Samsonov [Tue, 2 Feb 2016 18:36:28 +0000 (18:36 +0000)]
Cast the fifth arg to mremap to void *

Summary:
Since the prototype of mremap is

```
void *mremap(void *old_address, size_t old_size, size_t new_size,
             int flags, ... /* void *new_address*/);
```
we need to cast new_address to void * when calling mremap.  Otherwise,
the wrong value will be passed to mremap on x32.

Patch by H.J Lu!

Reviewers: kcc, eugenis, samsonov

Subscribers: samsonov, llvm-commits

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

llvm-svn: 259540

8 years agoFix Clang-tidy readability-redundant-control-flow warnings; other minor fixes.
Eugene Zelenko [Tue, 2 Feb 2016 18:20:45 +0000 (18:20 +0000)]
Fix Clang-tidy readability-redundant-control-flow warnings; other minor fixes.

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

llvm-svn: 259539

8 years ago[NFC] Cleanup RangeMap.h
Tamas Berghammer [Tue, 2 Feb 2016 18:18:13 +0000 (18:18 +0000)]
[NFC] Cleanup RangeMap.h

The file contained very similar 4 implementation of the same data
structure with a lot of duplicated code and some minor API differences.
This CL refactor the class to eliminate the duplicated codes and to
unify the APIs.

RangeMap.h also contained a class called AddressDataArray what have very
little added functionality over an std::vector and used only by
ObjectFileMacO The CL moves the class to ObjectFileMachO.cpp as it isn't
belongs into RangeMap.h and shouldn't be used in new places anyway
because of the little added functionality.

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

llvm-svn: 259538

8 years agoARM: allow both vfma and vfms intrinsics on v7.
Tim Northover [Tue, 2 Feb 2016 18:02:10 +0000 (18:02 +0000)]
ARM: allow both vfma and vfms intrinsics on v7.

The main purpose here is that vfma/vfms should be symmetric, and they are
supported on most v7 cores.

The new ArchGuard is suggested by ACLE but prophylactic for us. Almost all CPUs
with NEON *will* have vfma, and the few exceptions I know of (e.g. Cortex-A8)
are incorrectly modelled by Clang so can't trigger a test.

Fortunately, they're getting rarer. But if we ever do support them properly
arm_neon.h should now do the right thing.

llvm-svn: 259537

8 years ago[codeview] Wire up the .cv_inline_linetable directive
Reid Kleckner [Tue, 2 Feb 2016 17:41:18 +0000 (17:41 +0000)]
[codeview] Wire up the .cv_inline_linetable directive

This directive emits the binary annotations that describe line and code
deltas in inlined call sites. Single-stepping through inlined frames in
windbg now works.

llvm-svn: 259535

8 years agoPR23057: Fix assertion `Val && "isa<> used on a null pointer"' on invalid for-range...
Denis Zobnin [Tue, 2 Feb 2016 17:33:09 +0000 (17:33 +0000)]
PR23057: Fix assertion `Val && "isa<> used on a null pointer"' on invalid for-range expression.

Fix the issue discovered by fuzzing (PR23057, comment 18) by handling nullptr in Sema::ActOnCXXForRangeDecl
and correct delayed typos in for-range expression before calling Sema::ActOnCXXForRangeStmt. Also fixes PR26288.

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

llvm-svn: 259532

8 years ago[clang-tidy] Removed unnecessary parameters in the test
Alexander Kornienko [Tue, 2 Feb 2016 17:27:08 +0000 (17:27 +0000)]
[clang-tidy] Removed unnecessary parameters in the test

llvm-svn: 259531

8 years ago[clang-tidy] Add non-constant references in function parameters check.
Alexander Kornienko [Tue, 2 Feb 2016 17:27:01 +0000 (17:27 +0000)]
[clang-tidy] Add non-constant references in function parameters check.

Summary: This is implemented originally by Alexander Kornienko.

Reviewers: alexfh

Subscribers: cfe-commits

Patch by Haojian Wu!

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

llvm-svn: 259530

8 years agoMarking the mmap_stress.cc TSan test as unsupported on OS X (it's flaky here).
Kuba Brecka [Tue, 2 Feb 2016 17:21:12 +0000 (17:21 +0000)]
Marking the mmap_stress.cc TSan test as unsupported on OS X (it's flaky here).

llvm-svn: 259529

8 years ago[MC] Enable eip-relative addressing on x86-64 for X32 ABI
Derek Schuff [Tue, 2 Feb 2016 17:20:04 +0000 (17:20 +0000)]
[MC] Enable eip-relative addressing on x86-64 for X32 ABI

Summary:
Enables eip-based addressing, e.g.,

lea    constant(%eip), %rax
lea    constant(%eip), %eax

in MC, (used for the x32 ABI). EIP-base addressing is also valid in x86_64,
it is left enabled for that architecture as well.

Patch by João Porto

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

llvm-svn: 259528

8 years agoXFAIL TestConsecutiveBreakpoints.test_single_step_thread_specific on OSX
Pavel Labath [Tue, 2 Feb 2016 17:02:58 +0000 (17:02 +0000)]
XFAIL TestConsecutiveBreakpoints.test_single_step_thread_specific on OSX

llvm-svn: 259527

8 years agoskip TestWatchLocation on OS X
Todd Fiala [Tue, 2 Feb 2016 17:00:34 +0000 (17:00 +0000)]
skip TestWatchLocation on OS X

Skipping this test while I investigate.  It started failing
with r259379.  (It is generating an error due to unicode
decode issues.)

llvm-svn: 259526

8 years agoScopInfo: Split memory access construction into different cases
Tobias Grosser [Tue, 2 Feb 2016 16:46:49 +0000 (16:46 +0000)]
ScopInfo: Split memory access construction into different cases

We create separate functions for fixed-size multi-dimensional, parameteric-sized
multi-dimensional, as well as single-dimensional memory accesses to reduce the
complexity of a large monolithic function.

Suggested-by: Michael Kruse <llvm@meinersbur.de>
llvm-svn: 259522

8 years agoScopInfo: Do not track element-size as additional array size dimension [NFC]
Tobias Grosser [Tue, 2 Feb 2016 16:46:45 +0000 (16:46 +0000)]
ScopInfo: Do not track element-size as additional array size dimension [NFC]

There is no need to pass the size of the elements as the last size dimension
to ScopArrayInfo. This information is already available through the ElementType.
Tracking it twice is not only redundant but may result in inconsistencies.

llvm-svn: 259521

8 years agoRevert r259512 - [tsan] Add a libc++ and lit testsuite for each ${TSAN_SUPPORTED_ARCH}.
Daniel Sanders [Tue, 2 Feb 2016 16:05:52 +0000 (16:05 +0000)]
Revert r259512 - [tsan] Add a libc++ and lit testsuite for each ${TSAN_SUPPORTED_ARCH}.

check-tsan does not pick up the correct libc++.so. It succeeded on my machine
by picking up the libc++.so that was built before making this change.

llvm-svn: 259519

8 years agoMake CodeGen headers self-contained.
Benjamin Kramer [Tue, 2 Feb 2016 16:05:18 +0000 (16:05 +0000)]
Make CodeGen headers self-contained.

llvm-svn: 259518

8 years agoRemove redundant test in TestExitDuringStep
Pavel Labath [Tue, 2 Feb 2016 15:58:30 +0000 (15:58 +0000)]
Remove redundant test in TestExitDuringStep

After recent changes, test_thread_state_is_stopped has become equivalent to test_step_in, as the
function exit_during_step_base was not using the "test_thread_state" parameter. As test was
XFAILed on all platforms anyway, and we have other tests for the bug which it (used to) test, I
am simply removing the function.

llvm-svn: 259517

8 years agoExpand comment a bit.
Rafael Espindola [Tue, 2 Feb 2016 15:45:37 +0000 (15:45 +0000)]
Expand comment a bit.

I have spent some time prototyping this idea. While it seems to work, I
now think it is probably not worth it.

llvm-svn: 259516

8 years ago[AArch64] Add a FIXME comment.
Chad Rosier [Tue, 2 Feb 2016 15:22:55 +0000 (15:22 +0000)]
[AArch64] Add a FIXME comment.

llvm-svn: 259515

8 years agoLog error message in SBTarget::Launch
Pavel Labath [Tue, 2 Feb 2016 15:16:20 +0000 (15:16 +0000)]
Log error message in SBTarget::Launch

llvm-svn: 259514

8 years agoMark TestProcessIO.test_stdin_redirection as flaky on android
Pavel Labath [Tue, 2 Feb 2016 15:16:16 +0000 (15:16 +0000)]
Mark TestProcessIO.test_stdin_redirection as flaky on android

bug #26437

llvm-svn: 259513

8 years ago[tsan] Add a libc++ and lit testsuite for each ${TSAN_SUPPORTED_ARCH}.
Daniel Sanders [Tue, 2 Feb 2016 15:04:35 +0000 (15:04 +0000)]
[tsan] Add a libc++ and lit testsuite for each ${TSAN_SUPPORTED_ARCH}.

Summary:
This is a workaround to a problem in the 3.8 release that affects MIPS and
possibly other targets where the default is not supported but a sibling is
supported.

When TSAN_SUPPORTED_ARCH is not empty, cmake currently attempts to build a
tsan'd libcxx as well as test tsan for the default target regardless of whether
the default target is supported or not. This causes problems on MIPS32 since
tsan is supported for MIPS64 but not MIPS32.

This patch causes cmake to only build the libcxx and run the lit test-suite for
archictures in ${TSAN_SUPPORTED_ARCH}

Reviewers: hans, samsonov

Subscribers: tberghammer, llvm-commits, danalbert, srhines, dvyukov

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

llvm-svn: 259512

8 years ago[WWW] Add our Polly/OpenCL paper
Johannes Doerfert [Tue, 2 Feb 2016 15:03:31 +0000 (15:03 +0000)]
[WWW] Add our Polly/OpenCL paper

llvm-svn: 259511

8 years ago[AArch64] Allocate the modified and used regs only once per function.
Chad Rosier [Tue, 2 Feb 2016 15:02:30 +0000 (15:02 +0000)]
[AArch64] Allocate the modified and used regs only once per function.

llvm-svn: 259510

8 years agoFix single stepping over the IT instruction
Tamas Berghammer [Tue, 2 Feb 2016 14:32:11 +0000 (14:32 +0000)]
Fix single stepping over the IT instruction

The ARM instruction emulator had 2 bugs related to the handling of the
IT instruction causing an error in single stepping:
* We haven't initialized the IT mask from the CPSR so if the last
  instruction of the IT block is a branch and the condition is false
  then the emulator evaluated the branch what resulted in an incorrect
  pc for the next instruction.
* The ITSTATE was advanced before the execution of each instruction. As
  a result the emulator was using the condition of following instruction
  in every case. The ITSTATE should be edvanced after the execution of
  an instruction except after an IT instruction.

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

llvm-svn: 259509

8 years agoWebAssembly: update expected GCC torture test failures
JF Bastien [Tue, 2 Feb 2016 14:27:34 +0000 (14:27 +0000)]
WebAssembly: update expected GCC torture test failures

The 3 programs used __attribute__((mode(?))) on enum, which clang r259497 fixed.

llvm-svn: 259508

8 years agoMake the remaining headers self-contained.
Benjamin Kramer [Tue, 2 Feb 2016 14:24:21 +0000 (14:24 +0000)]
Make the remaining headers self-contained.

llvm-svn: 259507

8 years ago[StaticAnalyzer] Pull SymExpr and SymbolData into its own header to avoid cyclic...
Benjamin Kramer [Tue, 2 Feb 2016 14:24:11 +0000 (14:24 +0000)]
[StaticAnalyzer] Pull SymExpr and SymbolData into its own header to avoid cyclic includes.

llvm-svn: 259506

8 years agoRemove unneeded definition [NFC]
Johannes Doerfert [Tue, 2 Feb 2016 14:16:22 +0000 (14:16 +0000)]
Remove unneeded definition [NFC]

llvm-svn: 259505

8 years agoAdd const keyword to MemoryAccess argument [NFC]
Johannes Doerfert [Tue, 2 Feb 2016 14:16:01 +0000 (14:16 +0000)]
Add const keyword to MemoryAccess argument [NFC]

llvm-svn: 259504

8 years agoSort analysis members and unifiy documentation [NFC]
Johannes Doerfert [Tue, 2 Feb 2016 14:15:37 +0000 (14:15 +0000)]
Sort analysis members and unifiy documentation [NFC]

llvm-svn: 259503

8 years agoRename the DataLayout member [NFC]
Johannes Doerfert [Tue, 2 Feb 2016 14:15:13 +0000 (14:15 +0000)]
Rename the DataLayout member [NFC]

llvm-svn: 259502