Todd Fiala [Fri, 19 Aug 2016 04:55:12 +0000 (04:55 +0000)]
fixup macOS gtest running
Needed to explicitly turn off RTTI (since lldb-core builds
with -fno-rtti) and specify -DGTEST_HAVE_RTTI=0.
llvm-svn: 279205
Dean Michael Berris [Fri, 19 Aug 2016 04:44:30 +0000 (04:44 +0000)]
[XRay] Synthesize a reference to the xray_instr_map
Without the synthesized reference to a symbol in the xray_instr_map,
linker section garbage collection will helpfully remove the whole
xray_instr_map section from the final executable (or archive). This will
cause the runtime to not be able to identify the sleds and hot-patch the
calls/jumps into the runtime trampolines.
This change adds a reference from the text section at the end of the
function to keep around the associated xray_instr_map section as well.
We also make sure that we catch this reference in the test.
Reviewers: chandlerc, echristo, majnemer, mehdi_amini
Subscribers: mehdi_amini, llvm-commits, dberris
Differential Revision: https://reviews.llvm.org/D23398
llvm-svn: 279204
Todd Fiala [Fri, 19 Aug 2016 04:38:44 +0000 (04:38 +0000)]
fix broken gdb-remote gtest
This change adds the Process/gdb-remote gtests to the Xcode
build. It also adds a virtual method impl to the continuation
delegate that I added with the StructuredDataPlugin change.
llvm-svn: 279203
Todd Fiala [Fri, 19 Aug 2016 04:21:48 +0000 (04:21 +0000)]
Add StructuredData plugin type; showcase with new DarwinLog feature
Take 2, with missing cmake line fixed. Build tested on
Ubuntu 14.04 with clang-3.6.
See docs/structured_data/StructuredDataPlugins.md for details.
differential review: https://reviews.llvm.org/D22976
reviewers: clayborg, jingham
llvm-svn: 279202
Lang Hames [Fri, 19 Aug 2016 03:12:16 +0000 (03:12 +0000)]
[RuntimeDyld][MCJIT] Un-XFAIL some tests that were fixed by r279182.
llvm-svn: 279201
Todd Fiala [Fri, 19 Aug 2016 03:03:58 +0000 (03:03 +0000)]
Revert "Add StructuredData plugin type; showcase with new DarwinLog feature"
This reverts commit
1d885845d1451e7b232f53fba2e36be67aadabd8.
llvm-svn: 279200
Matthias Braun [Fri, 19 Aug 2016 03:03:24 +0000 (03:03 +0000)]
Revert "RegScavenging: Add scavengeRegisterBackwards()"
The ppc64 multistage bot fails on this.
This reverts commit r279124.
Also Revert "CodeGen: Add/Factor out LiveRegUnits class; NFCI" because it depends on the previous change
This reverts commit r279171.
llvm-svn: 279199
Todd Fiala [Fri, 19 Aug 2016 02:52:07 +0000 (02:52 +0000)]
Add StructuredData plugin type; showcase with new DarwinLog feature
See docs/structured_data/StructuredDataPlugins.md for details.
differential review: https://reviews.llvm.org/D22976
reviewers: clayborg, jingham
llvm-svn: 279198
Chandler Carruth [Fri, 19 Aug 2016 02:07:51 +0000 (02:07 +0000)]
[ADT] Add the worlds simplest STL extra. Or at least close to it.
This is a little class template that just builds an inheritance chain of
empty classes. Despite how simple this is, it can be used to really
nicely create ranked overload sets. I've added a unittest as much to
document this as test it. You can pass an object of this type as an
argument to a function overload set an it will call the first viable and
enabled candidate at or below the rank of the object.
I'm planning to use this in a subsequent commit to more clearly rank
overload candidates used for SFINAE. All credit for this technique and
both lines of code here to Richard Smith who was helping me rewrite the
SFINAE check in question to much more effectively capture the intended
set of checks.
llvm-svn: 279197
Richard Smith [Fri, 19 Aug 2016 01:43:06 +0000 (01:43 +0000)]
C++ Modules TS: support parsing the 'module' declaration (including extensions
from p0273r0 approved by EWG). We'll eventually need to handle this from the
lexer as well, in order to disallow preprocessor directives preceding the
module declaration and to support macro import.
llvm-svn: 279196
Devin Coughlin [Fri, 19 Aug 2016 01:22:50 +0000 (01:22 +0000)]
[www] Add analyzer FAQ about not releasing ivars in -dealloc.
llvm-svn: 279183
Lang Hames [Fri, 19 Aug 2016 01:15:39 +0000 (01:15 +0000)]
[RuntimeDyld] Add support for ELF R_ARM_REL32 and R_ARM_GOT_PREL.
Patch by William Dillon. Thanks William!
This patch adds support for the R_ARM_REL32 and R_ARM_GOT_PREL ELF ARM
relocations to RuntimeDyld, which should allow JITing of code that
produces these relocations.
No test case: Unfortunately RuntimeDyldELF's GOT building mechanism (which
uses a separate section for GOT entries) isn't compatible with
RuntimeDyldChecker. The correct fix for this is to fix RuntimeDyldELF's GOT
support (it's fundamentally broken at the moment: separate sections aren't
guaranteed to be in range of a GOT entry load), but that's a non-trivial job.
llvm-svn: 279182
Devin Coughlin [Fri, 19 Aug 2016 01:05:31 +0000 (01:05 +0000)]
[analyzer] Weaken assertion in trackNullOrUndefValue()
We should ignore paren casts when making sure that the semantic expression
in a PseudoObjectExpr for an ObjC getter is a message send.
This has no other intended functionality change.
Adding a test for this exposed an interesting issue in another test case
that only manifests under ARC. trackNullOrUndefValue() is not properly
suppressing for nil values that are the result of nil propagation from a nil
receiver when the nil is returned from a function. I've added a FIXME for that
missing suppression.
rdar://problem/
27290568
llvm-svn: 279181
Saleem Abdulrasool [Thu, 18 Aug 2016 23:59:12 +0000 (23:59 +0000)]
EHABI: cover switch once more
When making WMMX support optional, we uncovered the switch. Add the missing
entries. Since the entry is a break leading to a dead path, it should get
optimized out yet retain the switch overage.
llvm-svn: 279180
Vitaly Buka [Thu, 18 Aug 2016 23:51:15 +0000 (23:51 +0000)]
[asan] Optimize store size in FunctionStackPoisoner::poisonRedZones
Summary: Reduce store size to avoid leading and trailing zeros.
Reviewers: kcc, eugenis
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D23648
llvm-svn: 279178
Andrew Kaylor [Thu, 18 Aug 2016 22:49:51 +0000 (22:49 +0000)]
Include X86CallFrameOptimization in the opt-bisect process.
Differential Revision: https://reviews.llvm.org/D23683
llvm-svn: 279175
Saleem Abdulrasool [Thu, 18 Aug 2016 22:35:06 +0000 (22:35 +0000)]
AArch64: remove extraneous padding
The structs BarrierOp, PrefetchOp, PSBHintOp are in AArch64AsmParser.cpp
(inside anonymous namespace). This diff changes the order of fields and
removes the excessive padding (8 bytes).
Patch by Alexander Shaposhnikov!
llvm-svn: 279173
Chris Bieneman [Thu, 18 Aug 2016 22:18:11 +0000 (22:18 +0000)]
[CMake] Add variables for tracking which runtimes are included
This allows sub-projects to have conditionals based on the presence of other projects.
llvm-svn: 279172
Matthias Braun [Thu, 18 Aug 2016 22:11:28 +0000 (22:11 +0000)]
CodeGen: Add/Factor out LiveRegUnits class; NFCI
This is a set of register units intended to track register liveness, it
is similar in spirit to LivePhysRegs.
You can also think of this as the liveness tracking parts of the
RegisterScavenger factored out into an own class.
This was proposed in http://llvm.org/PR27609
Differential Revision: http://reviews.llvm.org/D21916
llvm-svn: 279171
Eugene Zelenko [Thu, 18 Aug 2016 22:11:27 +0000 (22:11 +0000)]
[Documentation] Fixed style in modernize-use-emplace.rst.
llvm-svn: 279170
Jacques Pienaar [Thu, 18 Aug 2016 22:10:06 +0000 (22:10 +0000)]
Fix link quotes on AArch64's CompilerWriterInfo section.
Reviewers: t.p.northover
Subscribers: t.p.northover, aemerson, rengolin
Differential Revision: https://reviews.llvm.org/D23697
llvm-svn: 279169
Kyle Butt [Thu, 18 Aug 2016 22:09:27 +0000 (22:09 +0000)]
CodeGen: If Convert blocks that would form a diamond when tail-merged.
The following function currently relies on tail-merging for if
conversion to succeed. The common tail of cond_true and cond_false is
extracted, and this then forms a diamond pattern that can be
successfully if converted.
If this block does not get extracted, either because tail-merging is
disabled or the threshold is higher, we should still recognize this
pattern and if-convert it.
Fixed a regression in the original commit. Need to un-reverse branches after
reversing them, or other conversions go awry.
Regression on self-hosting bots with no obvious explanation. Tidied up range
handling to be more obviously correct, but there was no smoking gun.
define i32 @t2(i32 %a, i32 %b) nounwind {
entry:
%tmp1434 = icmp eq i32 %a, %b ; <i1> [#uses=1]
br i1 %tmp1434, label %bb17, label %bb.outer
bb.outer: ; preds = %cond_false, %entry
%b_addr.021.0.ph = phi i32 [ %b, %entry ], [ %tmp10, %cond_false ]
%a_addr.026.0.ph = phi i32 [ %a, %entry ], [ %a_addr.026.0, %cond_false ]
br label %bb
bb: ; preds = %cond_true, %bb.outer
%indvar = phi i32 [ 0, %bb.outer ], [ %indvar.next, %cond_true ]
%tmp. = sub i32 0, %b_addr.021.0.ph
%tmp.40 = mul i32 %indvar, %tmp.
%a_addr.026.0 = add i32 %tmp.40, %a_addr.026.0.ph
%tmp3 = icmp sgt i32 %a_addr.026.0, %b_addr.021.0.ph
br i1 %tmp3, label %cond_true, label %cond_false
cond_true: ; preds = %bb
%tmp7 = sub i32 %a_addr.026.0, %b_addr.021.0.ph
%tmp1437 = icmp eq i32 %tmp7, %b_addr.021.0.ph
%indvar.next = add i32 %indvar, 1
br i1 %tmp1437, label %bb17, label %bb
cond_false: ; preds = %bb
%tmp10 = sub i32 %b_addr.021.0.ph, %a_addr.026.0
%tmp14 = icmp eq i32 %a_addr.026.0, %tmp10
br i1 %tmp14, label %bb17, label %bb.outer
bb17: ; preds = %cond_false, %cond_true, %entry
%a_addr.026.1 = phi i32 [ %a, %entry ], [ %tmp7, %cond_true ], [ %a_addr.026.0, %cond_false ]
ret i32 %a_addr.026.1
}
Without tail-merging or diamond-tail if conversion:
LBB1_1: @ %bb
@ =>This Inner Loop Header: Depth=1
cmp r0, r1
ble LBB1_3
@ BB#2: @ %cond_true
@ in Loop: Header=BB1_1 Depth=1
subs r0, r0, r1
cmp r1, r0
it ne
cmpne r0, r1
bgt LBB1_4
LBB1_3: @ %cond_false
@ in Loop: Header=BB1_1 Depth=1
subs r1, r1, r0
cmp r1, r0
bne LBB1_1
LBB1_4: @ %bb17
bx lr
With diamond-tail if conversion, but without tail-merging:
@ BB#0: @ %entry
cmp r0, r1
it eq
bxeq lr
LBB1_1: @ %bb
@ =>This Inner Loop Header: Depth=1
cmp r0, r1
ite le
suble r1, r1, r0
subgt r0, r0, r1
cmp r1, r0
bne LBB1_1
@ BB#2: @ %bb17
bx lr
llvm-svn: 279168
Kyle Butt [Thu, 18 Aug 2016 22:09:25 +0000 (22:09 +0000)]
IfConversion: Rescan diamonds.
The cost of predicating a diamond is only the instructions that are not shared
between the two branches. Additionally If a predicate clobbering instruction
occurs in the shared portion of the branches (e.g. a cond move), it may still
be possible to if convert the sub-cfg. This change handles these two facts by
rescanning the non-shared portion of a diamond sub-cfg to recalculate both the
predication cost and whether both blocks are pred-clobbering.
llvm-svn: 279167
Kyle Butt [Thu, 18 Aug 2016 22:09:23 +0000 (22:09 +0000)]
IfConversion: Handle inclusive ranges more carefully.
This may affect calculations for thresholds, but is not a significant change
in behavior.
The problem was that an inclusive range must have an additonal flag to showr
that it is empty, because otherwise begin == end implies that the range has one
element, and it may not be possible to move past on either side.
llvm-svn: 279166
Changpeng Fang [Thu, 18 Aug 2016 22:04:54 +0000 (22:04 +0000)]
AMDGPU: Add clang builtin for ds_swizzle.
Summary:
int __builtin_amdgcn_ds_swizzle (int a, int imm);
while imm is a constant.
Differential Revision:
http://reviews.llvm.org/D23682
llvm-svn: 279165
Vassil Vassilev [Thu, 18 Aug 2016 22:01:25 +0000 (22:01 +0000)]
PR28794: Don't try to instantiate function templates which are not visible.
Reviewed by Richard Smith.
llvm-svn: 279164
Richard Smith [Thu, 18 Aug 2016 21:59:42 +0000 (21:59 +0000)]
C++ Modules TS: Add parsing support for module import declaration.
llvm-svn: 279163
Petr Hosek [Thu, 18 Aug 2016 21:55:23 +0000 (21:55 +0000)]
[ELF] Improve error reporting for relocations
We should always include symbol name when reporting relocations
error to simplify debugging of these issues. Without symbol names
users have to manually investigate which of the libraries contain
invalid relocations which can be cumbersome when linking multiple
libraries.
Differential Revision: https://reviews.llvm.org/D23690
llvm-svn: 279162
Hemant Kulkarni [Thu, 18 Aug 2016 21:50:13 +0000 (21:50 +0000)]
llvm-objdump: Add Hexagon printer changes for -S/-l options
Differential Revision: https://reviews.llvm.org/D23521
llvm-svn: 279161
Chris Bieneman [Thu, 18 Aug 2016 21:47:18 +0000 (21:47 +0000)]
[CMake] Create convenience targets for runtime projects
Each runtime project has a top-level target that is the name of the runtime (minus the "lib" prefix if applicable). This creates top-level targets mapping to runtime projects.
llvm-svn: 279160
Justin Bogner [Thu, 18 Aug 2016 21:46:54 +0000 (21:46 +0000)]
CodeGen: Rename a variable to better fit LLVM style. NFC
llvm-svn: 279159
Zhan Jun Liau [Thu, 18 Aug 2016 21:44:15 +0000 (21:44 +0000)]
[SystemZ] Use valid base/index regs for inline asm
Summary:
Inline asm memory constraints can have the base or index register be assigned
to %r0 right now. Make sure that we assign only ADDR64 registers to the base
and index.
Reviewers: uweigand
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D23367
llvm-svn: 279157
Tim Shen [Thu, 18 Aug 2016 21:41:24 +0000 (21:41 +0000)]
[Analysis] Change several Analysis pieces to use NodeRef. NFC.
Reviewers: dblaikie, grosser
Subscribers: mzolotukhin, llvm-commits
Differential Revision: https://reviews.llvm.org/D23625
llvm-svn: 279156
Chris Bieneman [Thu, 18 Aug 2016 21:41:21 +0000 (21:41 +0000)]
[CMake] Make llvm-config implicit dependency for subprojects
The subproject interface being used for runtime libraries expects that llvm-config is passed into the subproject for consumption. We currently do this for every subproject, so we should expect that all LLVM ExternalProjects depend on llvm-config for the time being.
Eventually I'd like to see the sub-projects using LLVMConfig.cmake instead of the llvm-config binary, but that will take time to roll out.
llvm-svn: 279155
Saleem Abdulrasool [Thu, 18 Aug 2016 21:40:06 +0000 (21:40 +0000)]
CodeGen: use range based for loop, NFC
llvm-svn: 279154
Chris Bieneman [Thu, 18 Aug 2016 21:36:36 +0000 (21:36 +0000)]
[CMake] Minor fix to regex in r279152
The third version component is optional in Xcode's version spew, so we need to make it optional in the regex.
llvm-svn: 279153
Chris Bieneman [Thu, 18 Aug 2016 21:32:48 +0000 (21:32 +0000)]
[CMake] Support for generating Xcode 8 compatible toolchains
Xcode 8 requires toolchain compatibility version 2. This allows us to select the correct compatibility version based on the installed version of Xcode.
llvm-svn: 279152
Chris Bieneman [Thu, 18 Aug 2016 21:31:51 +0000 (21:31 +0000)]
[CMake] Get libcxx building under LLVM/runtimes
Summary:
The new LLVM runtimes build directory requires some basic conventions across the runtime projects. These changes make libcxx build under the runtimes subdirectory. The general idea of the changes is that the runtimes subdirectory requires some conventions to be consistent across runtime projects.
I expect to have a few more small patches that build on this to tie up check targets and other things useful in development workflows.
Summary of changes in this patch:
* Renamed variable LLVM_CONFIG -> LLVM_CONFIG_PATH
* Renamed variable LIBCXX_BUILT_STANDALONE -> LIBCXX_STANDALONE_BUILD
* Add an include of AddLLVM in the tests subdirectory for add_lit_testsuite.
Reviewers: EricWF
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D23696
llvm-svn: 279151
Sanjay Patel [Thu, 18 Aug 2016 21:28:30 +0000 (21:28 +0000)]
[InstCombine] add helper function for folds of icmp (shl 1, Y), C; NFCI
Clean up the existing code by:
1. Renaming variables
2. Adding local variables
3. Making it vector-safe
This is still guarded by a ConstantInt check, so no functional change is intended.
But this should be ready to go: if we move the ConstantInt check down, all of
these folds should do the right thing for vector types.
llvm-svn: 279150
Jacques Pienaar [Thu, 18 Aug 2016 21:25:17 +0000 (21:25 +0000)]
[lanai] Add ISA document to CompilerWritersInfo
Summary: Add Lanai ISA document to CompilerWritersInfo.
Reviewers: eliben
Subscribers: aemerson, llvm-commits
Differential Revision: https://reviews.llvm.org/D23693
llvm-svn: 279149
Tom Stellard [Thu, 18 Aug 2016 21:21:53 +0000 (21:21 +0000)]
AMDGPU/SI: Fix a test in wqm.ll to always use s_cbranch_vcc*
Summary:
We need to use floating-point compares to ensure that s_cbranch_vcc*
instructions are always generated. With integer compares, future
optimizations could cause s_cbranch_scc* to be generated instead.
Reviewers: arsenm, nhaehnle
Subscribers: llvm-commits, kzhuravl
Differential Revision: https://reviews.llvm.org/D23401
llvm-svn: 279148
Cameron Desrochers [Thu, 18 Aug 2016 20:56:48 +0000 (20:56 +0000)]
Fixed more signed/unsigned mismatch warnings introduced in my change at r279076
llvm-svn: 279145
Kostya Serebryany [Thu, 18 Aug 2016 20:52:52 +0000 (20:52 +0000)]
[libFuzzer] add more __attribute__((visibility("default")))
llvm-svn: 279143
Amaury Sechet [Thu, 18 Aug 2016 20:43:50 +0000 (20:43 +0000)]
Make cltz and cttz zero undef when the operand cannot be zero in InstCombine
Summary: Also add popcount(n) == bitsize(n) -> n == -1 transformation.
Reviewers: majnemer, spatel
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D23134
llvm-svn: 279141
Justin Lebar [Thu, 18 Aug 2016 20:43:13 +0000 (20:43 +0000)]
[CUDA] Improve handling of math functions.
Summary:
A bunch of related changes here to our CUDA math headers.
- The second arg to nexttoward is a double (well, technically, long
double, but we don't have that), not a float.
- Add a forward-declare of llround(float), which is defined in the CUDA
headers. We need this for the same reason we need most of the other
forward-declares: To prevent a constexpr function in our standard
library from becoming host+device.
- Add nexttowardf implementation.
- Pull "foobarf" functions defined by the CUDA headers in the global
namespace into namespace std. This lets you do e.g. std::sinf.
- Add overloads for math functions accepting integer types. This lets
you do e.g. std::sin(0) without having an ambiguity between the
overload that takes a float and the one that takes a double.
With these changes, we pass testcases derived from libc++ for cmath and
math.h. We can check these testcases in to the test-suite once support
for CUDA lands there.
Reviewers: tra
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D23627
llvm-svn: 279140
Sanjay Patel [Thu, 18 Aug 2016 20:28:54 +0000 (20:28 +0000)]
[InstCombine] use m_APInt to allow icmp (trunc X, Y), C folds for splat constant vectors
This is a sibling of:
https://reviews.llvm.org/rL278859
https://reviews.llvm.org/rL278935
https://reviews.llvm.org/rL278945
https://reviews.llvm.org/rL279066
https://reviews.llvm.org/rL279077
https://reviews.llvm.org/rL279101
llvm-svn: 279133
Sanjay Patel [Thu, 18 Aug 2016 20:25:16 +0000 (20:25 +0000)]
[InstCombine] clean up foldICmpTruncConstant(); NFCI
1. Fix variable names
2. Add local variables to reduce code
llvm-svn: 279132
Michael Kuperstein [Thu, 18 Aug 2016 20:08:15 +0000 (20:08 +0000)]
[SelectionDAG] Rename fextend -> fpextend, fround -> fpround, frnd -> fround
The names of the tablegen defs now match the names of the ISD nodes.
This makes the world a slightly saner place, as previously "fround" matched
ISD::FP_ROUND and not ISD::FROUND.
Differential Revision: https://reviews.llvm.org/D23597
llvm-svn: 279129
Yaxun Liu [Thu, 18 Aug 2016 20:01:06 +0000 (20:01 +0000)]
Revert [OpenCL] AMDGCN: Fix size_t type
due to regressions in test/CodeGen/exprs.c on certain platforms.
llvm-svn: 279127
Wei Ding [Thu, 18 Aug 2016 19:51:14 +0000 (19:51 +0000)]
AMDGPU : Fix QSAD and MQSAD instructions' incorrect data type.
Differential Revision: http://reviews.llvm.org/D23689
llvm-svn: 279126
Matthew Simpson [Thu, 18 Aug 2016 19:50:32 +0000 (19:50 +0000)]
[SLP] Initialize VectorizedValue when gathering
We abort building vectorizable trees in some cases (e.g., if the maximum
recursion depth is reached, if the region size is too large, etc.). If this
happens for a reduction, we can be left with a root entry that needs to be
gathered. For these cases, we need make sure we actually set VectorizedValue to
the resulting vector.
This patch ensures we properly set VectorizedValue, and it also ensures the
insertelement sequence generated for the gathers is inserted at the correct
location.
Reference: https://llvm.org/bugs/show_bug.cgi?id=28330
Differential Revison: https://reviews.llvm.org/D23410
llvm-svn: 279125
Matthias Braun [Thu, 18 Aug 2016 19:47:59 +0000 (19:47 +0000)]
RegScavenging: Add scavengeRegisterBackwards()
Re-apply r276044 with off-by-1 instruction fix for the reload placement.
This is a variant of scavengeRegister() that works for
enterBasicBlockEnd()/backward(). The benefit of the backward mode is
that it is not affected by incomplete kill flags.
This patch also changes
PrologEpilogInserter::doScavengeFrameVirtualRegs() to use the register
scavenger in backwards mode.
Differential Revision: http://reviews.llvm.org/D21885
llvm-svn: 279124
Zachary Turner [Thu, 18 Aug 2016 19:42:00 +0000 (19:42 +0000)]
Fix json compilation database syntax on non-Windows.
llvm-svn: 279122
Yaxun Liu [Thu, 18 Aug 2016 19:34:04 +0000 (19:34 +0000)]
[OpenCL] AMDGCN: Fix size_t type
Pointers of certain GPUs in AMDGCN target in private address space is 32 bit but pointers in other address spaces are 64 bit. size_t type should be defined as 64 bit for these GPUs so that it could hold pointers in all address spaces. Also fixed issues in pointer arithmetic codegen by using pointer specific intptr type.
Differential Revision: https://reviews.llvm.org/D23361
llvm-svn: 279121
Zachary Turner [Thu, 18 Aug 2016 19:31:48 +0000 (19:31 +0000)]
Resubmit "[Tooling] Parse compilation database command lines on Windows."
This patch introduced the ability to decide at runtime whether to parse
JSON compilation database command lines using Gnu syntax or Windows
syntax. However, there were many existing unit tests written that
hardcoded Gnu-specific paths. These tests were now failing because
the auto-detection logic was choosing to parse them using Windows
rules.
This resubmission of the patch fixes this by introducing an enum
which defines the syntax mode, which defaults to auto-detect, but
for which the unit tests force Gnu style parsing.
Reviewed By: alexfh
Differential Revision: https://reviews.llvm.org/D23628
llvm-svn: 279120
Simon Atanasyan [Thu, 18 Aug 2016 19:08:41 +0000 (19:08 +0000)]
[ELF][MIPS] Support R_MIPS_GOT_HI16 / R_MIPS_GOT_LO16 relocations calculation
llvm-svn: 279119
Simon Atanasyan [Thu, 18 Aug 2016 19:08:36 +0000 (19:08 +0000)]
[ELF][MIPS] Support R_MIPS_CALL_HI16 / R_MIPS_CALL_LO16 relocations calculation
llvm-svn: 279118
Kyle Butt [Thu, 18 Aug 2016 18:57:29 +0000 (18:57 +0000)]
Branch Folding: Accept explicit threshold for tail merge size.
This is prep work for allowing the threshold to be different during layout,
and to enforce a single threshold between merging and duplicating during
layout. No observable change intended.
llvm-svn: 279117
Reid Kleckner [Thu, 18 Aug 2016 18:45:07 +0000 (18:45 +0000)]
[MS] Silence -Wextern-init on const selectany variables
In C, 'extern' is typically used to avoid tentative definitions when
declaring variables in headers, but adding an intializer makes it a
defintion. This is somewhat confusing, so GCC and Clang both warn on it.
In C++, 'extern' is often used to give implictly static 'const'
variables external linkage, so don't warn in that case. If selectany is
present, this might be header code intended for C and C++ inclusion, so
apply the C++ rules.
llvm-svn: 279116
Alexander Kornienko [Thu, 18 Aug 2016 18:43:47 +0000 (18:43 +0000)]
[clang-tidy docs] Move option descriptions to the Options section
+ random fixes
llvm-svn: 279115
Cameron Desrochers [Thu, 18 Aug 2016 18:41:41 +0000 (18:41 +0000)]
Removed use of 'emplace' on std::map, since not all buildbot slaves support it
llvm-svn: 279114
Pete Cooper [Thu, 18 Aug 2016 18:30:54 +0000 (18:30 +0000)]
Add a version of Intrinsic::getName which is more efficient when there are no overloads.
When running 'opt -O2 verify-uselistorder-nodbg.lto.bc', there are 33m allocations. 8.2m
come from std::string allocations in Intrinsic::getName(). Turns out this method only
returns a std::string because it needs to handle overloads, but that is not the common case.
This adds an overload of getName which just returns a StringRef when there are no overloads
and so saves on the allocations.
llvm-svn: 279113
Richard Smith [Thu, 18 Aug 2016 18:22:22 +0000 (18:22 +0000)]
Use __has_include rather than a configure-time macro to determine if
<sys/resource.h> is available. This should fix out-of-tree builds, at the cost
of not providing the higher rlimits to stage 1 clang when built with an old
host compiler not implementing this feature yet (bootstrap builds should be
fine, though).
llvm-svn: 279112
Simon Pilgrim [Thu, 18 Aug 2016 18:19:28 +0000 (18:19 +0000)]
[X86][SSE] Missed insertps shuffle patterns
llvm-svn: 279111
Chris Bieneman [Thu, 18 Aug 2016 18:17:28 +0000 (18:17 +0000)]
[CMake] Silence message on multi-configuration generators
The Xcode and Visual Studio generators always log "-- No build type selected, default to Debug". This is because CMake doesn't initialize "CMAKE_CONFIGURATION_TYPES" until the generator's EnableLanguage call gets hit.
The first place EnableLanguage gets hit in our configuration is in the project() call. Since CMAKE_BUILD_TYPE isn't used until after we call project() it is safe to just move this check down a bit.
llvm-svn: 279110
Vitaly Buka [Thu, 18 Aug 2016 18:17:19 +0000 (18:17 +0000)]
[asan] Extend test
Summary: PR27453
Reviewers: eugenis
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D23647
llvm-svn: 279109
Vitaly Buka [Thu, 18 Aug 2016 18:15:15 +0000 (18:15 +0000)]
[asan] Add one more test for __asan_set_shadow_*
Reviewers: eugenis, filcab
Subscribers: llvm-commits, kubabrecka
Differential Revision: https://reviews.llvm.org/D23676
llvm-svn: 279108
Valery Pykhtin [Thu, 18 Aug 2016 18:06:20 +0000 (18:06 +0000)]
[AMDGPU] add s_incperflevel/s_decperflevel intrinsics.
Differential revision: https://reviews.llvm.org/D23666
llvm-svn: 279106
Elliot Colp [Thu, 18 Aug 2016 18:04:26 +0000 (18:04 +0000)]
Fix SystemZ compilation abort caused by negative AND mask
Normally, when an AND with a constant is lowered to NILL, the constant value is truncated to 16 bits. However, since r274066, ANDs whose results are used in a shift are caught by a different pattern that does not truncate. The instruction printer expects a 16-bit unsigned immediate operand for NILL, so this results in an abort.
This patch adds code to manually truncate the constant in this situation. The rest of the bits are then set, so we will detect a case for NILL "naturally" rather than using peephole optimizations.
Differential Revision: http://reviews.llvm.org/D21854
llvm-svn: 279105
Duncan P. N. Exon Smith [Thu, 18 Aug 2016 17:58:09 +0000 (17:58 +0000)]
AArch64: Don't call getIterator() on iterators
Remove an unnecessary round-trip:
iterator => operator->() => getIterator()
In some cases, the iterator is end(), so the dereference of operator->
is invalid (UB).
The testcase only crashes with r278974 (currently reverted to
investigate this), which adds an assertion for invalid dereferences of
ilist nodes.
Fixes PR29035.
llvm-svn: 279104
Eugene Zelenko [Thu, 18 Aug 2016 17:56:27 +0000 (17:56 +0000)]
[LLVM] Fix some Clang-tidy modernize-use-using and Include What You Use warnings
Differential revision: https://reviews.llvm.org/D23675
llvm-svn: 279102
Sanjay Patel [Thu, 18 Aug 2016 17:55:59 +0000 (17:55 +0000)]
[InstCombine] use m_APInt to allow icmp (udiv X, Y), C folds for splat constant vectors
This is a sibling of:
https://reviews.llvm.org/rL278859
https://reviews.llvm.org/rL278935
https://reviews.llvm.org/rL278945
https://reviews.llvm.org/rL279066
https://reviews.llvm.org/rL279077
llvm-svn: 279101
Dan Gohman [Thu, 18 Aug 2016 17:51:27 +0000 (17:51 +0000)]
[WebAssembly] Disable the store-results optimization.
The WebAssemly spec removing the return value from store instructions, so
remove the associated optimization from LLVM.
This patch leaves the store instruction operands in place for now, so stores
now always write to "$drop"; these will be removed in a seperate patch.
llvm-svn: 279100
Chandler Carruth [Thu, 18 Aug 2016 17:51:24 +0000 (17:51 +0000)]
[Assumptions] Make collecting ephemeral values not quadratic in the
number of assume intrinsics.
The classical way to have a cache-friendly vector style container when
we need queue semantics for BFS instead of stack semantics for DFS is to
use an ever-growing vector and an index. Erasing from the front requires
O(size) work, and unless we expect the worklist to grow *very* large,
its probably cheaper to just grow and race down the list.
But that makes it more bad that we're putting the assume intrinsics in
this at all. We end up looking at the (by definition empty) use list to
see if they're ephemeral (when we've already put them in that set), etc.
Instead, directly populate the worklist with the operands when we mark
the assume intrinsics as ephemeral. Also, test the visited set *before*
putting things into the worklist so we don't accumulate the same value
in the list 100s of times.
It would be nice to use a set-vector for this but I think its useful to
test the set earlier to avoid repeatedly querying whether the same
instruction is safe to speculate.
Hopefully with these changes the number of values pushed onto the
worklist is smaller, and we avoid quadratic work by letting it grow as
necessary.
Differential Revision: https://reviews.llvm.org/D23396
llvm-svn: 279099
Sean Callanan [Thu, 18 Aug 2016 17:45:50 +0000 (17:45 +0000)]
Fixed a problem where we failed to get the size of an Objective-C type.
<rdar://problem/
27897056>
llvm-svn: 279098
Vedant Kumar [Thu, 18 Aug 2016 17:43:02 +0000 (17:43 +0000)]
Revert "[Driver] Use llvm-config.h, not config.h to unbreak out-of-tree builds"
This reverts commit r279035. According to Richard Smith, llvm-config.h
does not contain the right definitions.
llvm-svn: 279097
Manman Ren [Thu, 18 Aug 2016 17:42:15 +0000 (17:42 +0000)]
Module: add -fprebuilt-module-path to support loading prebuilt modules.
In this mode, there is no need to load any module map and the programmer can
simply use "@import" syntax to load the module directly from a prebuilt
module path. When loading from prebuilt module path, we don't support
rebuilding of the module files and we ignore compatible configuration
mismatches.
rdar://
27290316
Differential Revision: http://reviews.llvm.org/D23125
llvm-svn: 279096
Vedant Kumar [Thu, 18 Aug 2016 17:39:53 +0000 (17:39 +0000)]
Fix -Wpessimizing-move error, NFC
llvm-svn: 279095
Sanjay Patel [Thu, 18 Aug 2016 17:37:26 +0000 (17:37 +0000)]
[InstCombine] clean up foldICmpUDivConstant; NFC
1. Better variable names
2. Remove unnecessary check of ConstantInt
llvm-svn: 279094
Cameron Desrochers [Thu, 18 Aug 2016 17:18:03 +0000 (17:18 +0000)]
[libclang] Added missing entry for newly introduced 'clang_getAllSkippedRanges' to libclang.exports
llvm-svn: 279092
Duncan P. N. Exon Smith [Thu, 18 Aug 2016 17:15:25 +0000 (17:15 +0000)]
Reapply "ADT: Remove references in has_rbegin for reverse()"
This reverts commit r279086, reapplying r279084. I'm not sure what I
ran before, because the compile failure for ADTTests reproduced locally.
The problem is that TestRev is calling BidirectionalVector::rbegin()
when the BidirectionalVector is const, but rbegin() is always non-const.
I've updated BidirectionalVector::rbegin() to be callable from const.
Original commit message follows.
--
As a follow-up to r278991, add some tests that check that
decltype(reverse(R).begin()) == decltype(R.rbegin()), and get them
passing by adding std::remove_reference to has_rbegin.
I'm using static_assert instead of EXPECT_TRUE (and updated the other
has_rbegin check from r278991 in the same way) since I figure that's
more helpful.
llvm-svn: 279091
Chris Bieneman [Thu, 18 Aug 2016 17:10:55 +0000 (17:10 +0000)]
[CMake] Stop building eprintf library on Darwin
In r278988 clang stopped using the eprintf library, so we should stop generating it too.
llvm-svn: 279090
Zachary Turner [Thu, 18 Aug 2016 16:49:29 +0000 (16:49 +0000)]
Resubmit "Write the TPI stream from a PDB to Yaml."
The original patch was breaking some buildbots due to an
incorrect ordering of function definitions which caused some
compilers to recognize a definition but others to not.
llvm-svn: 279089
Saleem Abdulrasool [Thu, 18 Aug 2016 16:39:19 +0000 (16:39 +0000)]
llvm-objdump: add coff import library symbol listing support
This adds behaviour similar to binutils' objdump which can show symbols in an
import library. Differences from that stem around the fact that we do not
create section symbols nor the all import import descriptor symbol reference.
However, this does mean that the tool can serve as a possible replacement for
the existing tool.
llvm-svn: 279088
Eli Friedman [Thu, 18 Aug 2016 16:30:42 +0000 (16:30 +0000)]
[SCEVValidator] Don't reorder multiplies in extractConstantFactor.
The existing code would add the operands in the wrong order, and eventually
crash because the SCEV expression doesn't exactly match the parameter SCEV
expression in SCEVAffinator::visit. (SCEV doesn't sort the operands to
getMulExpr in general.)
Differential Revision: https://reviews.llvm.org/D23592
llvm-svn: 279087
Duncan P. N. Exon Smith [Thu, 18 Aug 2016 16:27:41 +0000 (16:27 +0000)]
Revert "ADT: Remove references in has_rbegin for reverse()"
This reverts commit r279084, since it failed on a bot:
http://bb.pgr.jp/builders/cmake-llvm-x86_64-linux/builds/41733
llvm-svn: 279086
Cameron Desrochers [Thu, 18 Aug 2016 16:25:42 +0000 (16:25 +0000)]
[libclang] Fixed signed/unsigned comparison warning introduced in my revision r279076
llvm-svn: 279085
Duncan P. N. Exon Smith [Thu, 18 Aug 2016 16:22:54 +0000 (16:22 +0000)]
ADT: Remove references in has_rbegin for reverse()
As a follow-up to r278991, add some tests that check that
decltype(reverse(R).begin()) == decltype(R.rbegin()), and get them
passing by adding std::remove_reference to has_rbegin.
I'm using static_assert instead of EXPECT_TRUE (and updated the other
has_rbegin check from r278991 in the same way) since I figure that's
more helpful.
llvm-svn: 279084
Artur Pilipenko [Thu, 18 Aug 2016 16:08:35 +0000 (16:08 +0000)]
CVP. Turn marking adds as no wrap (introduced by r278107) off by default
It causes a regression on our internal benchmark. Introduce cvp-dont-process flag and set it off by default while investigating the regression.
llvm-svn: 279082
Ahmed Bougacha [Thu, 18 Aug 2016 16:05:11 +0000 (16:05 +0000)]
[AArch64][GlobalISel] Select floating-point binary ops.
There is no FREM instruction, but the others are straightforward.
llvm-svn: 279081
Ahmed Bougacha [Thu, 18 Aug 2016 16:05:06 +0000 (16:05 +0000)]
[GlobalISel] Add floating-point binary ops.
llvm-svn: 279080
Davide Italiano [Thu, 18 Aug 2016 15:55:49 +0000 (15:55 +0000)]
[IRCE] Switch over to LLVM_DUMP_METHOD. NFCI.
llvm-svn: 279079
Richard Barton [Thu, 18 Aug 2016 15:50:11 +0000 (15:50 +0000)]
[ARM] Correct ARMv8*-A optional extension definitions in TargetParser
The ARMv8*-A descriptions in the ARM and AArch64 TargetParsers are incorrect
architecturally and mismatched to the backend descriptions.
RAS is an optional extension to ARMv8-A and ARMv8.1-A and mandatory in
ARMv8.2-A. Correct the ARMTargetParser descriptions which had this as enabled
by default in the earlier versions.
The FP16 and SPE extensions are optional in ARMv8.2-A and the backend defaults
them as off. They are not available as extensions to earlier ARMv8-A versions.
Correct the AArch64TargetParser which had these as enabled by default in all
ARMv8-A definitions.
These macros are only used to define preprocessor macros. There are no macros
yet as ACLE has not caught up with ARMv8.2-A so not possible to add a test.
Differential Revision: https://reviews.llvm.org/D23500
llvm-svn: 279078
Sanjay Patel [Thu, 18 Aug 2016 15:44:44 +0000 (15:44 +0000)]
[InstCombine] use m_APInt to allow icmp (mul X, Y), C folds for splat constant vectors
This is a sibling of:
https://reviews.llvm.org/rL278859
https://reviews.llvm.org/rL278935
https://reviews.llvm.org/rL278945
https://reviews.llvm.org/rL279066
llvm-svn: 279077
Cameron Desrochers [Thu, 18 Aug 2016 15:43:55 +0000 (15:43 +0000)]
[libclang] Add clang_getAllSkippedRanges function
This complements the clang_getSkippedRanges function which returns skipped ranges filtered by a specific file.
This function is useful when all the ranges are desired (and a lot more efficient than the equivalent of asking for the ranges file by file, since the implementation of clang_getSkippedRanges iterates over all ranges anyway).
Differential Revision: https://reviews.llvm.org/D20132
llvm-svn: 279076
Derek Schuff [Thu, 18 Aug 2016 15:27:25 +0000 (15:27 +0000)]
[WebAssembly] Refactor WebAssemblyLowerEmscriptenException pass for setjmp/longjmp
This patch changes the code structure of
WebAssemblyLowerEmscriptenException pass to support both exception
handling and setjmp/longjmp. It also changes the name of the pass and
the source file.
1. Change the file/pass name to WebAssemblyLowerEmscriptenExceptions ->
WebAssemblyLowerEmscriptenEHSjLj to make it clear that it supports both
EH and SjLj
2. List function / global variable names at the top so they
can be changed easily
3. Some cosmetic changes
Patch by Heejin Ahn
Differential Revision: https://reviews.llvm.org/D23588
llvm-svn: 279075
Ahmed Bougacha [Thu, 18 Aug 2016 15:17:13 +0000 (15:17 +0000)]
[AArch64][GlobalISel] Select G_SDIV/G_UDIV.
There is no REM instruction; that will require an expansion.
It's not obvious that should be done in select, rather than as a
(custom?) legalization.
llvm-svn: 279074
Ahmed Bougacha [Thu, 18 Aug 2016 15:17:01 +0000 (15:17 +0000)]
[GlobalISel] Add support for DIV/REM.
llvm-svn: 279073
Sanjay Patel [Thu, 18 Aug 2016 14:59:14 +0000 (14:59 +0000)]
[InstCombine] use APInt in isSignTest instead of ConstantInt; NFC
This will enable vector splat folding, but NFC until the callers
have their ConstantInt restrictions removed.
llvm-svn: 279072
Oleg Ranevskyy [Thu, 18 Aug 2016 14:39:39 +0000 (14:39 +0000)]
[compiler-rt][tests] cpu_model_test.c test fails to compile if X86 is not clang's default target
Summary:
test/builtins/Unit/cpu_model_test.c tests the X86 specific builtin `__builtin_cpu_supports`.
It fails if the clang's default target is not X86.
The proposed patch adds an additional requirement for the X86 target to the test, making lit ignore the test if the target is different.
Reviewers: asbirlea
Subscribers: dberris, llvm-commits
Differential Revision: https://reviews.llvm.org/D23633
llvm-svn: 279071