platform/upstream/llvm.git
8 years ago[ELF][MIPS] Replace needsMipsLocalGot function by canBePreempted
Simon Atanasyan [Thu, 4 Feb 2016 11:51:45 +0000 (11:51 +0000)]
[ELF][MIPS] Replace needsMipsLocalGot function by canBePreempted

Symbol does not need an entry i the 'global' part of GOT if it cannot be
preempted. So canBePreempted fully satisfies us at least for now.

llvm-svn: 259779

8 years ago[ELF][MIPS] Always create global GOT entry for symbols defined in DSO
Simon Atanasyan [Thu, 4 Feb 2016 11:51:39 +0000 (11:51 +0000)]
[ELF][MIPS] Always create global GOT entry for symbols defined in DSO

If relocation against symbol requires GOT entry creation and this symbol
is defined in DSO, the GOT entry should be created in the 'global' part
of the GOT even if we link executable file. Also we do not need to create
a dynamic symbol table entry for global symbol corresponding to the
local GOT entry.

llvm-svn: 259778

8 years agoEnable test_lldbmi_settings_set_target_run_args_before on linux
Pavel Labath [Thu, 4 Feb 2016 11:51:07 +0000 (11:51 +0000)]
Enable test_lldbmi_settings_set_target_run_args_before on linux

Test has passed last 200 runs of the build bot.

llvm-svn: 259777

8 years ago[OPENMP 4.0] Fixed support of array sections/array subscripts.
Alexey Bataev [Thu, 4 Feb 2016 11:27:03 +0000 (11:27 +0000)]
[OPENMP 4.0] Fixed support of array sections/array subscripts.
Codegen for array sections/array subscripts worked only for expressions with arrays as base. Patch fixes codegen for bases with pointer/reference types.

llvm-svn: 259776

8 years agoMark TestProcessIO as flaky on android
Pavel Labath [Thu, 4 Feb 2016 09:53:37 +0000 (09:53 +0000)]
Mark TestProcessIO as flaky on android

previously, I have marked only one test as flaky, but now I noticed another test failing with the
same error. I am going to assume all of them are flaky.

llvm-svn: 259775

8 years agoAdd verbose logging support to gdb-remote tests
Pavel Labath [Thu, 4 Feb 2016 09:53:33 +0000 (09:53 +0000)]
Add verbose logging support to gdb-remote tests

Summary:
gdb-remote tests are not able to use the same logging mechanisms as the rest of our tests, and
currently we get no host logs from them, even though the tests themselves have logging
capability. This commit changes that. When user specifies that he would like to log the
gdb-remote channel (--channel gdb-remote argument to dotest.py), we write detailed logs to the
<TEST_ID>-host.log file, just like we would in the case of regular tests. If this argument is not
specified, we only log the serious messages to stderr, which matches the existing behaviour.

Reviewers: tfiala, tberghammer

Subscribers: lldb-commits

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

llvm-svn: 259774

8 years ago[RenderScript] Add command for recalculating allocation details
Ewan Crawford [Thu, 4 Feb 2016 09:44:23 +0000 (09:44 +0000)]
[RenderScript] Add command for recalculating allocation details

Patch replaces the --refresh flag removed in r258800 with it's own command, 'language renderscript allocation refresh'.
Since there is no reason this functionality should be tied to another command as an option.
The command itself simply re-JITs all our cached information about allocations.

llvm-svn: 259773

8 years agoScopInfo: Improve documentation of ScopArrayInfo
Tobias Grosser [Thu, 4 Feb 2016 09:27:34 +0000 (09:27 +0000)]
ScopInfo: Improve documentation of ScopArrayInfo

This adds more information about how dimensions are incrementally updated and
what exactly the canonical element type is.

llvm-svn: 259772

8 years ago[X86] Moved SEXT -> SIGN_EXTEND_VECTOR_INREG combine into helper. NFC.
Simon Pilgrim [Thu, 4 Feb 2016 09:27:19 +0000 (09:27 +0000)]
[X86] Moved SEXT -> SIGN_EXTEND_VECTOR_INREG combine into helper. NFC.

llvm-svn: 259771

8 years ago[X86] Use hash table in LEA optimization pass.
Andrey Turetskiy [Thu, 4 Feb 2016 08:57:03 +0000 (08:57 +0000)]
[X86] Use hash table in LEA optimization pass.

Use hash table (key is a memory operand) to store found LEA instructions to reduce compile time.

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

llvm-svn: 259770

8 years agoAdd -nocudainc option to CUDA preprocessor test.
Samuel Antao [Thu, 4 Feb 2016 08:13:16 +0000 (08:13 +0000)]
Add -nocudainc option to CUDA preprocessor test.

If include files are used in the CUDA preprocessor tests it will cause a
failure due to a missing header file in hosts that do not match the triple
in the test. E.g. powerpc64le have CUDA support but the include files
cannot be used for an x86 target.

llvm-svn: 259769

8 years agoAdd 3.9 release notes document
Tobias Grosser [Thu, 4 Feb 2016 08:10:29 +0000 (08:10 +0000)]
Add 3.9 release notes document

llvm-svn: 259768

8 years agoAdd 'Using Polly with Clang' to Spinx
Tobias Grosser [Thu, 4 Feb 2016 07:45:32 +0000 (07:45 +0000)]
Add 'Using Polly with Clang' to Spinx

llvm-svn: 259767

8 years agocmake: Add a flag to enable LTO
Justin Bogner [Thu, 4 Feb 2016 07:28:30 +0000 (07:28 +0000)]
cmake: Add a flag to enable LTO

This adds -DLLVM_ENABLE_LTO, rather than forcing people to manually
add -flto to the various _FLAGS variables.

llvm-svn: 259766

8 years agoAdd Sphinx configuration
Tobias Grosser [Thu, 4 Feb 2016 07:27:57 +0000 (07:27 +0000)]
Add Sphinx configuration

This just adds the basic configuration with an empty index/welcome page

llvm-svn: 259765

8 years agoAdd basic doxygen infrastructure for Polly
Tobias Grosser [Thu, 4 Feb 2016 07:16:36 +0000 (07:16 +0000)]
Add basic doxygen infrastructure for Polly

llvm-svn: 259764

8 years ago[Support] Use range-based for loop. NFC
Craig Topper [Thu, 4 Feb 2016 06:51:41 +0000 (06:51 +0000)]
[Support] Use range-based for loop. NFC

llvm-svn: 259763

8 years ago[Support] Use hexdigit instead of manually coding the same thing. NFC
Craig Topper [Thu, 4 Feb 2016 06:51:38 +0000 (06:51 +0000)]
[Support] Use hexdigit instead of manually coding the same thing. NFC

llvm-svn: 259762

8 years agowww: Remove some spaces
Tobias Grosser [Thu, 4 Feb 2016 06:41:03 +0000 (06:41 +0000)]
www: Remove some spaces

llvm-svn: 259761

8 years agowww: Add Michael's thesis
Tobias Grosser [Thu, 4 Feb 2016 06:40:59 +0000 (06:40 +0000)]
www: Add Michael's thesis

llvm-svn: 259760

8 years agowww: Add Felix-Antoine's master thesis
Tobias Grosser [Thu, 4 Feb 2016 06:36:50 +0000 (06:36 +0000)]
www: Add Felix-Antoine's master thesis

llvm-svn: 259759

8 years agowww: Drop outdated dragonegg documentation
Tobias Grosser [Thu, 4 Feb 2016 06:23:53 +0000 (06:23 +0000)]
www: Drop outdated dragonegg documentation

Even though the commands still work, dragonegg has not been updated to work with
recent versions of LLVM. Consequently, only very old Polly versions (which we
do not support any more), can be used in this way.

This simplifies our documentation page.

llvm-svn: 259758

8 years agoUpdate to isl-0.16.1-20-gee54b48
Tobias Grosser [Thu, 4 Feb 2016 06:19:12 +0000 (06:19 +0000)]
Update to isl-0.16.1-20-gee54b48

This includes some (optional) improvements to the isl scheduler, which we do not
use yet, as well as a fix for a bug previously also affecting Polly:

commit 662ee9b7d45ebeb7629b239d3ed43442e25bf87c
Author: Sven Verdoolaege <skimo@kotnet.org>
Date:   Mon Jan 25 16:59:32 2016 +0100

    isl_basic_map_realign: perform Gaussian elimination on result

    Many parts of isl assume that Gaussian elimination has been
    applied to the equality constraints.  In particular singleton_extract_point
    makes this assumption.  The input to singleton_extract_point
    may have undergone parameter alignment.  This parameter alignment
    (ultimately performed by isl_basic_map_realign) therefore
    needs to make sure the result preserves this property

llvm-svn: 259757

8 years ago[PGO] Profile interface cleanup
Xinliang David Li [Thu, 4 Feb 2016 05:29:51 +0000 (05:29 +0000)]
[PGO] Profile interface cleanup
  - Remove unused valuemapper parameter
  - add totalcount optional parameter

llvm-svn: 259756

8 years ago[TSan] Fix PrintMatchedSuppressions: Read hit count for suppression atomically
Mohit K. Bhakkad [Thu, 4 Feb 2016 05:28:48 +0000 (05:28 +0000)]
[TSan] Fix PrintMatchedSuppressions: Read hit count for suppression atomically

Reviewers: dvyukov.
Subscribers: jaydeep, sagar, dsanders, llvm-commits.
Differential Revision: http://reviews.llvm.org/D16845

llvm-svn: 259755

8 years agoBasic: mark TLS as supported on Windows on ARM
Saleem Abdulrasool [Thu, 4 Feb 2016 05:05:23 +0000 (05:05 +0000)]
Basic: mark TLS as supported on Windows on ARM

LLVM can now lower TLS access as per the MS ABI on ARM.  This enables the
generation of TLS access for Windows on ARM.

llvm-svn: 259751

8 years agoPR23057: fix use-after-free due to local token buffer in ParseCXXAmbiguousParenExpres...
Alexey Bataev [Thu, 4 Feb 2016 04:22:09 +0000 (04:22 +0000)]
PR23057: fix use-after-free due to local token buffer in ParseCXXAmbiguousParenExpression, by Dmitry Polukhin
Differential Revision: http://reviews.llvm.org/D16572
A    test/Parser/cxx-ambig-paren-expr-asan.cpp
M    lib/Parse/ParseExprCXX.cpp

llvm-svn: 259750

8 years ago[NVPTX] Disable performance optimizations when OptLevel==None
Jingyue Wu [Thu, 4 Feb 2016 04:15:36 +0000 (04:15 +0000)]
[NVPTX] Disable performance optimizations when OptLevel==None

Reviewers: jholewinski, tra, eliben

Subscribers: jholewinski, llvm-commits

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

llvm-svn: 259749

8 years agoUse unsigned long long instead of uint64_t to appease bots
Pete Cooper [Thu, 4 Feb 2016 02:50:47 +0000 (02:50 +0000)]
Use unsigned long long instead of uint64_t to appease bots

llvm-svn: 259748

8 years agoAdd test missed from r259746
Pete Cooper [Thu, 4 Feb 2016 02:50:07 +0000 (02:50 +0000)]
Add test missed from r259746

llvm-svn: 259747

8 years agoAdd support for the source_version cmdline option.
Pete Cooper [Thu, 4 Feb 2016 02:45:23 +0000 (02:45 +0000)]
Add support for the source_version cmdline option.

This is of the form A.B.C.D.E and to match ld64's behaviour, is
always output to files, even when the version is 0.

rdar://problem/24472630

llvm-svn: 259746

8 years ago[asan] fix the non-x86 build
Kostya Serebryany [Thu, 4 Feb 2016 02:33:48 +0000 (02:33 +0000)]
[asan] fix the non-x86 build

llvm-svn: 259745

8 years agoSet S_ATTR_SOME_INSTRUCTIONS on __text section.
Pete Cooper [Thu, 4 Feb 2016 02:23:34 +0000 (02:23 +0000)]
Set S_ATTR_SOME_INSTRUCTIONS on __text section.

ld64 sets both S_ATTR_PURE_INSTRUCTIONS and S_ATTR_SOME_INSTRUCTIONS
on __TEXT, __text.  We only had the S_ATTR_PURE_INSTRUCTIONS attribute.

rdar://problem/24495801

llvm-svn: 259744

8 years agoGenerate version min load commands when the platform is unknown.
Pete Cooper [Thu, 4 Feb 2016 02:16:08 +0000 (02:16 +0000)]
Generate version min load commands when the platform is unknown.

In the case where we are emitting to an object file, the platform is
possibly unknown, and the source object files contained load commands
for version min, we can take the maximum of those min versions and
emit in in the output object file.

This test also tests r259739.

llvm-svn: 259742

8 years ago[asan] When catching a signal caused by a memory access, print if it's a READ or...
Kostya Serebryany [Thu, 4 Feb 2016 02:02:09 +0000 (02:02 +0000)]
[asan] When catching a signal caused by a memory access, print if it's a READ or a WRITE. This touches win/mac files which I have not tested, if a win/mac bot fails I'll try to quick-fix

llvm-svn: 259741

8 years agoTest case for PR 26381
Nemanja Ivanovic [Thu, 4 Feb 2016 01:58:20 +0000 (01:58 +0000)]
Test case for PR 26381

llvm-svn: 259740

8 years agoDefault to an unknown OS instead of MacOSX.
Pete Cooper [Thu, 4 Feb 2016 01:57:59 +0000 (01:57 +0000)]
Default to an unknown OS instead of MacOSX.

Defaulting to unknown matches ld64, but it also makes sure that all
of our code can handle not knowing the platform.  For example, a later
commit will add support for version min load commands with an unknown
platform, which is a feature supported by ld64.

No test case here.  The next commit will have one with the version min
code that needed this patch.

llvm-svn: 259739

8 years agoFix a little threading thinko in StartPrivateStateThread - don't pass stack variables
Jim Ingham [Thu, 4 Feb 2016 01:34:33 +0000 (01:34 +0000)]
Fix a little threading thinko in StartPrivateStateThread - don't pass stack variables
as args to a pthread_create function...

<rdar://problem/24485206>

llvm-svn: 259738

8 years agoPolly tests update contributed by Tobias Grosser for SCEV patch in r259736.
Wei Mi [Thu, 4 Feb 2016 01:34:28 +0000 (01:34 +0000)]
Polly tests update contributed by Tobias Grosser for SCEV patch in r259736.

llvm-svn: 259737

8 years ago[SCEV] Try to reuse existing value during SCEV expansion
Wei Mi [Thu, 4 Feb 2016 01:27:38 +0000 (01:27 +0000)]
[SCEV] Try to reuse existing value during SCEV expansion

Current SCEV expansion will expand SCEV as a sequence of operations
and doesn't utilize the value already existed. This will introduce
redundent computation which may not be cleaned up throughly by
following optimizations.

This patch introduces an ExprValueMap which is a map from SCEV to the
set of equal values with the same SCEV. When a SCEV is expanded, the
set of values is checked and reused whenever possible before generating
a sequence of operations.

The original commit triggered regressions in Polly tests. The regressions
exposed two problems which have been fixed in current version.

1. Polly will generate a new function based on the old one. To generate an
instruction for the new function, it builds SCEV for the old instruction,
applies some tranformation on the SCEV generated, then expands the transformed
SCEV and insert the expanded value into new function. Because SCEV expansion
may reuse value cached in ExprValueMap, the value in old function may be
inserted into new function, which is wrong.
   In SCEVExpander::expand, there is a logic to check the cached value to
be used should dominate the insertion point. However, for the above
case, the check always passes. That is because the insertion point is
in a new function, which is unreachable from the old function. However
for unreachable node, DominatorTreeBase::dominates thinks it will be
dominated by any other node.
   The fix is to simply add a check that the cached value to be used in
expansion should be in the same function as the insertion point instruction.

2. When the SCEV is of scConstant type, expanding it directly is cheaper than
reusing a normal value cached. Although in the cached value set in ExprValueMap,
there is a Constant type value, but it is not easy to find it out -- the cached
Value set is not sorted according to the potential cost. Existing reuse logic
in SCEVExpander::expand simply chooses the first legal element from the cached
value set.
   The fix is that when the SCEV is of scConstant type, don't try the reuse
logic. simply expand it.

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

llvm-svn: 259736

8 years agoFix undefined behavior when compiling in C++14 mode (with sized deletion
Richard Smith [Thu, 4 Feb 2016 01:21:16 +0000 (01:21 +0000)]
Fix undefined behavior when compiling in C++14 mode (with sized deletion
enabled): ensure that we do not invoke the sized deallocator for MemoryBuffer
subclasses that have tail-allocated data.

llvm-svn: 259735

8 years agoFix predefine for __NSConstantString struct type
Ben Langmuir [Thu, 4 Feb 2016 00:55:24 +0000 (00:55 +0000)]
Fix predefine for __NSConstantString struct type

Per review feedback the name was wrong and it can be used outside
Objective-C.

Unfortunately, making the internal struct visible broke some ASTMatchers
tests that assumed that the first record decl would be from user code,
rather than a builtin type.  I'm worried that this will also affect
users' code.  So this patch adds a typedef to wrap the internal struct
and only makes the typedef visible to namelookup.  This is sufficient to
allow the ASTReader to merge the decls we need without making the struct
itself visible.

rdar://problem/24425801

llvm-svn: 259734

8 years ago[codeview] Don't attempt a cross-section label diff
Reid Kleckner [Thu, 4 Feb 2016 00:21:42 +0000 (00:21 +0000)]
[codeview] Don't attempt a cross-section label diff

This only comes up when we're trying to find the next .cv_loc label.

Fixes PR26467

llvm-svn: 259733

8 years ago[libFuzzer] hot fix a test
Kostya Serebryany [Thu, 4 Feb 2016 00:12:28 +0000 (00:12 +0000)]
[libFuzzer] hot fix a test

llvm-svn: 259732

8 years ago[libFuzzer] don't write the test unit when a leak is detected (since we don't know...
Kostya Serebryany [Thu, 4 Feb 2016 00:02:17 +0000 (00:02 +0000)]
[libFuzzer] don't write the test unit when a leak is detected (since we don't know which unit causes the leak)

llvm-svn: 259731

8 years ago[SimplifyCFG] Fix for "endless" loop after dead code removal (Alternative to
Gerolf Hoflehner [Wed, 3 Feb 2016 23:54:25 +0000 (23:54 +0000)]
[SimplifyCFG] Fix for "endless" loop after dead code removal (Alternative to
D16251)

Summary:
This is a simpler fix to the problem than the dominator approach in
http://reviews.llvm.org/D16251. It adds only values into the gather() while loop
that have been seen before.

The actual endless loop is in the constant compare gather() routine in
Utils/SimplifyCFG.cpp. The same value ret.0.off0.i is pushed back into the
queue:
%.ret.0.off0.i = or i1 %.ret.0.off0.i, %cmp10.i

Here is what happens at the IR level:

for.cond.i:                                       ; preds = %if.end6.i,
%if.end.i54
%ix.0.i = phi i32 [ 0, %if.end.i54 ], [ %inc.i55, %if.end6.i ]
%ret.0.off0.i = phi i1 [false, %if.end.i54], [%.ret.0.off0.i, %if.end6.i] <<<
%cmp2.i = icmp ult i32 %ix.0.i, %11
br i1 %cmp2.i, label %for.body.i, label %LBJ_TmpSimpleNeedExt.exit

if.end6.i:                                        ; preds = %for.body.i
%cmp10.i = icmp ugt i32 %conv.i, %add9.i
%.ret.0.off0.i = or i1 %ret.0.off0.i, %cmp10.i <<<

When if.end.i54 gets eliminated which removes the definition of ret.0.off0.i.
The result is the expression %.ret.0.off0.i = or i1 %.ret.0.off0.i, %cmp10.i
(Note the first ‘or’ operand is now %.ret.0.off0.i, and *NOT* %ret.0.off0.i).
And
now there is use of .ret.0.off0.i before a definition which triggers the
“endless” loop in gather():

while(!DFT.empty()) {

    V = DFT.pop_back_val();   // V is .ret.0.off0.i

    if (Instruction *I = dyn_cast<Instruction>(V)) {
      // If it is a || (or && depending on isEQ), process the operands.
      if (I->getOpcode() == (isEQ ? Instruction::Or : Instruction::And)) {
        DFT.push_back(I->getOperand(1));  // This is now .ret.0.off0.i also
        DFT.push_back(I->getOperand(0));

        continue; // “endless loop” for .ret.0.off0.i
      }

Reviewers: reames, ahatanak

Subscribers: llvm-commits

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

llvm-svn: 259730

8 years agoAdd support for -sdk_version cmdline option.
Pete Cooper [Wed, 3 Feb 2016 23:39:05 +0000 (23:39 +0000)]
Add support for -sdk_version cmdline option.

This option is emitted in the min_version load commands.

Note, there's currently a difference in behaviour compared to ld64 in
that we emit a warning if we generate a min_version load command and
didn't give an sdk_version.  We need to decide what the correct behaviour
is here as its possible we want to emit an error and force clients to
provide the option.

llvm-svn: 259729

8 years agoBump DiagnosticSemaKinds count; we're close to hitting it.
Manman Ren [Wed, 3 Feb 2016 23:35:29 +0000 (23:35 +0000)]
Bump DiagnosticSemaKinds count; we're close to hitting it.

 $ grep '= DIAG_START_SEMA' include/clang/Basic/DiagnosticIDs.h
       DIAG_START_ANALYSIS      = DIAG_START_SEMA            + 3000
 $ grep 'def ' include/clang/Basic/DiagnosticSemaKinds.td | wc -l
       2994

llvm-svn: 259728

8 years ago[InstrProfiling] Fix a comment (NFC)
Vedant Kumar [Wed, 3 Feb 2016 23:22:43 +0000 (23:22 +0000)]
[InstrProfiling] Fix a comment (NFC)

llvm-svn: 259727

8 years agoUnify the target opcode enum in TargetOpcodes.h and the FixedInstrs array in
David L Kreitzer [Wed, 3 Feb 2016 23:17:32 +0000 (23:17 +0000)]
Unify the target opcode enum in TargetOpcodes.h and the FixedInstrs array in
CodeGenTarget.cpp to avoid the ordering dependence. NFCI.

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

llvm-svn: 259726

8 years agoMinor code cleanups. NFC.
Junmo Park [Wed, 3 Feb 2016 23:16:39 +0000 (23:16 +0000)]
Minor code cleanups. NFC.

llvm-svn: 259725

8 years agoFix missing module qualification of subprocess.PIPE.
Zachary Turner [Wed, 3 Feb 2016 22:53:18 +0000 (22:53 +0000)]
Fix missing module qualification of subprocess.PIPE.

llvm-svn: 259724

8 years agoPrint the OffsetStart field's relocation
David Majnemer [Wed, 3 Feb 2016 22:45:21 +0000 (22:45 +0000)]
Print the OffsetStart field's relocation

llvm-svn: 259723

8 years agorangify; NFCI
Sanjay Patel [Wed, 3 Feb 2016 22:44:14 +0000 (22:44 +0000)]
rangify; NFCI

llvm-svn: 259722

8 years agoReapply r259624, it is likely not the commit causing the bot failures.
Quentin Colombet [Wed, 3 Feb 2016 22:41:00 +0000 (22:41 +0000)]
Reapply r259624, it is likely not the commit causing the bot failures.
Original message:
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: 259721

8 years agoclean up; NFC
Sanjay Patel [Wed, 3 Feb 2016 22:37:37 +0000 (22:37 +0000)]
clean up; NFC

llvm-svn: 259720

8 years ago[llvm-readobj] Add support for dumping S_DEFRANGE symbols
David Majnemer [Wed, 3 Feb 2016 22:36:46 +0000 (22:36 +0000)]
[llvm-readobj] Add support for dumping S_DEFRANGE symbols

llvm-svn: 259719

8 years agoAdd generation of LC_VERSION_MIN load commands.
Pete Cooper [Wed, 3 Feb 2016 22:28:29 +0000 (22:28 +0000)]
Add generation of LC_VERSION_MIN load commands.

If the command line contains something like -macosx_version_min and we
don't explicitly disable generation with -no_version_load_command then
we generate the LC_VERSION_MIN command in the output file.

There's a couple of FIXME's in here.  These will be handled soon with
more tests but I didn't want to grow this patch any more than it already was.

rdar://problem/24472630

llvm-svn: 259718

8 years ago[cfi] Safe handling of unaddressable vtable pointers (compiler-rt).
Evgeniy Stepanov [Wed, 3 Feb 2016 22:19:04 +0000 (22:19 +0000)]
[cfi] Safe handling of unaddressable vtable pointers (compiler-rt).

Avoid crashing when printing diagnostics for vtable-related CFI
errors. In diagnostic mode, the frontend does an additional check of
the vtable pointer against the set of all known vtable addresses and
lets the runtime handler know if it is safe to inspect the vtable.

http://reviews.llvm.org/D16824

llvm-svn: 259717

8 years ago[cfi] Safe handling of unaddressable vtable pointers (clang).
Evgeniy Stepanov [Wed, 3 Feb 2016 22:18:55 +0000 (22:18 +0000)]
[cfi] Safe handling of unaddressable vtable pointers (clang).

Avoid crashing when printing diagnostics for vtable-related CFI
errors. In diagnostic mode, the frontend does an additional check of
the vtable pointer against the set of all known vtable addresses and
lets the runtime handler know if it is safe to inspect the vtable.

http://reviews.llvm.org/D16823

llvm-svn: 259716

8 years agoRevert r259624 - Make CF constant string decl visible to name lookup to fix module...
Quentin Colombet [Wed, 3 Feb 2016 22:14:53 +0000 (22:14 +0000)]
Revert r259624 - Make CF constant string decl visible to name lookup to fix module errors.

This breaks some internal bots in stage2: clang seg fault.
Looking with Ben to see what is going on.

llvm-svn: 259715

8 years agoPass socket scheme as part of debug server listen URL.
Oleksiy Vyalov [Wed, 3 Feb 2016 22:02:43 +0000 (22:02 +0000)]
Pass socket scheme as part of debug server listen URL.

http://reviews.llvm.org/D16861

llvm-svn: 259714

8 years agoReplace static const int with enum to fix obnoxious linker errors about a missing...
Reid Kleckner [Wed, 3 Feb 2016 21:45:39 +0000 (21:45 +0000)]
Replace static const int with enum to fix obnoxious linker errors about a missing definition

llvm-svn: 259712

8 years ago[unittests] Move TargetRegistry test from Support to MC
Reid Kleckner [Wed, 3 Feb 2016 21:41:24 +0000 (21:41 +0000)]
[unittests] Move TargetRegistry test from Support to MC

This removes the dependency from SupportTests to all of the LLVM
backends, and makes it link faster.

llvm-svn: 259705

8 years agoSilence -Wsign-conversion issue in ProgramTest.cpp
Reid Kleckner [Wed, 3 Feb 2016 21:41:12 +0000 (21:41 +0000)]
Silence -Wsign-conversion issue in ProgramTest.cpp

Unfortunately, ProgramInfo::ProcessId is signed on Unix and unsigned on
Windows, breaking the standard fix of using '0U' in the gtest
expectation.

llvm-svn: 259704

8 years agoFix pointers to go on the right hand side. NFC.
Ana Pazos [Wed, 3 Feb 2016 21:34:39 +0000 (21:34 +0000)]
Fix pointers to go on the right hand side. NFC.

Summary:
Fixed pointers to go on the right hand side following coding guidelines. NFC.

Patch by Mandeep Singh Grang.

Reviewers: majnemer, arsenm, sanjoy

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

llvm-svn: 259703

8 years ago[LoopStrengthReduce] Don't rewrite PHIs with incoming values from CatchSwitches
David Majnemer [Wed, 3 Feb 2016 21:30:34 +0000 (21:30 +0000)]
[LoopStrengthReduce] Don't rewrite PHIs with incoming values from CatchSwitches

Bail out if we have a PHI on an EHPad that gets a value from a
CatchSwitchInst.  Because the CatchSwitchInst cannot be split, there is
no good place to stick any instructions.

This fixes PR26373.

llvm-svn: 259702

8 years ago[ScalarEvolutionExpander] Simplify findInsertPointAfter
David Majnemer [Wed, 3 Feb 2016 21:30:31 +0000 (21:30 +0000)]
[ScalarEvolutionExpander] Simplify findInsertPointAfter

No functional change is intended.  The loop could only execute, at most,
once.

llvm-svn: 259701

8 years ago[codeview] Remove EmitLabelDiff in favor emitAbsoluteSymbolDiff
Reid Kleckner [Wed, 3 Feb 2016 21:24:42 +0000 (21:24 +0000)]
[codeview] Remove EmitLabelDiff in favor emitAbsoluteSymbolDiff

llvm-svn: 259700

8 years ago[codeview] Use the MCStreamer interface directly instead of AsmPrinter
Reid Kleckner [Wed, 3 Feb 2016 21:15:48 +0000 (21:15 +0000)]
[codeview] Use the MCStreamer interface directly instead of AsmPrinter

This is mostly about having shorter lines and standardizing on one
interface, but it also avoids some needless indirection.

No functional change.

llvm-svn: 259697

8 years ago[DWARFDebug] Fix another case of overlapping ranges
Keno Fischer [Wed, 3 Feb 2016 21:13:33 +0000 (21:13 +0000)]
[DWARFDebug] Fix another case of overlapping ranges

Summary:
In r257979, I added code to ensure that we wouldn't merge DebugLocEntries if
the pieces they describe overlap. Unfortunately, I failed to cover the case,
where there may have multiple active Expressions in the entry, in which case we
need to make sure that no two values overlap before we can perform the merge.

This fixed PR26148.

Reviewers: aprantl
Differential Revision: http://reviews.llvm.org/D16742

llvm-svn: 259696

8 years agoAddress NDEBUG-related linkage issues for Value::assertModuleIsMaterialized()
Todd Fiala [Wed, 3 Feb 2016 21:13:23 +0000 (21:13 +0000)]
Address NDEBUG-related linkage issues for Value::assertModuleIsMaterialized()

The IR/Value class had a linkage issue present when LLVM was built
as a library, and the LLVM library build time had different settings
for NDEBUG than the client of the LLVM library.  Clients could get
into a state where the LLVM lib expected
Value::assertModuleIsMaterialized() to be inline-defined in the header
but clients expected that method to be defined in the LLVM library.

See this llvm-commits thread for more details:
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20160201/329667.html

llvm-svn: 259695

8 years agotest: make test case more robust against removal of unrelated instructions
Tobias Grosser [Wed, 3 Feb 2016 21:10:11 +0000 (21:10 +0000)]
test: make test case more robust against removal of unrelated instructions

llvm-svn: 259693

8 years agoFix addend computation for IRELATIVE relocations.
Rafael Espindola [Wed, 3 Feb 2016 21:02:48 +0000 (21:02 +0000)]
Fix addend computation for IRELATIVE relocations.

llvm-svn: 259692

8 years ago[SelectionDAG] Fix CombineToPreIndexedLoadStore O(n^2) behavior
Tim Shen [Wed, 3 Feb 2016 20:58:55 +0000 (20:58 +0000)]
[SelectionDAG] Fix CombineToPreIndexedLoadStore O(n^2) behavior

This patch consists of two parts: a performance fix in DAGCombiner.cpp
and a correctness fix in SelectionDAG.cpp.

The test case tests the bug that's uncovered by the performance fix, and
fixed by the correctness fix.

The performance fix keeps the containers required by the
hasPredecessorHelper (which is a lazy DFS) and reuse them. Since
hasPredecessorHelper is called in a loop, the overall efficiency reduced
from O(n^2) to O(n), where n is the number of SDNodes.

The correctness fix keeps iterating the neighbor list even if it's time
to early return. It will return after finishing adding all neighbors to
Worklist, so that no neighbors are discarded due to the original early
return.

llvm-svn: 259691

8 years ago[CUDA] added declarations for device-side system calls
Artem Belevich [Wed, 3 Feb 2016 20:53:58 +0000 (20:53 +0000)]
[CUDA] added declarations for device-side system calls

...and std:: wrappers for free/malloc.

llvm-svn: 259690

8 years agoFix sign conversion warnings in LLDB Python unittests
Reid Kleckner [Wed, 3 Feb 2016 20:48:09 +0000 (20:48 +0000)]
Fix sign conversion warnings in LLDB Python unittests

llvm-svn: 259689

8 years agoEnsure that we substitute into the declaration of a template parameter pack
Richard Smith [Wed, 3 Feb 2016 20:40:30 +0000 (20:40 +0000)]
Ensure that we substitute into the declaration of a template parameter pack
(that is not a pack expansion) during template argument deduction, even if we
deduced that the pack would be empty.

llvm-svn: 259688

8 years agoRefactor conversion of deduced template arguments to reduce repetition.
Richard Smith [Wed, 3 Feb 2016 20:15:01 +0000 (20:15 +0000)]
Refactor conversion of deduced template arguments to reduce repetition.

llvm-svn: 259687

8 years ago[NetBSD] Remove dead code.
Davide Italiano [Wed, 3 Feb 2016 20:13:50 +0000 (20:13 +0000)]
[NetBSD] Remove dead code.

PR: http://reviews.llvm.org/D16818
llvm-svn: 259686

8 years agoRemove a stray ;.
Jim Ingham [Wed, 3 Feb 2016 19:49:03 +0000 (19:49 +0000)]
Remove a stray ;.

llvm-svn: 259685

8 years agoThe SetStopInfo from a Mach Exception was setting the stop
Jim Ingham [Wed, 3 Feb 2016 19:45:31 +0000 (19:45 +0000)]
The SetStopInfo from a Mach Exception was setting the stop
reason to None when we stop due to a trace, then noticed that
we were on a breakpoint that was not valid for the current thread.
That should actually have set it back to trace.

This was pr26441 (<rdar://problem/24470203>)

llvm-svn: 259684

8 years agoMinor performance tweaks to llvm-tblgen (and a few that might be a good idea)
Reid Kleckner [Wed, 3 Feb 2016 19:34:28 +0000 (19:34 +0000)]
Minor performance tweaks to llvm-tblgen (and a few that might be a good idea)

Summary:
This patch adds a reserve call to an expensive function
(`llvm::LoadIntrinsics`), and may fix a few other low hanging
performance fruit (I've put them in comments for now, so we can
discuss).

**Motivation:**

As I'm sure other developers do, when I build LLVM, I build the entire
project with the same config (`Debug`, `MinSizeRel`, `Release`, or
`RelWithDebInfo`). However, the `Debug` config also builds llvm-tblgen
in `Debug` mode. Later build steps that run llvm-tblgen then can
actually be the slowest steps in the entire build. Nobody likes slow
builds.

Reviewers: rnk, dblaikie

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

Patch by Alexander G. Riccio

llvm-svn: 259683

8 years agore.results.form: Format out-of-range subexpression references as null
Duncan P. N. Exon Smith [Wed, 3 Feb 2016 19:30:20 +0000 (19:30 +0000)]
re.results.form: Format out-of-range subexpression references as null

Rather than crashing in match_results::format() when a reference to a
marked subexpression is out of range, format the subexpression as empty
(i.e., replace it with an empty string).  Note that
match_results::operator[]() has a range-check and returns a null match
in this case, so this just re-uses that logic.

llvm-svn: 259682

8 years ago[Sema debugger support] Require non-void types to be complete in unknown-anytype...
Douglas Gregor [Wed, 3 Feb 2016 19:13:08 +0000 (19:13 +0000)]
[Sema debugger support] Require non-void types to be complete in unknown-anytype casts.

When performing a cast from an __unknown_anytype function call to a
non-void type, we need to make sure that type is complete. Fixes
rdar://problem/23959960.

llvm-svn: 259681

8 years agoMove some android platform functions to lldbplatformutil.
Zachary Turner [Wed, 3 Feb 2016 19:12:30 +0000 (19:12 +0000)]
Move some android platform functions to lldbplatformutil.

My eventual goal is to move all of the test decorators to their
own module such as `decorators.py`.  But some of the decorators
use existing functions in `lldbtest.py` and conceptually the
functions are probably more appropriately placed in lldbplatformutil.
Moreover, lldbtest.py is a huge file with a ton of random utility
functions scattered around, so this patch also workds toward the
goal of reducing the footprint of this one module to a more
reasonable size.

So this patch moves some of them over to lldbplatformutil with the
eventual goal of moving decorators over to their own module.

Reviewed By: Tamas Berghammer, Pavel Labath
Differential Revision: http://reviews.llvm.org/D16830

llvm-svn: 259680

8 years agoELF: Remove dead code.
Rui Ueyama [Wed, 3 Feb 2016 19:07:56 +0000 (19:07 +0000)]
ELF: Remove dead code.

R_X86_64_DTPOFF64 relocs are for the dynamic linker.
Static linkers create them but don't consume them.

llvm-svn: 259679

8 years agoAdded Anastasia Stulova as a code owner for OpenCL
Anastasia Stulova [Wed, 3 Feb 2016 18:51:19 +0000 (18:51 +0000)]
Added Anastasia Stulova as a code owner for OpenCL

Reviewers: Chris Lattner

Subscribers: cfe-dev
llvm-svn: 259678

8 years agoFix regression from r259622: the operand of an increment that is the operand of
Richard Smith [Wed, 3 Feb 2016 18:48:43 +0000 (18:48 +0000)]
Fix regression from r259622: the operand of an increment that is the operand of
a cast expression is not the operand of a cast expression itself, so if it's
parenthesized we need to form a ParenExpr not a ParenListExpr.

llvm-svn: 259677

8 years agoARM: support TLS for WoA
Saleem Abdulrasool [Wed, 3 Feb 2016 18:21:59 +0000 (18:21 +0000)]
ARM: support TLS for WoA

Add support for TLS access for Windows on ARM.  This generates a similar access
to MSVC for ARM.

The changes to the tablegen data is needed to support loading an external symbol
global that is not for a call.  The adjustments to the DAG to DAG transforms are
needed to preserve the 32-bit move.

llvm-svn: 259676

8 years agoRevert r259662, which caused regressions on polly tests.
Wei Mi [Wed, 3 Feb 2016 18:05:57 +0000 (18:05 +0000)]
Revert r259662, which caused regressions on polly tests.

llvm-svn: 259675

8 years ago[InstCombine] Revert r238452: Fold IntToPtr and PtrToInt into preceding loads.
Quentin Colombet [Wed, 3 Feb 2016 18:04:13 +0000 (18:04 +0000)]
[InstCombine] Revert r238452: Fold IntToPtr and PtrToInt into preceding loads.

According to git bisect, this is the root cause of a miscompile for Regex in
libLLVMSupport. I am still working on reducing a test case.
The actual bug may be elsewhere and this commit just exposed it.

Anyway, at the moment, to reproduce, follow these steps:
1. Build clang and libLTO in release mode.
2. Create a new build directory <stage2> and cd into it.
3. Use clang and libLTO from #1 to build llvm-extract in Release mode + asserts
   using -O2 -flto
4. Run llvm-extract  -ralias '.*bar' -S test/Other/extract-alias.ll

Result:
program doesn't contain global named '.*bar'!

Expected result:
@a0a0bar = alias void ()* @bar
@a0bar = alias void ()* @bar

declare void @bar()

Note: In step #3, if you don't use lto or asserts, the miscompile disappears.
llvm-svn: 259674

8 years ago[ScheduleDAGInstrs::buildSchedGraph()] Handling of memory dependecies rewritten.
Jonas Paulsson [Wed, 3 Feb 2016 17:52:29 +0000 (17:52 +0000)]
[ScheduleDAGInstrs::buildSchedGraph()] Handling of memory dependecies rewritten.

Recommited, after some fixing with test cases.

Updated test cases:
test/CodeGen/AArch64/arm64-misched-memdep-bug.ll
test/CodeGen/AArch64/tailcall_misched_graph.ll

Temporarily disabled test cases:
test/CodeGen/AMDGPU/split-vector-memoperand-offsets.ll
test/CodeGen/PowerPC/ppc64-fastcc.ll (partially updated)
test/CodeGen/PowerPC/vsx-fma-m.ll
test/CodeGen/PowerPC/vsx-fma-sp.ll

http://reviews.llvm.org/D8705
Reviewers: Hal Finkel, Andy Trick.

llvm-svn: 259673

8 years agoFix comments /NFC
Xinliang David Li [Wed, 3 Feb 2016 17:51:16 +0000 (17:51 +0000)]
Fix comments /NFC

llvm-svn: 259672

8 years agoAdd builtins for bitreverse intrinsic
Matt Arsenault [Wed, 3 Feb 2016 17:49:38 +0000 (17:49 +0000)]
Add builtins for bitreverse intrinsic

Follow the naming convention that bswap uses since it's a
similar sort of operation.

llvm-svn: 259671

8 years agoclang-format: Fix formatting of ternary expressions with comments.
Daniel Jasper [Wed, 3 Feb 2016 17:27:10 +0000 (17:27 +0000)]
clang-format: Fix formatting of ternary expressions with comments.

Before:
  int i = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ?
      /*bbbbbbbbbbbbbbbbbbbb=*/bbbbbbbbbbbbbbbbbbbbbbbbb :
       ccccccccccccccccccccccccccc;

After:
  int i = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ?
      /*bbbbbbbbbbbbbbbbbbbb=*/bbbbbbbbbbbbbbbbbbbbbbbbb :
              ccccccccccccccccccccccccccc;

llvm-svn: 259670

8 years agoDo not expect /dev/null (or NUL) non-mmap'able.
Rui Ueyama [Wed, 3 Feb 2016 17:25:11 +0000 (17:25 +0000)]
Do not expect /dev/null (or NUL) non-mmap'able.

On some Windows environment, this test did not fail, because opening NUL
with FileOutputBuffer didn't fail. Thanks to George Rimar for reporting.

llvm-svn: 259669

8 years ago[clang-tidy] Fix a crash issue on misc-virtual-near-miss check.
Haojian Wu [Wed, 3 Feb 2016 17:21:44 +0000 (17:21 +0000)]
[clang-tidy] Fix a crash issue on misc-virtual-near-miss check.

Summary:
The crash is caused by triggering a Assertion failed in DeclCXX.h when the
check detects non-defined class return type in a class method declaration.

Reviewers: congliu, alexfh

Subscribers: cfe-commits

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

llvm-svn: 259668

8 years agoAdd back the ABITest makefiles
Chris Bieneman [Wed, 3 Feb 2016 17:16:01 +0000 (17:16 +0000)]
Add back the ABITest makefiles

These files are standalone and not integrated with CMake, so we probably want them.

llvm-svn: 259667

8 years ago[Unittest] Clean up formatting, NFC
Joseph Tremoulet [Wed, 3 Feb 2016 17:11:24 +0000 (17:11 +0000)]
[Unittest] Clean up formatting, NFC

Summary:
Use an early return to reduce indentation.
Remove unused local.

Reviewers: dblaikie, lhames

Subscribers: lhames, llvm-commits

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

llvm-svn: 259663