Sanjay Patel [Tue, 23 Feb 2016 16:36:07 +0000 (16:36 +0000)]
[InstCombine] add helper function to foldCastedBitwiseLogic() ; NFCI
This is a straight cut and paste of the existing code and is intended to
be the first step in solving part of PR26702:
https://llvm.org/bugs/show_bug.cgi?id=26702
We should be able to reuse most of this and delete the nearly identical
existing code in visitOr(). Then, we can enhance visitXor() to use the
same code too.
llvm-svn: 261649
Marshall Clow [Tue, 23 Feb 2016 16:25:20 +0000 (16:25 +0000)]
Add additional tests to ensure that we DTRT with short lists. This is LWG#2590, but there are no code changes, just additional tests
llvm-svn: 261648
Marshall Clow [Tue, 23 Feb 2016 16:20:24 +0000 (16:20 +0000)]
More updates; patch for 2583 ready
llvm-svn: 261647
Alexander Kornienko [Tue, 23 Feb 2016 16:12:08 +0000 (16:12 +0000)]
Fix a typo. NFC
llvm-svn: 261646
Alexander Kornienko [Tue, 23 Feb 2016 16:12:00 +0000 (16:12 +0000)]
Clean up clang-format options documentation. NFC
Use uniform style for inline code blocks, specify language for YAML code blocks,
various formatting fixes etc.
llvm-svn: 261645
Alexander Kornienko [Tue, 23 Feb 2016 16:11:55 +0000 (16:11 +0000)]
Support language selection for \code blocks.
llvm-svn: 261644
Alexander Kornienko [Tue, 23 Feb 2016 16:11:51 +0000 (16:11 +0000)]
Update clang-format options docs.
llvm-svn: 261643
Alexander Kornienko [Tue, 23 Feb 2016 16:11:43 +0000 (16:11 +0000)]
Allow running dump_format_style.py from any directory.
llvm-svn: 261642
Michael Zuckerman [Tue, 23 Feb 2016 15:59:47 +0000 (15:59 +0000)]
[CLANG] [AVX512] [BUILTIN] Adding prorv{d|q}{128|256|512} builtin to clang
Differential Revision: http://reviews.llvm.org/D17512
llvm-svn: 261641
Aaron Ballman [Tue, 23 Feb 2016 15:02:43 +0000 (15:02 +0000)]
Silencing a signed vs unsigned mismatch.
llvm-svn: 261640
Aaron Watry [Tue, 23 Feb 2016 14:43:09 +0000 (14:43 +0000)]
math: Add ilogb ported from amd-builtins
The scalar float/double function bodies are a direct copy/paste
with usage of the CLC wrappers to vectorize them.
This commit also adds in the FP_ILOGB0 and FP_ILOGBNAN macros which are
equal to the results of ilogb(0.0f) and ilogb(float nan) respectively.
v2: Add FP_ILOGB0 and FP_ILOGBNAN definitions
Signed-off-by: Aaron Watry <awatry@gmail.com>
Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu>
v1 Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 261639
Michael Zuckerman [Tue, 23 Feb 2016 14:23:53 +0000 (14:23 +0000)]
[CLANG] [AVX512] [BUILTIN] Adding pro{lv|r}{d|q}{128|256|512} builtin to clang
Adding closer to the end of macro }->})
Differential Revision: http://reviews.llvm.org/D17506
llvm-svn: 261638
Chad Rosier [Tue, 23 Feb 2016 14:05:13 +0000 (14:05 +0000)]
[AArch64] Fix comment typo in Cyclone scheduling defs. NFC.
llvm-svn: 261637
Pavel Labath [Tue, 23 Feb 2016 13:56:30 +0000 (13:56 +0000)]
Work around a stepping bug in arm64 android M
Summary:
On arm64, linux<=4.4 and Android<=M there is a bug, which prevents single-stepping from working when
the system comes back from suspend, because of incorrectly initialized CPUs. This did not really
affect Android<M, because it did not use software suspend, but it is a problem for M, which uses
suspend (doze) quite extensively. Fortunately, it seems that the first CPU is not affected by
this bug, so this commit implements a workaround by forcing the inferior to execute on the first
cpu whenever we are doing single stepping.
While inside, I have moved the implementations of Resume() and SingleStep() to the thread class
(instead of process).
Reviewers: tberghammer, ovyalov
Subscribers: aemerson, rengolin, tberghammer, danalbert, srhines, lldb-commits
Differential Revision: http://reviews.llvm.org/D17509
llvm-svn: 261636
Michael Zuckerman [Tue, 23 Feb 2016 13:41:13 +0000 (13:41 +0000)]
[CLANG] [AVX512] [BUILTIN] Adding pro{lv|r}{d|q}{128|256|512} builtin to clang
Differential Revision: http://reviews.llvm.org/D17506
llvm-svn: 261635
Amjad Aboud [Tue, 23 Feb 2016 13:37:18 +0000 (13:37 +0000)]
Supporting all entities declared in lexical scope in LLVM debug info.
Differential Revision: http://reviews.llvm.org/D15977
llvm-svn: 261634
Amjad Aboud [Tue, 23 Feb 2016 13:36:51 +0000 (13:36 +0000)]
Supporting all entities declared in lexical scope in LLVM debug info.
Differential Revision: http://reviews.llvm.org/D15976
llvm-svn: 261633
Gabor Horvath [Tue, 23 Feb 2016 12:34:39 +0000 (12:34 +0000)]
[analyzer] Improve pointer arithmetic checker.
This patch is intended to improve pointer arithmetic checker.
From now on it only warns when the pointer arithmetic is likely to cause an
error. For example when the pointer points to a single object, or an array of
derived types.
Differential Revision: http://reviews.llvm.org/D14203
llvm-svn: 261632
Pavel Labath [Tue, 23 Feb 2016 12:26:08 +0000 (12:26 +0000)]
[linux] Remove all traces of signalfd(2)
Summary:
Signalfd is not used in the code anymore, and given that the same functionality can be achieved
with the new MainLoop class, it's unlikely we will need it in the future. Remove all traces of
it.
Reviewers: tberghammer, ovyalov
Subscribers: tberghammer, danalbert, srhines, lldb-commits
Differential Revision: http://reviews.llvm.org/D17510
llvm-svn: 261631
Tamas Berghammer [Tue, 23 Feb 2016 11:35:38 +0000 (11:35 +0000)]
XFAIL TestInlines for Linux with gcc
llvm-svn: 261630
Alexander Kornienko [Tue, 23 Feb 2016 11:19:56 +0000 (11:19 +0000)]
Remove a space after a trailing backslash.
llvm-svn: 261629
Sylvestre Ledru [Tue, 23 Feb 2016 11:17:27 +0000 (11:17 +0000)]
fix the indentation of the example
llvm-svn: 261628
Chandler Carruth [Tue, 23 Feb 2016 10:47:57 +0000 (10:47 +0000)]
[PM] Remove an overly aggressive assert now that I can actually test the
pattern that triggers it. This essentially requires an immutable
function analysis, as that will survive anything we do to invalidate it.
When we have such patterns, the function analysis manager will not get
cleared between runs of the proxy.
If we actually need an assert about how things are queried, we can add
more elaborate machinery for computing it, but so far I'm not aware of
significant value provided.
Thanks to Justin Lebar for noticing this when he made a (seemingly
innocuous) change to FunctionAttrs that is enough to trigger it in one
test there. Now it is covered by a direct test of the pass manager code.
llvm-svn: 261627
Alexander Kornienko [Tue, 23 Feb 2016 10:29:04 +0000 (10:29 +0000)]
Fix a -Wunused-variable diagnostic.
llvm-svn: 261626
Alexander Kornienko [Tue, 23 Feb 2016 10:29:02 +0000 (10:29 +0000)]
Print options, if requested.
llvm-svn: 261625
Chandler Carruth [Tue, 23 Feb 2016 10:02:02 +0000 (10:02 +0000)]
[PM] Add a unittest for the CGSCC pass manager in the new pass manager
system.
Previously, this was only being tested with larger integration tests.
That makes it hard to isolated specific issues with it, and makes the
APIs themselves less well tested. Add a unittest based around the same
patterns used for testing the general pass manager.
llvm-svn: 261624
Junmo Park [Tue, 23 Feb 2016 09:56:58 +0000 (09:56 +0000)]
[ARM] fix initialization of PredictableSelectIsExpensive
Summary:
If we want classify OoO or not, using getSchedModel().isOutOfOrder()
could be more proper way than using Subtarget->isLikeA9().
Reviewers: jmolloy, rengolin
Differential Revision: http://reviews.llvm.org/D17433
llvm-svn: 261623
Alexander Kornienko [Tue, 23 Feb 2016 09:30:20 +0000 (09:30 +0000)]
[clang-tidy] Updated docs on testing clang-tidy checks.
llvm-svn: 261622
Nikolay Haustov [Tue, 23 Feb 2016 09:19:14 +0000 (09:19 +0000)]
[AMDGPU] Fix operands of S_BFE_U64 and S_BFM_B64
src1 of s_bfe_u64 is 32-bit (same as s_bfe_i64).
src0 and src1 of s_bfm_b64 are 32-bit.
Update tests.
Review: http://reviews.llvm.org/D17480
Reviewers: arsenm
llvm-svn: 261621
Roman Gareev [Tue, 23 Feb 2016 09:00:13 +0000 (09:00 +0000)]
Annotation of SIMD loops
Use 'mark' nodes annotate a SIMD loop during ScheduleTransformation and skip
parallelism checks.
The buildbot shows the following compile/execution time changes:
Compile time:
Improvements Δ Previous Current σ
…/gesummv -6.06% 0.2640 0.2480 0.0055
…/gemver -4.46% 0.4480 0.4280 0.0044
…/covariance -4.31% 0.8360 0.8000 0.0065
…/adi -3.23% 0.9920 0.9600 0.0065
…/doitgen -2.53% 0.9480 0.9240 0.0090
…/3mm -2.33% 1.0320 1.0080 0.0087
Execution time:
Regressions Δ Previous Current σ
…/viterbi 1.70% 5.1840 5.2720 0.0074
…/smallpt 1.06% 12.4920 12.6240 0.0040
Reviewed-by: Tobias Grosser <tobias@grosser.es>
Differential Revision: http://reviews.llvm.org/D14491
llvm-svn: 261620
Igor Breger [Tue, 23 Feb 2016 08:55:33 +0000 (08:55 +0000)]
AVX512: Fix predicate of AVX pcmpeqw/b , pcmpgtb/w/d instructions . AVX512 version of this instructions return result in kmask register, so AVX patterns should not be disabled.
Differential Revision: http://reviews.llvm.org/D17517
llvm-svn: 261619
Marina Yatsina [Tue, 23 Feb 2016 08:53:45 +0000 (08:53 +0000)]
[ms-inline-asm] Fixing bug in single asm statement support
Fixing a crash caused by trying to merge a single-line asm statement with an asm block that follows it, e.g:
asm int 4
asm {
int 5
}
Now, only adjacent single-line asm statements that are not surrounded by braces will be merged into one asm call.
Differential Revision: http://reviews.llvm.org/D17496
llvm-svn: 261618
Simon Atanasyan [Tue, 23 Feb 2016 08:34:18 +0000 (08:34 +0000)]
[ELF][MIPS] Rename test case. NFC
llvm-svn: 261617
George Rimar [Tue, 23 Feb 2016 07:47:54 +0000 (07:47 +0000)]
[ELF] - Linkerscript KEEP command.
When link-time garbage collection is in use (-gc-sections), it is
often useful to mark sections that should not be eliminated.
This is accomplished by surrounding an input section's wildcard
entry with KEEP(). Patch implements that command.
Differential revision: http://reviews.llvm.org/D17242
llvm-svn: 261616
David Majnemer [Tue, 23 Feb 2016 07:18:15 +0000 (07:18 +0000)]
[WinEH] Visit 'unwind to caller' catchswitches nested in catchswitches
We had the right logic for the nested cleanuppad case but omitted it for
catchswitches.
llvm-svn: 261615
Yaron Keren [Tue, 23 Feb 2016 07:17:58 +0000 (07:17 +0000)]
Assert when trying to seek un-seekable raw_fd_ostream.
llvm-svn: 261614
Bruno Cardoso Lopes [Tue, 23 Feb 2016 07:06:12 +0000 (07:06 +0000)]
Revert "[VFS] Add 'overlay-relative' field to YAML files" and "[VFS] Fix call to getVFSFromYAML in unittests"
This reverts commit r261552 and r261556 because of failing unittests on
windows:
Failing Tests (4):
Clang-Unit :: Basic/BasicTests.exe/VFSFromYAMLTest.CaseInsensitive
Clang-Unit :: Basic/BasicTests.exe/VFSFromYAMLTest.DirectoryIteration
Clang-Unit :: Basic/BasicTests.exe/VFSFromYAMLTest.MappedFiles
Clang-Unit :: Basic/BasicTests.exe/VFSFromYAMLTest.UseExternalName
llvm-svn: 261613
Saleem Abdulrasool [Tue, 23 Feb 2016 04:56:31 +0000 (04:56 +0000)]
RenderScript: silence some -Wmissing-brace warnings
Silence some -Wmissing-brace warnings on Linux with clang 3.7.
llvm-svn: 261612
Alexey Samsonov [Tue, 23 Feb 2016 04:10:53 +0000 (04:10 +0000)]
[tests] Run test that uses gnu asm syntax on Posix only.
llvm-svn: 261609
Dehao Chen [Tue, 23 Feb 2016 03:39:24 +0000 (03:39 +0000)]
Add prefix based function layout when profile is available.
Summary: If a function is hot, put it in text.hot section.
Reviewers: davidxl
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D17532
llvm-svn: 261607
Rui Ueyama [Tue, 23 Feb 2016 03:34:37 +0000 (03:34 +0000)]
Use TinyPtrVector<Ty *> instead of SmallVector<Ty *, 1>.
Thanks to Sean Silva for the suggestion.
llvm-svn: 261606
Duncan P. N. Exon Smith [Tue, 23 Feb 2016 02:46:52 +0000 (02:46 +0000)]
CodeGen: TII: Take MachineInstr& in predicate API, NFC
Change TargetInstrInfo API to take `MachineInstr&` instead of
`MachineInstr*` in the functions related to predicated instructions
(I'll try to come back later and get some of the rest). All of these
functions require non-null parameters already, so references are more
clear. As a bonus, this happens to factor away a host of implicit
iterator => pointer conversions.
No functionality change intended.
llvm-svn: 261605
Duncan P. N. Exon Smith [Tue, 23 Feb 2016 02:28:40 +0000 (02:28 +0000)]
Revert "Add prefix based function layout when profile is available."
This reverts commit r261582, since this bot has been broken for four
hours:
http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental_check/19399/
llvm-svn: 261604
Alexey Samsonov [Tue, 23 Feb 2016 01:58:56 +0000 (01:58 +0000)]
[tests] Remove "supported-target" in favor of "target-arch" lit features.
Test cases definitely should not care about the complete set of architectures
supported by compiler-rt - they should only care about current
architecture that the test suite was configured for.
Introduce new lit feature to reflect this, and convert tests to use it.
llvm-svn: 261603
Eugene Zelenko [Tue, 23 Feb 2016 01:43:44 +0000 (01:43 +0000)]
Fix Clang-tidy modernize-use-nullptr and modernize-use-default warnings in some files in source/Commands; other minor fixes.
llvm-svn: 261602
Alexey Samsonov [Tue, 23 Feb 2016 01:34:17 +0000 (01:34 +0000)]
[tests] Always specify correct config.target_arch when configuring test suite.
llvm-svn: 261601
Michael Zolotukhin [Tue, 23 Feb 2016 00:57:48 +0000 (00:57 +0000)]
Follow up for r261597: Add the * to the auto.
llvm-svn: 261600
Sean Callanan [Tue, 23 Feb 2016 00:52:34 +0000 (00:52 +0000)]
Actually commit the test for r261598.
llvm-svn: 261599
Sean Callanan [Tue, 23 Feb 2016 00:51:52 +0000 (00:51 +0000)]
Fixed a problem where the DWARF for inline functions was mis-parsed.
Inline functions in DWARF have AT_abstract_origin set, but we only handled that
if the functions were C++ methods. Inline functions -- C or C++ -- have this
also, and as a result they got one FunctionDecl for each inlined instance. When
going to construct the locals, this meant that the arguments (which did properly
have their abstract origins handled) would get associated with the master
FunctionDecl, and the inlined FunctionDecls would all appear to have no locals.
This manifested as not being able to look up local variables when stopped in an
inline fuunction. We should have had a test for this, but somewhere along the
line the relevant test case lost its .py file (or it never had one).
This patch fixes this problem and restores the .py file.
<rdar://problem/
24712434>
llvm-svn: 261598
Michael Zolotukhin [Tue, 23 Feb 2016 00:48:44 +0000 (00:48 +0000)]
Follow-up for r261595: use range loop.
llvm-svn: 261597
Duncan P. N. Exon Smith [Tue, 23 Feb 2016 00:48:16 +0000 (00:48 +0000)]
Lex: Return "" when HeaderMap::lookupFilename fails
Change getString() to return Optional<StringRef>, and change
lookupFilename() to return an empty string if either one of the prefix
and suffix can't be found.
This is a more robust follow-up to r261461, but it's still not entirely
satisfactory. Ideally we'd report that the header map is corrupt;
perhaps something for a follow-up.
llvm-svn: 261596
Michael Zolotukhin [Tue, 23 Feb 2016 00:30:50 +0000 (00:30 +0000)]
[LoopUnroll] Avoid unnecessary DT recomputation.
Summary:
When we completely unroll a loop, it's pretty easy to update DT in-place and
thus avoid rebuilding it. DT recalculation is one of the most time-consuming
tasks in loop-unroll, so avoiding it at least in case of full unroll should be
beneficial.
On some extreme (but still real-world) tests this patch improves compile time by
~2x.
Reviewers: escha, jmolloy, hfinkel, sanjoy, chandlerc
Subscribers: joker.eph, sanjoy, llvm-commits
Differential Revision: http://reviews.llvm.org/D17473
llvm-svn: 261595
Chandler Carruth [Tue, 23 Feb 2016 00:05:00 +0000 (00:05 +0000)]
[PM] Improve the API and comments around the analysis manager proxies.
These are really handles that ensure the analyses get cleared at
appropriate places, and as such copying doesn't really make sense.
Instead, they should look more like unique ownership objects. Make that
the case.
Relatedly, if you create a temporary of one and move out of it
its destructor shouldn't actually clear anything. I don't think there is
any code that can trigger this currently, but it seems like a more
robust implementation.
If folks want, I can add a unittest that forces this to be exercised,
but that seems somewhat pointless -- whether a temporary is ever created
in the innards of AnalysisManager is not really something we should be
adding a reliance on, but I didn't want to leave a timebomb in the code
here.
If anyone has a cleaner way to represent this, I'm all ears, but
I wanted to assure myself that this wasn't in fact responsible for
another bug I'm chasing down (it wasn't) and figured I'd commit that.
llvm-svn: 261594
Eugene Zelenko [Mon, 22 Feb 2016 23:46:47 +0000 (23:46 +0000)]
Fix Clang-tidy modernize-use-nullptr and modernize-use-default warnings in source/Commands/CommandObjectCommands.cpp; other minor fixes.
llvm-svn: 261593
Matt Arsenault [Mon, 22 Feb 2016 23:45:42 +0000 (23:45 +0000)]
AMDGPU: Add failing testcase for register coalescer
llvm-svn: 261592
Rafael Espindola [Mon, 22 Feb 2016 23:19:29 +0000 (23:19 +0000)]
Handle a weak undefined tls to archive member.
A weak undefined should not fetch archive members, so we have to keep
the Lazy symbol.
That means the lazy symbol has to encode information about the original
weak undef.
Fixes pr25762.
llvm-svn: 261591
Rafael Espindola [Mon, 22 Feb 2016 23:16:05 +0000 (23:16 +0000)]
Remove a trivial getter.
llvm-svn: 261590
Krzysztof Parzyszek [Mon, 22 Feb 2016 23:07:43 +0000 (23:07 +0000)]
More detailed dependence test between volatile and non-volatile accesses
Differential Revision: http://reviews.llvm.org/D16857
llvm-svn: 261589
Dehao Chen [Mon, 22 Feb 2016 22:54:14 +0000 (22:54 +0000)]
Include ProfileData as CodeGen's required library.
Summary: Fixing buildbot failure introduced by http://reviews.llvm.org/D17460
Reviewers: davidxl, hans
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D17524
llvm-svn: 261588
Dehao Chen [Mon, 22 Feb 2016 22:46:21 +0000 (22:46 +0000)]
Set function entry count as 0 if sample profile is not found for the function.
Summary: This change makes the sample profile's behavior consistent with instr profile.
Reviewers: davidxl, eraman, dnovillo
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D17522
llvm-svn: 261587
Duncan P. N. Exon Smith [Mon, 22 Feb 2016 22:24:22 +0000 (22:24 +0000)]
Lex: Check for 0 buckets on header map construction
Switch to using `isPowerOf2_32()` to check whether the buckets are a
power of two, and as a side benefit reject loading a header map with no
buckets. This is a follow-up to r261448.
llvm-svn: 261585
David Majnemer [Mon, 22 Feb 2016 22:23:11 +0000 (22:23 +0000)]
[X86] Create mergeable constant pool entries for AVX
We supported creating mergeable constant pool entries for smaller
constants but not for 32-byte AVX constants.
llvm-svn: 261584
Hans Wennborg [Mon, 22 Feb 2016 22:21:58 +0000 (22:21 +0000)]
Fix Visual Studio build after r261574
llvm-svn: 261583
Dehao Chen [Mon, 22 Feb 2016 22:14:14 +0000 (22:14 +0000)]
Add prefix based function layout when profile is available.
Summary: If a function is hot, put it in text.hot section.
Reviewers: davidxl
Subscribers: eraman, mcrosier, llvm-commits
Differential Revision: http://reviews.llvm.org/D17460
llvm-svn: 261582
Marshall Clow [Mon, 22 Feb 2016 22:13:03 +0000 (22:13 +0000)]
Fix __is_referenceable to work with vector types. Fixes PR#26654 and 26656. Thanks to Evgeniy for the reports, and to Eric for the suggestion on how to fix it.
llvm-svn: 261581
Matt Arsenault [Mon, 22 Feb 2016 22:01:42 +0000 (22:01 +0000)]
SelectionDAG: Use correct addrspace when lowering memcpy
This was causing assertions later from using the wrong pointer
size with LDS operations. getOptimalMemOpType should also have
address space arguments later.
This avoids assertions in existing tests exposed by
a future commit.
llvm-svn: 261580
Derek Schuff [Mon, 22 Feb 2016 21:57:17 +0000 (21:57 +0000)]
[WebAssembly] Fix writeback of stack pointer with dynamic alloca
Previously the stack pointer was only written back to memory in the
prolog. But this is wrong for dynamic allocas, for which
target-independent codegen handles SP updates after the prolog (and
possibly even in another BB). Instead update the SP global in
ADJCALLSTACKDOWN which is generated after the SP update sequence.
This will have further refinements when we add red zone support.
llvm-svn: 261579
Adam Nemet [Mon, 22 Feb 2016 21:41:22 +0000 (21:41 +0000)]
[LoopDataPrefetch] Make it testable with opt
Summary:
Since this is an IR pass it's nice to be able to write tests without
llc. This is the counterpart of the llc test under
CodeGen/PowerPC/loop-data-prefetch.ll.
Reviewers: hfinkel
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D17464
llvm-svn: 261578
Duncan P. N. Exon Smith [Mon, 22 Feb 2016 21:30:15 +0000 (21:30 +0000)]
CodeGen: Bring back MachineBasicBlock::iterator::getInstrIterator()...
This is a little embarrassing.
When I reverted r261504 (getIterator() => getInstrIterator()) in
r261567, I did a `git grep` to see if there were new calls to
`getInstrIterator()` that I needed to migrate. There were 10-20 hits,
and I blindly did a `sed ...` before calling `ninja check`.
However, these were `MachineInstrBundleIterator::getInstrIterator()`,
which predated r261567. Perhaps coincidentally, these had an identical
name and return type.
This commit undoes my careless sed and restores
`MachineBasicBlock::iterator::getInstrIterator()`.
llvm-svn: 261577
Rafael Espindola [Mon, 22 Feb 2016 21:23:29 +0000 (21:23 +0000)]
Don't create copy relocs in shared libraries.
This fixes PR26699.
llvm-svn: 261576
Michael Zolotukhin [Mon, 22 Feb 2016 21:21:45 +0000 (21:21 +0000)]
[LoopUnrolling] Fix a bug introduced in r259869 (PR26688).
The issue was that we only required LCSSA rebuilding if the immediate
parent-loop had values used outside of it. The fix is to enaable the
same logic for all outer loops, not only immediate parent.
llvm-svn: 261575
Samuel Benzaquen [Mon, 22 Feb 2016 21:13:02 +0000 (21:13 +0000)]
[ASTMatchers] Add matcher hasAnyName.
Summary: Add matcher hasAnyName as an optimization over anyOf(hasName(),...)
Reviewers: alexfh
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D17163
llvm-svn: 261574
Davide Italiano [Mon, 22 Feb 2016 21:06:46 +0000 (21:06 +0000)]
[X86ISelLowering] Consolidate duplicated code in a single place.
llvm-svn: 261573
Matt Arsenault [Mon, 22 Feb 2016 21:04:23 +0000 (21:04 +0000)]
AMDGPU: Fix alignments in test
I don't think this test was intending to test unaligned load/store.
Change it to use the natural alignment to avoid regressing.
Also adds missing SI checks.
llvm-svn: 261571
Matt Arsenault [Mon, 22 Feb 2016 21:04:16 +0000 (21:04 +0000)]
AMDGPU/R600: Implement allowsMisalignedMemoryAccess
This avoids some test regressions in a future commit
when unaligned operations are expanded when they
have custom lowering.
llvm-svn: 261570
Philip Reames [Mon, 22 Feb 2016 21:01:28 +0000 (21:01 +0000)]
[RS4GC] "Constant fold" the rs4gc-split-vector-values flag
This flag was part of a migration to a new means of handling vectors-of-points which was described in the llvm-dev thread "FYI: Relocating vector of pointers". The old code path has been off by default for a while without complaints, so time to cleanup.
llvm-svn: 261569
Tim Northover [Mon, 22 Feb 2016 20:55:50 +0000 (20:55 +0000)]
ARM: sink atomic release barrier as far as possible into cmpxchg.
DMB instructions can be expensive, so it's best to avoid them if possible. In
atomicrmw operations there will always be an attempted store so a release
barrier is always needed, but in the cmpxchg case we can delay the DMB until we
know we'll definitely try to perform a store (and so need release semantics).
In the strong cmpxchg case this isn't quite free: we must duplicate the LDREX
instructions to skip the barrier on subsequent iterations. The basic outline
becomes:
ldrex rOld, [rAddr]
cmp rOld, rDesired
bne Ldone
dmb
Lloop:
strex rRes, rNew, [rAddr]
cbz rRes Ldone
ldrex rOld, [rAddr]
cmp rOld, rDesired
beq Lloop
Ldone:
So we'll skip this version for strong operations in "minsize" functions.
llvm-svn: 261568
Duncan P. N. Exon Smith [Mon, 22 Feb 2016 20:49:58 +0000 (20:49 +0000)]
Revert "CodeGen: MachineInstr::getIterator() => getInstrIterator(), NFC"
This reverts commit r261504, since it's not obvious the new name is
better:
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-
20160222/334298.html
I'll recommit if we get consensus that it's the right direction.
llvm-svn: 261567
Dan Gohman [Mon, 22 Feb 2016 20:47:12 +0000 (20:47 +0000)]
[WebAssembly] Re-enable the TailDuplicate pass.
llvm-svn: 261566
Philip Reames [Mon, 22 Feb 2016 20:45:56 +0000 (20:45 +0000)]
[RS4GC] Revert optimization attempt due to memory corruption
This change reverts "246133 [RewriteStatepointsForGC] Reduce the number of new instructions for base pointers" and a follow on bugfix 12575.
As pointed out in pr25846, this code suffers from a memory corruption bug. Since I'm (empirically) not going to get back to this any time soon, simply reverting the problematic change is the right answer.
llvm-svn: 261565
JF Bastien [Mon, 22 Feb 2016 20:37:34 +0000 (20:37 +0000)]
WebAssembly: update expected failures
clang r261557 lowers va_arg in clang.
llvm-svn: 261564
Daniel Jasper [Mon, 22 Feb 2016 20:24:11 +0000 (20:24 +0000)]
clang-format: [JS] Add @return to the supported JSDoc pragmas in Google
style.
llvm-svn: 261563
Dan Gohman [Mon, 22 Feb 2016 20:04:02 +0000 (20:04 +0000)]
[WebAssembly] Teach address folding to fold bitwise-or nodes.
LLVM converts adds into ors when it can prove that the operands don't share
any non-zero bits. Teach address folding to recognize or instructions with
constant operands with this property that can be folded into addresses as
if they were adds.
llvm-svn: 261562
Rafael Espindola [Mon, 22 Feb 2016 19:57:55 +0000 (19:57 +0000)]
Correctly handle two gd relocations to the same symbol.
Fixes PR26676.
llvm-svn: 261561
Dan Gohman [Mon, 22 Feb 2016 19:26:15 +0000 (19:26 +0000)]
[WebAssembly] Initial driver support for standard library paths.
llvm-svn: 261560
Tom Stellard [Mon, 22 Feb 2016 19:17:56 +0000 (19:17 +0000)]
[AMDGPU][llvm-mc] Support for 32-bit inline literals
Patch by: Artem Tamazov
Summary:
Note: Support for 64-bit inline literals TBD
Added: Support of abs/neg modifiers for literals (incomplete; parsing TBD).
Added: Some TODO comments.
Reworked/clarity: rename isInlineImm() to isInlinableImm()
Reworked/robustness: disallow BitsToFloat() with undefined value in isInlinableImm()
Reworked/reuse: isSSrc32/64(), isVSrc32/64()
Tests added.
Reviewers: tstellarAMD, arsenm
Subscribers: vpykhtin, nhaustov, SamWot, arsenm
Projects: #llvm-amdgpu-spb
Differential Revision: http://reviews.llvm.org/D17204
llvm-svn: 261559
Tom Stellard [Mon, 22 Feb 2016 19:17:53 +0000 (19:17 +0000)]
[AMDGPU] [llvm-mc] [VI] Fix encoding of LDS/GDS instructions.
Patch by: Artem Tamazov
Summary: Tests added.
Reviewers: tstellarAMD, arsenm
Subscribers: vpykhtin, SamWot, #llvm-amdgpu-spb
Projects: #llvm-amdgpu-spb
Differential Revision: http://reviews.llvm.org/D17271
llvm-svn: 261558
Dan Gohman [Mon, 22 Feb 2016 19:17:40 +0000 (19:17 +0000)]
[WebAssembly] Lower va_arg in clang.
This uses the general emitVoidPtrVAArg lowering logic for everything, since
this supports all types, and we don't have any special requirements.
llvm-svn: 261557
Bruno Cardoso Lopes [Mon, 22 Feb 2016 19:02:27 +0000 (19:02 +0000)]
[VFS] Fix call to getVFSFromYAML in unittests
Follow up from r261552
llvm-svn: 261556
Eugene Zelenko [Mon, 22 Feb 2016 19:02:01 +0000 (19:02 +0000)]
Fix Clang-tidy modernize-use-nullptr and modernize-use-default warnings in source/Commands/CommandObjectPlatform.cpp; other minor fixes.
Add missing break for permissions-string case.
llvm-svn: 261555
Alexey Samsonov [Mon, 22 Feb 2016 18:52:51 +0000 (18:52 +0000)]
[Sanitizer] Introduce ListOfModules object and use it to replace GetListOfModules().
Summary:
This removes the hard limit on the number of loaded modules (used to be
16K), and makes it easier to use LoadedModules w/o causing a memory
leak: ListOfModules owns the modules, and makes sure to properly clean
them in destructor.
Remove filtering functionality that is only needed in one place (LSan).
Reviewers: aizatsky
Subscribers: llvm-commits, kcc
Differential Revision: http://reviews.llvm.org/D17470
llvm-svn: 261554
Bruno Cardoso Lopes [Mon, 22 Feb 2016 18:41:09 +0000 (18:41 +0000)]
[VFS] Add 'overlay-relative' field to YAML files
The VFS overlay mapping between virtual paths and real paths is done through
the 'external-contents' entries in YAML files, which contains hardcoded paths
to the real files.
When a module compilation crashes, headers are dumped into <name>.cache/vfs
directory and are mapped via the <name>.cache/vfs/vfs.yaml. The script
generated for reproduction uses -ivfsoverlay pointing to file to gather the
mapping between virtual paths and files inside <name>.cache/vfs. Currently, we
are only capable of reproducing such crashes in the same machine as they
happen, because of the hardcoded paths in 'external-contents'.
To be able to reproduce a crash in another machine, this patch introduces a new
option in the VFS yaml file called 'overlay-relative'. When it's equal to
'true' it means that the provided path to the YAML file through the
-ivfsoverlay option should also be used to prefix the final path for every
'external-contents'.
Example, given the invocation snippet "... -ivfsoverlay
<name>.cache/vfs/vfs.yaml" and the following entry in the yaml file:
"overlay-relative": "true",
"roots": [
...
"type": "directory",
"name": "/usr/include",
"contents": [
{
"type": "file",
"name": "stdio.h",
"external-contents": "/usr/include/stdio.h"
},
...
Here, a file manager request for virtual "/usr/include/stdio.h", that will map
into real path "/<absolute_path_to>/<name>.cache/vfs/usr/include/stdio.h.
This is a useful feature for debugging module crashes in machines other than
the one where the error happened.
Differential Revision: http://reviews.llvm.org/D17457
rdar://problem/
24499339
llvm-svn: 261552
Bruno Cardoso Lopes [Mon, 22 Feb 2016 18:41:01 +0000 (18:41 +0000)]
[VFS] Add support for handling path traversals
Handle ".", ".." and "./" with trailing slashes while collecting files
to be dumped into the vfs overlay directory.
Include the support for symlinks into components. Given the path:
/install-dir/bin/../lib/clang/3.8.0/include/altivec.h, if "bin"
component is a symlink, it's not safe to use `path::remove_dots` here,
and `realpath` is used to get the right answer. Since `realpath`
is expensive, we only do it at collecting time (which only happens
during the crash reproducer) and cache the base directory for fast lookups.
Overall, this makes the input to the VFS YAML file to be canonicalized
to never contain traversal components.
Differential Revision: http://reviews.llvm.org/D17104
rdar://problem/
24499339
llvm-svn: 261551
Tom Stellard [Mon, 22 Feb 2016 18:36:00 +0000 (18:36 +0000)]
docs/AMDGPUUsage: Update assembly example
Reviewers: arsenm, nhaustov
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D17461
llvm-svn: 261550
Justin Lebar [Mon, 22 Feb 2016 18:24:43 +0000 (18:24 +0000)]
Revert "[attrs] Handle convergent CallSites."
This reverts r261544, which was causing a test failure in
Transforms/FunctionAttrs/readattrs.ll.
llvm-svn: 261549
Manman Ren [Mon, 22 Feb 2016 18:24:30 +0000 (18:24 +0000)]
Add has_feature attribute_availability_with_strict.
rdar://
23791325
llvm-svn: 261548
Justin Lebar [Mon, 22 Feb 2016 18:17:27 +0000 (18:17 +0000)]
Revert "[ifcnv] Add comment explaining why it's OK to duplicate convergent MIs in ifcnv."
This reverts r261543. Accidental commit (not LGTM'ed).
llvm-svn: 261547
Nemanja Ivanovic [Mon, 22 Feb 2016 18:04:00 +0000 (18:04 +0000)]
Fix for PR26690 take 2
This is what was meant to be in the initial commit to fix this bug. The
parens were missing. This commit also adds a test case for the bug and
has undergone full testing on PPC and X86.
llvm-svn: 261546
Devin Coughlin [Mon, 22 Feb 2016 17:56:24 +0000 (17:56 +0000)]
[analyzer] Detect duplicate [super dealloc] calls
Add an alpha path checker that warns about duplicate calls to [super dealloc].
This will form the foundation of a checker that will detect uses of
'self' after calling [super dealloc].
Part of rdar://problem/6953275.
Based on a patch by David Kilzer!
Differential Revision: http://reviews.llvm.org/D5238
llvm-svn: 261545
Justin Lebar [Mon, 22 Feb 2016 17:51:35 +0000 (17:51 +0000)]
[attrs] Handle convergent CallSites.
Summary:
Previously we had a notion of convergent functions but not of convergent
calls. This is insufficient to correctly analyze calls where the target
is unknown, e.g. indirect calls.
Now a call is convergent if it targets a known-convergent function, or
if it's explicitly marked as convergent. As usual, we can remove
convergent where we can prove that no convergent operations are
performed in the call.
Reviewers: chandlerc, jingyue
Subscribers: hfinkel, jhen, tra, llvm-commits
Differential Revision: http://reviews.llvm.org/D17317
llvm-svn: 261544