platform/upstream/llvm.git
8 years agotest/Headers/float.c: fix theoretical edge values
Hubert Tong [Fri, 12 Feb 2016 19:24:36 +0000 (19:24 +0000)]
test/Headers/float.c: fix theoretical edge values

For *_MANT_DIG, *_MAX_EXP and *_MIN_EXP, the C Standard does not list
the least requirements directly. This patch adjusts the test values with
refined ones.

Patch by Jorge Teixeira!

llvm-svn: 260710

8 years ago[AST] Fix typos in RecordLayoutBuilder
David Majnemer [Fri, 12 Feb 2016 19:21:02 +0000 (19:21 +0000)]
[AST] Fix typos in RecordLayoutBuilder

No functional change is intended.

llvm-svn: 260709

8 years ago[CMake] Pass stage1 tools through to stage2 when building with LTO
Chris Bieneman [Fri, 12 Feb 2016 19:06:12 +0000 (19:06 +0000)]
[CMake] Pass stage1 tools through to stage2 when building with LTO

This was originally a hacky if(APPLE) block. Now that we have an option for enabling LTO, it is better to properly gate this.

llvm-svn: 260707

8 years ago[LIR] Partially revert r252926(NFC), which introduced a very subtle change.
Chad Rosier [Fri, 12 Feb 2016 19:05:27 +0000 (19:05 +0000)]
[LIR] Partially revert r252926(NFC), which introduced a very subtle change.

In short, before r252926 we were comparing an unsigned (StoreSize) against an a
APInt (Stride), which is fine and well.  After we were zero extending the Stride
and then converting to an unsigned, which is not the same thing.  Obviously,
Stides can also be negative.  This commit just restores the original behavior.

AFAICT, it's not possible to write a test case to expose the issue because
the code already has checks to make sure the StoreSize can't overflow an
unsigned (which prevents the Stride from overflowing an unsigned as well).

llvm-svn: 260706

8 years ago[LVI] Exploit nsw/nuw when computing constant ranges
Philip Reames [Fri, 12 Feb 2016 19:05:16 +0000 (19:05 +0000)]
[LVI] Exploit nsw/nuw when computing constant ranges

As the title says. Modelled after similar code in SCEV.

This is useful when analysing induction variables in loops which have been canonicalized by other passes. I wrote the tests as non-loops specifically to avoid the generality introduced in http://reviews.llvm.org/D17174. While that can handle many induction variables without *needing* to exploit nsw, there's no reason not to use it if we've already proven it.

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

llvm-svn: 260705

8 years ago[CMake] don't build libLTO when LLVM_ENABLE_PIC is OFF
Hans Wennborg [Fri, 12 Feb 2016 19:02:39 +0000 (19:02 +0000)]
[CMake] don't build libLTO when LLVM_ENABLE_PIC is OFF

When cmake is run with -DLLVM_ENABLE_PIC=OFF, build fails while
linking shared library libLTO.so, because its dependencies are built
with -fno-PIC. More details here: https://llvm.org/bugs/show_bug.cgi?id=26484.
This diff reverts r252652 (git 9fd4377ddb83aee3c049dc8757e7771edbb8ee71),
which removed check NOT LLVM_ENABLE_PIC before disabling build for libLTO.so.

Patch by Igor Sugak!

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

llvm-svn: 260703

8 years agoGlobalISel is always built since r260566, reflect it in LLVMBuild.txt
Mehdi Amini [Fri, 12 Feb 2016 18:43:14 +0000 (18:43 +0000)]
GlobalISel is always built since r260566, reflect it in LLVMBuild.txt

Other component could not depends on an optional library in llvm-config

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

8 years agollvm-config: replace assertions with a helpful error message
Mehdi Amini [Fri, 12 Feb 2016 18:43:10 +0000 (18:43 +0000)]
llvm-config: replace assertions with a helpful error message

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

8 years agoRenamed TestRdar12991846 to the more descriptive TestUnicodeLiterals.
Sean Callanan [Fri, 12 Feb 2016 18:42:00 +0000 (18:42 +0000)]
Renamed TestRdar12991846 to the more descriptive TestUnicodeLiterals.

Test cases should not be named after PR or Radar numbers.  It's fine to
annotate them with these numbers in comments, however.

llvm-svn: 260699

8 years ago[Hexagon] Add utility functions to detect sign- and zero-extending loads
Krzysztof Parzyszek [Fri, 12 Feb 2016 18:37:23 +0000 (18:37 +0000)]
[Hexagon] Add utility functions to detect sign- and zero-extending loads

llvm-svn: 260698

8 years ago[CUDA] Tweak attribute-based overload resolution to match nvcc behavior.
Artem Belevich [Fri, 12 Feb 2016 18:29:18 +0000 (18:29 +0000)]
[CUDA] Tweak attribute-based overload resolution to match nvcc behavior.

This is an artefact of split-mode CUDA compilation that we need to
mimic. HD functions are sometimes allowed to call H or D functions. Due
to split compilation mode device-side compilation will not see host-only
function and thus they will not be considered at all. For clang both H
and D variants will become function overloads visible to
compiler. Normally target attribute is considered only if C++ rules can
not determine which function is better. However in this case we need to
ignore functions that would not be present during current compilation
phase before we apply normal overload resolution rules.

Changes:
* introduced another level of call preference to better describe
  possible call combinations.
* removed WrongSide functions from consideration if the set contains
  SameSide function.
* disabled H->D, D->H and G->H calls. These combinations are
  not allowed by CUDA and we were reluctantly allowing them to work
  around device-side calls to math functions in std namespace.
  We no longer need it after r258880.

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

llvm-svn: 260697

8 years ago[Hexagon] Replace expansion of spill pseudo-instructions in frame lowering
Krzysztof Parzyszek [Fri, 12 Feb 2016 18:19:53 +0000 (18:19 +0000)]
[Hexagon] Replace expansion of spill pseudo-instructions in frame lowering

Rewrite the code to handle all pseudo-instructions in a single pass.

This temporarily reverts spill slot optimization that used general-
purpose registers to hold values of spilled predicate registers.

llvm-svn: 260696

8 years ago[InstCombine] Don't aggressively replace xor with icmp
David Majnemer [Fri, 12 Feb 2016 18:12:38 +0000 (18:12 +0000)]
[InstCombine] Don't aggressively replace xor with icmp

For some cases, InstCombine replaces the sequence of xor/sub instruction
followed by cmp instruction into a single cmp instruction.

However, this replacement may result suboptimal result especially when
the xor/sub has more than one use, as discussed in
bug 26465 (https://llvm.org/bugs/show_bug.cgi?id=26465).

This patch make the replacement happen only when xor/sub has only one
use.

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

Patch by Taewook Oh!

llvm-svn: 260695

8 years ago[AMDGPU] Assembler: Swap operands of flat_store instructions to match AMD assembler
Tom Stellard [Fri, 12 Feb 2016 17:57:54 +0000 (17:57 +0000)]
[AMDGPU] Assembler: Swap operands of flat_store instructions to match AMD assembler

Historically, AMD internal sp3 assembler has flat_store* addr, data
format. To match existing code and to enable reuse, change LLVM
definitions to match.  Also update MC and CodeGen tests.

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

Patch by: Nikolay Haustov

llvm-svn: 260694

8 years agoAMDGPU/SI: Annotate Loops with Constant Condition in SIAnnotateControlFlow pass.
Changpeng Fang [Fri, 12 Feb 2016 17:11:04 +0000 (17:11 +0000)]
AMDGPU/SI: Annotate Loops with Constant Condition in SIAnnotateControlFlow pass.

Summary:
  It is possible that the loop condition can be a boolean constant (infinite loop,
for example). So we sould handle constant condition in annotating a loop. This
patch adds this functionality to support annotating constant condition.

Reviewers: tstellarAMD, arsenm

Subscribers: llvm-commits, arsenm

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

llvm-svn: 260692

8 years ago[Hexagon] Remove HexagonExpandPredSpillCode pass
Krzysztof Parzyszek [Fri, 12 Feb 2016 17:09:58 +0000 (17:09 +0000)]
[Hexagon] Remove HexagonExpandPredSpillCode pass

This code is dead. The expansion is now done in HexagonFrameLowering.

llvm-svn: 260691

8 years ago[Hexagon] Eliminate pseudo instructions for circ/brev loads and stores
Krzysztof Parzyszek [Fri, 12 Feb 2016 17:01:51 +0000 (17:01 +0000)]
[Hexagon] Eliminate pseudo instructions for circ/brev loads and stores

We can generate the actual instructions from the intrinsics without the
need for pseudo-instructions. Also, since the intrinsics have a side-
effect in a form of a store, attempt to optimize away loads from the
store location.

llvm-svn: 260690

8 years ago[AArch64] Reduce number of callee-save save/restores.
Geoff Berry [Fri, 12 Feb 2016 16:31:41 +0000 (16:31 +0000)]
[AArch64] Reduce number of callee-save save/restores.

Summary:
Before this change, callee-save registers would be rounded up to even
pairs of GPRs and FPRs.  This change eliminates these extra padding
load/stores, though it does keep the stack allocation the same size
unless both the GPR and FPR sets have an odd size, in which case one
full pair stack slot (16 bytes) is saved.

This optimization cannot currently be done for MachO targets since they
rely on a fast-path .debug_frame equivalent that can only encode
callee-save registers as pairs.

Reviewers: t.p.northover, rengolin, mcrosier, jmolloy

Subscribers: aemerson, rengolin, mcrosier, llvm-commits

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

llvm-svn: 260689

8 years ago[Hexagon] Handle out-of-range offsets in eliminateFrameIndex
Krzysztof Parzyszek [Fri, 12 Feb 2016 16:27:23 +0000 (16:27 +0000)]
[Hexagon] Handle out-of-range offsets in eliminateFrameIndex

Create a virtual register that will hold the actual address and use it
with the offset of 0 in the place of the original FI.

llvm-svn: 260688

8 years ago[AArch64] Add support for Qualcomm Kryo CPU.
Chad Rosier [Fri, 12 Feb 2016 15:51:51 +0000 (15:51 +0000)]
[AArch64] Add support for Qualcomm Kryo CPU.

Machine model description by Dave Estes <cestes@codeaurora.org>.

llvm-svn: 260686

8 years agomake needsPlt a pure predicate.
Rafael Espindola [Fri, 12 Feb 2016 15:47:37 +0000 (15:47 +0000)]
make needsPlt a pure predicate.

llvm-svn: 260685

8 years agoDelete the deprecated LLVMLinkModules.
Rafael Espindola [Fri, 12 Feb 2016 15:28:45 +0000 (15:28 +0000)]
Delete the deprecated LLVMLinkModules.

llvm-svn: 260683

8 years ago[AArch64] Merge two adjacent str WZR into str XZR
Jun Bum Lim [Fri, 12 Feb 2016 15:25:39 +0000 (15:25 +0000)]
[AArch64] Merge two adjacent str WZR into str XZR

Summary:
This change merges adjacent 32 bit zero stores into a 64 bit zero store.
e.g.,
  str wzr, [x0]
  str wzr, [x0, #4]
becomes
  str xzr, [x0]

Therefore, four adjacent 32 bit zero stores will be a single stp.
e.g.,
  str wzr, [x0]
  str wzr, [x0, #4]
  str wzr, [x0, #8]
  str wzr, [x0, #12]
becomes
  stp xzr, xzr, [x0]

Reviewers: mcrosier, jmolloy, gberry, t.p.northover

Subscribers: aemerson, rengolin, mcrosier, llvm-commits

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

llvm-svn: 260682

8 years agoReapply r260096.
Aaron Ballman [Fri, 12 Feb 2016 15:09:05 +0000 (15:09 +0000)]
Reapply r260096.

Expand the simplify boolean expression check to handle implicit conversion of integral types to bool and improve the handling of implicit conversion of member pointers to bool.

Implicit conversion of member pointers are replaced with explicit comparisons to nullptr.

Implicit conversions of integral types are replaced with explicit comparisons to 0.

Patch by Richard Thomson.

llvm-svn: 260681

8 years ago[Hexagon] Specify vector alignment in DataLayout string
Krzysztof Parzyszek [Fri, 12 Feb 2016 14:48:34 +0000 (14:48 +0000)]
[Hexagon] Specify vector alignment in DataLayout string

The DataLayout can calculate alignment of vectors based on the alignment
of the element type and the number of elements. In fact, it is the product
of these two values. The problem is that for vectors of N x i1, this will
return the alignment of N bytes, since the alignment of i1 is 8 bits. The
vector types of vNi1 should be aligned to N bits instead. Provide explicit
alignment for HVX vectors to avoid such complications.

llvm-svn: 260680

8 years agoRe-commit r260230 with a fix for clang-cmake-aarch64-42vma.
Daniel Sanders [Fri, 12 Feb 2016 14:48:19 +0000 (14:48 +0000)]
Re-commit r260230 with a fix for clang-cmake-aarch64-42vma.

There is now a default name_suffix ('default') which should appease the buildbot
and reveal why this builder lacks a suffix.

llvm-svn: 260679

8 years ago[Hexagon] Specify vector alignment in DataLayout string
Krzysztof Parzyszek [Fri, 12 Feb 2016 14:47:38 +0000 (14:47 +0000)]
[Hexagon] Specify vector alignment in DataLayout string

The DataLayout can calculate alignment of vectors based on the alignment
of the element type and the number of elements. In fact, it is the product
of these two values. The problem is that for vectors of N x i1, this will
return the alignment of N bytes, since the alignment of i1 is 8 bits. The
vector types of vNi1 should be aligned to N bits instead. Provide explicit
alignment for HVX vectors to avoid such complications.

llvm-svn: 260678

8 years ago[lld] [ELF/AArch64] Add support to some GD/LE/IS TLS relocations
Adhemerval Zanella [Fri, 12 Feb 2016 13:43:03 +0000 (13:43 +0000)]
[lld] [ELF/AArch64] Add support to some GD/LE/IS TLS relocations

This patch adds some TLS relocations and relaxations for AArch64.
Some Global-Dynamic relocation are handled by optimizing them to
Local-Exec (Initial-Exec is not yet supported). They are:

 - R_AARCH64_TLSDESC_ADR_PAGE21
 - R_AARCH64_TLSDESC_LD64_LO12_NC
 - R_AARCH64_TLSDESC_ADD_LO12_NC
 - R_AARCH64_TLSDESC_CALL

Also some Init-Exec is optimized to Local-Exec if possible. They are:

 - R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21
 - R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC

Finally some Local-Exec relocation are handled in relocateOne:

 - R_AARCH64_TLSLE_ADD_TPREL_HI12
 - R_AARCH64_TLSLE_ADD_TPREL_LO12_NC

This work is mainly for compiler bootstrap, where static binaries is
showing good progress (although shared object still lacking support
from both TLS aarch64 backend and some other issues).

llvm-svn: 260677

8 years agoFix uninitialized memory read.
Benjamin Kramer [Fri, 12 Feb 2016 12:37:21 +0000 (12:37 +0000)]
Fix uninitialized memory read.

Found by msan.

llvm-svn: 260676

8 years agoFix ICE with constexpr and friend functions
Olivier Goffart [Fri, 12 Feb 2016 12:34:44 +0000 (12:34 +0000)]
Fix ICE with constexpr and friend functions

Fix a crash while parsing this code:

  struct X  {
    friend constexpr int foo(X*) { return 12; }
    static constexpr int j = foo(static_cast<X*>(nullptr));
  };

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

llvm-svn: 260675

8 years ago[OMPT] Frame information for openmp taskwait
Jonas Hahnfeld [Fri, 12 Feb 2016 12:19:59 +0000 (12:19 +0000)]
[OMPT] Frame information for openmp taskwait

For pragma omp taskwait the runtime is called from the task context.
Therefore, the reentry frame information should be updated.

The information should be available for both taskwait event calls; therefore,
set before the first event and reset after the last event.

Patch by Joachim Protze
Differential Revision: http://reviews.llvm.org/D17145

llvm-svn: 260674

8 years ago[mips][micromips] Written missing test for CEIL.L.S, CEIL.L.D, FLOOR.L.S and FLOOR...
Hrvoje Varga [Fri, 12 Feb 2016 12:11:26 +0000 (12:11 +0000)]
[mips][micromips] Written missing test for CEIL.L.S, CEIL.L.D, FLOOR.L.S and FLOOR.L.D instructions
Differential Revision: http://reviews.llvm.org/D17192

llvm-svn: 260673

8 years agoRevert r260669 while the clang-cmake-aarch64-42vma failures is investigated.
Daniel Sanders [Fri, 12 Feb 2016 12:09:57 +0000 (12:09 +0000)]
Revert r260669 while the clang-cmake-aarch64-42vma failures is investigated.

There's no obvious reason it should fail in this way but it's the only change
on the blamelist. I suspect stale lit*.cfg's from previous builds.

llvm-svn: 260672

8 years ago[OpenCL] Disable C99 standard lib functions
Anastasia Stulova [Fri, 12 Feb 2016 12:07:04 +0000 (12:07 +0000)]
[OpenCL] Disable C99 standard lib functions

The library functions defined in the C99 standard headers
are not available (OpenCL v1.2 s6.9.f).

This change stops treating OpenCL builtin functions as standard C lib
functions to eliminate warning messages about printf format string.

Patch by Liu Yaxun (Sam)!

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

llvm-svn: 260671

8 years agoRemove LLVMGetTargetMachineData in go-binding.
Haojian Wu [Fri, 12 Feb 2016 11:35:11 +0000 (11:35 +0000)]
Remove LLVMGetTargetMachineData in go-binding.

Summary:
LLVMGetTargetMachineData has been removed, and LLVMGetDataLayout is
suggested to use. The LLVMGetDataLayout is exposed in go bindings.
So it's safe to remove the function.

Reviewers: bkramer

Subscribers: llvm-commits, axw

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

llvm-svn: 260670

8 years ago[msan+tsan] Bring back the tests that disappeared after r260230 and r259512.
Daniel Sanders [Fri, 12 Feb 2016 10:35:53 +0000 (10:35 +0000)]
[msan+tsan] Bring back the tests that disappeared after r260230 and r259512.

The lit test-suite containing the unit tests needs to be explicitly specified
as an argument to lit.py since it is no longer discovered when the other tests
are run (because they are one directory deeper).

dfsan, lsan, and sanitizer_common don't show the same problem.

llvm-svn: 260669

8 years ago[attrs] Simplify the convergent removal to directly use the pre-built
Chandler Carruth [Fri, 12 Feb 2016 09:47:49 +0000 (09:47 +0000)]
[attrs] Simplify the convergent removal to directly use the pre-built
node set rather than walking the SCC directly.

This directly exposes the functions and has already had null entries
filtered out. We also don't need need to handle optnone as it has
already been handled in the caller -- we never try to remove convergent
when there are optnone functions in the SCC.

With this change, the code for removing convergent should work with the
new pass manager and a different SCC analysis.

llvm-svn: 260668

8 years ago[clang-tidy] Fix failure in 'misc-misplaced-widening-cast' test.
Daniel Marjamaki [Fri, 12 Feb 2016 09:38:38 +0000 (09:38 +0000)]
[clang-tidy] Fix failure in 'misc-misplaced-widening-cast' test.

I added portability warnings when int results are casted to long. I forgot to handle uint, ulong and ulonglong.

Tested on x86 and powerpc targets, hope it works now on all buildbots.

llvm-svn: 260667

8 years ago[attrs] Consolidate the test for a non-SCC, non-convergent function call
Chandler Carruth [Fri, 12 Feb 2016 09:23:53 +0000 (09:23 +0000)]
[attrs] Consolidate the test for a non-SCC, non-convergent function call
with the test for a non-convergent intrinsic call.

While it is possible to use the call records to search for function
calls, we're going to do an instruction scan anyways to find the
intrinsics, we can handle both cases while scanning instructions. This
will also make the logic more amenable to the new pass manager which
doesn't use the same call graph structure.

My next patch will remove use of CallGraphNode entirely and allow this
code to work with both the old and new pass manager. Fortunately, it
should also get strictly simpler without changing functionality.

llvm-svn: 260666

8 years ago[clang-tidy] improve misc-misplaced-widening-cast so it also detects portability...
Daniel Marjamaki [Fri, 12 Feb 2016 07:51:10 +0000 (07:51 +0000)]
[clang-tidy] improve misc-misplaced-widening-cast so it also detects portability problems.

Reviewers: alexfh

Subscribers: cfe-commits

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

llvm-svn: 260665

8 years agoThe data formatters for NSArray, NSDictionary and (only partially) NSSet contain...
Enrico Granata [Fri, 12 Feb 2016 07:50:15 +0000 (07:50 +0000)]
The data formatters for NSArray, NSDictionary and (only partially) NSSet contain logic to inspect the objects without running code.
However, they also contain fallback logic that - in cases where LLDB can't recognize the specific subclass - actually does run code in order to inspect those objects.

The argument for this logic was that these data types are critical enough that the risk of getting it wrong is outweighed by the advantage of always providing accurate child information.

Practical experience however shows that "po" - a code running data-inspection command - is quite frequently used, and not considered burdensome by users.
As such, this makes the code-running fallback in the data formatters a risk that carries very little actual reward. Also, unlike the time this code was originally written, we now have accurate class information for Objective-C, and thus we are less likely to improperly identify classes.

This commit removes support for the code-running fallback, and aligns the data formatters for NSArray, NSDictionary and NSSet to the general no-code-running behavior of other data formatters.

While it is possible for us to add support for some subclasses that are now no longer covered by static inspection alone, this is beyond the scope of this commit.

llvm-svn: 260664

8 years ago[unittests/ADT] OptionSetTest: ifdef out for now a specific test that fails on MSVC.
Argyrios Kyrtzidis [Fri, 12 Feb 2016 07:50:01 +0000 (07:50 +0000)]
[unittests/ADT] OptionSetTest: ifdef out for now a specific test that fails on MSVC.

llvm-svn: 260663

8 years ago[CMake] Add option to switch default C++ stdlib
Jonas Hahnfeld [Fri, 12 Feb 2016 07:48:37 +0000 (07:48 +0000)]
[CMake] Add option to switch default C++ stdlib

With this option one can optionally override the architecture dependent
default library to use if no -stdlib= is provided on compiler invocation.

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

llvm-svn: 260662

8 years agotests: Add explicit -stdlib=libstdc++ to tests that require it
Jonas Hahnfeld [Fri, 12 Feb 2016 07:48:28 +0000 (07:48 +0000)]
tests: Add explicit -stdlib=libstdc++ to tests that require it

This will be needed for the next commit that allows to switch the default
C++ library which would otherwise make these tests fail.

llvm-svn: 260661

8 years agoAMDGPU: Set flat_scratch from flat_scratch_init reg
Matt Arsenault [Fri, 12 Feb 2016 06:31:30 +0000 (06:31 +0000)]
AMDGPU: Set flat_scratch from flat_scratch_init reg

This was hardcoded to the static private size, but this
would be missing the offset and additional size for someday
when we have dynamic sizing.

Also stops always initializing flat_scratch even when unused.

In the future we should stop emitting this unless flat instructions
are used to access private memory. For example this will initialize
it almost always on VI because flat is used for global access.

llvm-svn: 260658

8 years agoC API: Remove LLVMGetDataLayout that was deprecated in 3.7
Mehdi Amini [Fri, 12 Feb 2016 06:22:00 +0000 (06:22 +0000)]
C API: Remove LLVMGetDataLayout that was deprecated in 3.7

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

8 years agoFix minor error with debug info doc.
Mark Lacey [Fri, 12 Feb 2016 06:19:16 +0000 (06:19 +0000)]
Fix minor error with debug info doc.

Replace 'third' with 'fourth' in the description of the fourth argument.

llvm-svn: 260656

8 years ago[unittests/ADT] OptionSetTest: ifdef out a part that fails to compile on MSVC.
Argyrios Kyrtzidis [Fri, 12 Feb 2016 05:52:37 +0000 (05:52 +0000)]
[unittests/ADT] OptionSetTest: ifdef out a part that fails to compile on MSVC.

llvm-svn: 260655

8 years ago[ADT] OptionSet: ifdef out some code that seems to be crashing MSVC.
Argyrios Kyrtzidis [Fri, 12 Feb 2016 04:36:48 +0000 (04:36 +0000)]
[ADT] OptionSet: ifdef out some code that seems to be crashing MSVC.

llvm-svn: 260654

8 years ago[attrs] Run clang-format over a newly added routine in function-attrs
Chandler Carruth [Fri, 12 Feb 2016 03:07:50 +0000 (03:07 +0000)]
[attrs] Run clang-format over a newly added routine in function-attrs
before I update it to be friendly with the new pass manager.

llvm-svn: 260653

8 years ago[ADT] Introduce ‘OptionSet’ in llvm/ADT headers, which is a utility class that makes...
Argyrios Kyrtzidis [Fri, 12 Feb 2016 02:48:26 +0000 (02:48 +0000)]
[ADT] Introduce â€˜OptionSet’ in llvm/ADT headers, which is a utility class that makes it convenient to work with enumerators representing bit options.

llvm-svn: 260652

8 years agoAMDGPU: Set element_size in private resource descriptor
Matt Arsenault [Fri, 12 Feb 2016 02:40:47 +0000 (02:40 +0000)]
AMDGPU: Set element_size in private resource descriptor

Introduce a subtarget feature for this, and leave the default with
the current behavior which assumes up to 16-byte loads/stores can
be used. The field also seems to have the ability to be set to 2 bytes,
but I'm not sure what that would be used for.

llvm-svn: 260651

8 years ago[libFuzzer] make -runs=N flag also affect the simple runner (will execute every input...
Kostya Serebryany [Fri, 12 Feb 2016 02:32:03 +0000 (02:32 +0000)]
[libFuzzer] make -runs=N flag also affect the simple runner (will execute every input N times)

llvm-svn: 260649

8 years agoUpdate functions in clang supplied headers to use the compiler reserved
Eric Christopher [Fri, 12 Feb 2016 02:22:53 +0000 (02:22 +0000)]
Update functions in clang supplied headers to use the compiler reserved
namespace for arguments.

llvm-svn: 260647

8 years agoAMDGPU: Fix mishandling alignment when scalarizing vector loads/stores
Matt Arsenault [Fri, 12 Feb 2016 02:22:21 +0000 (02:22 +0000)]
AMDGPU: Fix mishandling alignment when scalarizing vector loads/stores

I don't think this was causing any real problems, so I'm not sure
how to test for this.

llvm-svn: 260646

8 years agoAMDGPU: Initialize SILowerControlFlow
Matt Arsenault [Fri, 12 Feb 2016 02:16:10 +0000 (02:16 +0000)]
AMDGPU: Initialize SILowerControlFlow

llvm-svn: 260645

8 years agoAMDGPU: Remove trailing whitespace
Matt Arsenault [Fri, 12 Feb 2016 02:16:07 +0000 (02:16 +0000)]
AMDGPU: Remove trailing whitespace

llvm-svn: 260644

8 years agoAvoid linking LLVM component libraries with libLLVM
Andrew Wilkins [Fri, 12 Feb 2016 01:42:43 +0000 (01:42 +0000)]
Avoid linking LLVM component libraries with libLLVM

Patch by Jack Howarth.

When linking to libLLVM, don't also link to the component
libraries that constitute libLLVM.

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

llvm-svn: 260641

8 years ago<float.h>: do not define DECIMAL_DIG in -std=c89 mode; this macro was added in C99.
Richard Smith [Fri, 12 Feb 2016 01:15:33 +0000 (01:15 +0000)]
<float.h>: do not define DECIMAL_DIG in -std=c89 mode; this macro was added in C99.

Patch by Jorge Teixeira!

llvm-svn: 260639

8 years agoUsersManual: update clang-cl commands
Hans Wennborg [Fri, 12 Feb 2016 01:01:37 +0000 (01:01 +0000)]
UsersManual: update clang-cl commands

llvm-svn: 260637

8 years agoMake compCtors strict weak ordering.
Rui Ueyama [Fri, 12 Feb 2016 00:38:46 +0000 (00:38 +0000)]
Make compCtors strict weak ordering.

Previously, if both A and B are ".ctors", both compCtors(A, B) and
compCtors(B, A) are true, which is a violation of the strict weak
ordering because such function is not antisymmetric.

llvm-svn: 260633

8 years ago[msan] Put msan constructor in a comdat.
Evgeniy Stepanov [Fri, 12 Feb 2016 00:37:52 +0000 (00:37 +0000)]
[msan] Put msan constructor in a comdat.

MSan adds a constructor to each translation unit that calls
__msan_init, and does nothing else. The idea is to run __msan_init
before any instrumented code. This results in multiple constructors
and multiple .init_array entries in the final binary, one per
translation unit. This is absolutely unnecessary; one would be
enough.

This change moves the constructors to a comdat group in order to drop
the extra ones.

llvm-svn: 260632

8 years agoUse __ before argument names in provided headers.
Eric Christopher [Fri, 12 Feb 2016 00:32:23 +0000 (00:32 +0000)]
Use __ before argument names in provided headers.

llvm-svn: 260631

8 years ago[sancov] improved object files handling.
Mike Aizatsky [Fri, 12 Feb 2016 00:29:45 +0000 (00:29 +0000)]
[sancov] improved object files handling.

Documentation change for: http://reviews.llvm.org/D17169

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

llvm-svn: 260630

8 years ago[sancov] improved object files handling.
Mike Aizatsky [Fri, 12 Feb 2016 00:29:24 +0000 (00:29 +0000)]
[sancov] improved object files handling.

Updating sancov invocation on html_cov_dump.

sancov change: http://reviews.llvm.org/D17169

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

llvm-svn: 260629

8 years ago[sancov] improved object files handling.
Mike Aizatsky [Fri, 12 Feb 2016 00:29:07 +0000 (00:29 +0000)]
[sancov] improved object files handling.

Multi-dso programs result in multiple coverage files dumped of the form
'<module_name>.<pid>.sancov'. When analyzing these coverage files it is
important to use correct corresponding object file.

This change removes the "-obj" sancov flag and lets user specify object
file names alongside coverage files. Sancov tool would match them using
<module_name> part of coverage file and short file name of the object
file.

Corresponding changes:
- compiler-rt: http://reviews.llvm.org/D17171
- docs: http://reviews.llvm.org/D17175

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

llvm-svn: 260628

8 years ago[LVI] Improve select handling to use condition
Philip Reames [Fri, 12 Feb 2016 00:09:18 +0000 (00:09 +0000)]
[LVI] Improve select handling to use condition

This patches teaches LVI to recognize clamp idioms (e.g. select(a > 5, a, 5) will always produce something greater than 5.

The tests end up being somewhat simplistic because trying to exercise the case I actually care about (a loop with a range check on a clamped secondary induction variable) ends up tripping across a couple of other imprecisions in the analysis. Ah, the joys of LVI...

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

llvm-svn: 260627

8 years agoDon't crash if we have a DIE that has a DW_AT_ranges attribute and yet the SymbolFile...
Greg Clayton [Fri, 12 Feb 2016 00:07:16 +0000 (00:07 +0000)]
Don't crash if we have a DIE that has a DW_AT_ranges attribute and yet the SymbolFileDWARF doesn't have a DebugRanges. If this happens print a nice error message to prompt the user to file a bug and attach the offending DWARF file so we can get the correct compiler fixed.

<rdar://problem/24458016>

llvm-svn: 260626

8 years agoAMDGPU: Quick fix for extreme slowness in spill-scavenge-offset.ll test
Nicolai Haehnle [Fri, 12 Feb 2016 00:05:34 +0000 (00:05 +0000)]
AMDGPU: Quick fix for extreme slowness in spill-scavenge-offset.ll test

Summary: Also, some cosmetic fixes.

Reviewers: arsenm, tstellarAMD

Subscribers: qcolombet, llvm-commits

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

llvm-svn: 260625

8 years agoWhen calling TypeSystemMap::Clear, objects being destroyed in the process of
Jim Ingham [Fri, 12 Feb 2016 00:03:19 +0000 (00:03 +0000)]
When calling TypeSystemMap::Clear, objects being destroyed in the process of
clearing the map ended up calling back into the TypeSystemMap to do lookups.
Not a good idea, and in this case it would cause a deadlock.

You would only see this when replacing the target contents after an exec, and only if you
had stopped before the exec, evaluated an expression, then continued
on to the point where you did the exec.

Fixed this by making sure the TypeSystemMap::Clear tears down the TypeSystems in the map before clearing the map.
I also add an expression before exec to the TestExec.py so that we'll catch this
issue if it crops up again in the future.

<rdar://problem/24554920>

llvm-svn: 260624

8 years agollvm/test/CodeGen/NVPTX/debug-file-loc.ll: Tweak expressions for dos path.
NAKAMURA Takumi [Thu, 11 Feb 2016 23:59:43 +0000 (23:59 +0000)]
llvm/test/CodeGen/NVPTX/debug-file-loc.ll: Tweak expressions for dos path.

llvm-svn: 260623

8 years agoInstead of asking glibc to provide correct C++ signatures for <string.h>
Richard Smith [Thu, 11 Feb 2016 23:51:02 +0000 (23:51 +0000)]
Instead of asking glibc to provide correct C++ signatures for <string.h>
functions, ask it whether it did provide them after the fact. Some versions of
glibc fail to compile if you make this request and don't also claim to be at
least GCC 4.3.

llvm-svn: 260622

8 years agoARMv7k: use Cortex-A7 by default even for tvOS
Tim Northover [Thu, 11 Feb 2016 23:49:08 +0000 (23:49 +0000)]
ARMv7k: use Cortex-A7 by default even for tvOS

Also actually test the default CPU from those triples.

llvm-svn: 260621

8 years agoELF: Implement the correct semantics of .[cd]tors.
Rui Ueyama [Thu, 11 Feb 2016 23:41:38 +0000 (23:41 +0000)]
ELF: Implement the correct semantics of .[cd]tors.

As I noted in the comment, the sorting order of .[cd]tors are
different from .{init,fini}_array's.

http://reviews.llvm.org/D17120

llvm-svn: 260620

8 years ago[codeview] Dump def range lengths in hex
Reid Kleckner [Thu, 11 Feb 2016 23:40:14 +0000 (23:40 +0000)]
[codeview] Dump def range lengths in hex

It makes it easier to correlate with assembly dumps, which are typically
given with hex offsets.

llvm-svn: 260619

8 years agoRemoved a bad assertion:
Greg Clayton [Thu, 11 Feb 2016 23:36:57 +0000 (23:36 +0000)]
Removed a bad assertion:

assert(((SymbolFileDWARF*)m_ast.GetSymbolFile())->UserIDMatches(die.GetDIERef().GetUID()) &&
       "Adding incorrect type to forward declaration map");

The problem is that "m_ast.GetSymbolFile()" can return a SymbolFileDWARFDebugMap. The code is doing the right thing if the assertion is ignored.

<rdar://problem/24437972>

llvm-svn: 260618

8 years agoRemove decision logic for old NetBSD development versions, the 7.0
Joerg Sonnenberger [Thu, 11 Feb 2016 23:35:03 +0000 (23:35 +0000)]
Remove decision logic for old NetBSD development versions, the 7.0
release made this obsolete.

llvm-svn: 260617

8 years agoNow that Sparc/Sparc64 backend is mostly usable, provide the same
Joerg Sonnenberger [Thu, 11 Feb 2016 23:18:36 +0000 (23:18 +0000)]
Now that Sparc/Sparc64 backend is mostly usable, provide the same
linking defaults as other NetBSD targets, i.e. compiler_rt-in-libc and
libc++ as STL.

llvm-svn: 260616

8 years agoFix incorrect task_team in __kmp_give_task
Jonathan Peyton [Thu, 11 Feb 2016 23:07:30 +0000 (23:07 +0000)]
Fix incorrect task_team in __kmp_give_task

When a target task finishes and it tries to access the th_task_team from the
threads in the team where it was created, th_task_team can be NULL or point to
a different place when that thread started a nested region that is still
running. Finding the exact task_team that the threads were using is difficult
as it would require to unwind the task_state_memo_stack. So a new field was added
in the taskdata structure to point to the active task_team when the task was
created.

llvm-svn: 260615

8 years ago[SLP] Add debug output for extract cost (NFC)
Matthew Simpson [Thu, 11 Feb 2016 23:06:40 +0000 (23:06 +0000)]
[SLP] Add debug output for extract cost (NFC)

llvm-svn: 260614

8 years agoFix a couple of typos in comments
Jonathan Peyton [Thu, 11 Feb 2016 22:58:29 +0000 (22:58 +0000)]
Fix a couple of typos in comments

llvm-svn: 260613

8 years agoRe-apply r238452, the bug was in clang and was fixed in r260567.
Quentin Colombet [Thu, 11 Feb 2016 22:30:41 +0000 (22:30 +0000)]
Re-apply r238452, the bug was in clang and was fixed in r260567.

Original commit message:
[InstCombine] Fold IntToPtr and PtrToInt into preceding loads.

Currently we only fold a BitCast into a Load when the BitCast is its
only user.

Do the same for any no-op cast.

Patch by Philip Pfaffe!

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

llvm-svn: 260612

8 years ago[libfuzzer] Removing coverage-related flags from asan options.
Mike Aizatsky [Thu, 11 Feb 2016 22:20:34 +0000 (22:20 +0000)]
[libfuzzer] Removing coverage-related flags from asan options.

Summary:
Reasons to remove are twofold:
 - we don't really need coverage=1 for libfuzzer operation
 - makes controlling coverage for fuzzer processes non-trivial.

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

llvm-svn: 260611

8 years agoRemove bogus check that larger floating point types have smaller minimum
Richard Smith [Thu, 11 Feb 2016 22:18:10 +0000 (22:18 +0000)]
Remove bogus check that larger floating point types have smaller minimum
normalized exponents. That's not true for double versus double double.

llvm-svn: 260610

8 years ago[x86] simplify getZeroVector() ; NFCI
Sanjay Patel [Thu, 11 Feb 2016 22:17:04 +0000 (22:17 +0000)]
[x86] simplify getZeroVector() ; NFCI

Let DAG.getConstant() handle the splatting; there's no need
to repeat that logic here.

See also:
http://reviews.llvm.org/rL258833
http://reviews.llvm.org/rL260582

llvm-svn: 260609

8 years ago[analyzer] Improve pattern matching in ObjCDealloc checker.
Devin Coughlin [Thu, 11 Feb 2016 22:13:20 +0000 (22:13 +0000)]
[analyzer] Improve pattern matching in ObjCDealloc checker.

Look through PseudoObjectExpr and OpaqueValueExprs when scanning for
release-like operations. This commit also adds additional tests in anticipation
of re-writing this as a path-sensitive checker.

llvm-svn: 260608

8 years agoRevert "Refactor the PassManagerBuilder: extract a "addFunctionSimplificationPasses()""
Mehdi Amini [Thu, 11 Feb 2016 22:09:11 +0000 (22:09 +0000)]
Revert "Refactor the PassManagerBuilder: extract a "addFunctionSimplificationPasses()""

This reverts commit r260603.
I didn't intend to push it :(

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

8 years agoRevert "Define the ThinLTO Pipeline"
Mehdi Amini [Thu, 11 Feb 2016 22:09:07 +0000 (22:09 +0000)]
Revert "Define the ThinLTO Pipeline"

This reverts commit r260604.
I didn't intend to push this now.

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

8 years agoRevert "Add a new insert_as() method to DenseMap and use it for ConstantUniqueMap"
Mehdi Amini [Thu, 11 Feb 2016 22:00:36 +0000 (22:00 +0000)]
Revert "Add a new insert_as() method to DenseMap and use it for ConstantUniqueMap"

This reverts commit r260458.

It was backported on an internal branch and broke stage2 build. Since
this can lead to weird random crash I'm reverting upstream as well
while investigating.

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

8 years agoDefine the ThinLTO Pipeline
Mehdi Amini [Thu, 11 Feb 2016 22:00:31 +0000 (22:00 +0000)]
Define the ThinLTO Pipeline

Summary:
On the contrary to Full LTO, ThinLTO can afford to shift compile time
from the frontend to the linker: both phases are parallel.
This pipeline is based on the proposal in D13443 for full LTO. We ]
didn't move forward on this proposal because the link was far too long
after that.

This patch refactor the "function simplification" passes that are part
of the inliner loop in a helper function (this part is NFC and can be
commited separately to simplify the diff). The ThinLTO pipeline
integrates in the regular O2/O3 flow:

 - The compile phase perform the inliner with a somehow lighter
   function simplification. (TODO: tune the inliner thresholds here)
   This is intendend to simplify the IR and get rid of obvious things
   like linkonce_odr that will be inlined.
 - The link phase will run the pipeline from the start, extended with
   some specific passes that leverage the augmented knowledge we have
   during LTO. Especially after the inliner is done, a sequence of
   globalDCE/globalOpt is performed, followed by another run of the
   "function simplification" passes.

The measurements on the public test suite as well as on our internal
suite show an overall net improvement. The binary size for the clang
executable is reduced by 5%. We're still tuning it with the bringup
of ThinLTO but this should provide a good starting point.

Reviewers: tejohnson

Subscribers: joker.eph, llvm-commits, dexonsmith

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

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

8 years agoRefactor the PassManagerBuilder: extract a "addFunctionSimplificationPasses()"
Mehdi Amini [Thu, 11 Feb 2016 22:00:25 +0000 (22:00 +0000)]
Refactor the PassManagerBuilder: extract a "addFunctionSimplificationPasses()"

It is intended to contains the passes run over a function after the
inliner is done with a function and before it moves to its callers.

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

8 years ago[IRTranslator] Use a single virtual register to represent any Value.
Quentin Colombet [Thu, 11 Feb 2016 21:48:32 +0000 (21:48 +0000)]
[IRTranslator] Use a single virtual register to represent any Value.
PR26161.

llvm-svn: 260602

8 years agoFix LWG issue 2469 - Use piecewise construction in unordered_map::operator[].
Eric Fiselier [Thu, 11 Feb 2016 21:45:53 +0000 (21:45 +0000)]
Fix LWG issue 2469 - Use piecewise construction in unordered_map::operator[].

unordered_map's allocator may only be used to construct objects of 'value_type',
or in this case 'pair<const Key, Value>'. In order to respect this requirement
in operator[], which requires default constructing the 'mapped_type', we have
to use pair's piecewise constructor with '(tuple<Kep>, tuple<>)'.

Unfortunately we still need to provide a fallback implementation for C++03
since we don't have <tuple>. Even worse this fallback is the last remaining
user of '__hash_map_node_destructor' and '__construct_node_with_key'.

llvm-svn: 260601

8 years ago[AArch64] Implements the lowering of formal arguments for GlobalISel.
Quentin Colombet [Thu, 11 Feb 2016 21:45:08 +0000 (21:45 +0000)]
[AArch64] Implements the lowering of formal arguments for GlobalISel.
This is just a trivial implementation:
- Support only arguments passed in registers.
- Support only "plain" arguments, i.e., no sext/zext attribute.

At this point, it is possible to play with the IRTranslator on AArch64:
llc -mtriple arm64-<vendor>-<os> -print-machineinstrs <input.ll> -o - -global-isel

For now, we only support the translation of program with adds and returns.

Follow-up patches are on their way to add a test case (the MIRParser is
not ready as it is).

llvm-svn: 260600

8 years agoAMDGPU/SI: Make sure MIMG descriptors and samplers stay in SGPRs
Tom Stellard [Thu, 11 Feb 2016 21:45:07 +0000 (21:45 +0000)]
AMDGPU/SI: Make sure MIMG descriptors and samplers stay in SGPRs

Summary:
It's possible to have resource descriptors and samplers stored in
VGPRs, either by a VMEM instruction or in the case of samplers,
floating-point calculations.  When this happens, we need to use
v_readfirstlane to copy these values back to sgprs.

Reviewers: mareko, arsenm

Subscribers: arsenm, llvm-commits

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

llvm-svn: 260599

8 years agoELF: Remove readLinkerScript and define LinkerScript::read instead.
Rui Ueyama [Thu, 11 Feb 2016 21:38:55 +0000 (21:38 +0000)]
ELF: Remove readLinkerScript and define LinkerScript::read instead.

llvm-svn: 260598

8 years agoAdd support for phi nodes in the LLVM C API test
Amaury Sechet [Thu, 11 Feb 2016 21:37:54 +0000 (21:37 +0000)]
Add support for phi nodes in the LLVM C API test

Summary: This required to add binding to Instruction::removeFromParent so that instruction can be forward declared and then moved at the right place.

Reviewers: bogner, chandlerc, echristo, dblaikie, joker.eph, Wallbraker

Subscribers: llvm-commits

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

llvm-svn: 260597

8 years agoRelax recently added clang version checks.
Tim Northover [Thu, 11 Feb 2016 21:31:51 +0000 (21:31 +0000)]
Relax recently added clang version checks.

You can override the value of these during CMake, and we often use sentinels
with more than one digit (not to mention our actual Clang being 700.whatever).

llvm-svn: 260596

8 years ago[AArch64] Fix libunwind build when using GNU assembler
Renato Golin [Thu, 11 Feb 2016 21:22:57 +0000 (21:22 +0000)]
[AArch64] Fix libunwind build when using GNU assembler

Use x29 and x30 for fp and lr respectively.

This does not change the code generation with integrated asm
but using x30 and x29 helps compile the code with gnu as. Currently gas
fails to assemble this code with errors as below.

Error: operand X should be an integer register.

Newer versions of binutils should be fixed, but enough exists in the wild
to make this change harmless and worthy.

Patch by Khem Raj.

llvm-svn: 260595

8 years ago[GlobalISel][MachineIRBuilder] Fix comments.
Quentin Colombet [Thu, 11 Feb 2016 21:21:40 +0000 (21:21 +0000)]
[GlobalISel][MachineIRBuilder] Fix comments.

llvm-svn: 260594