Piotr Padlewski [Wed, 12 Apr 2017 20:45:12 +0000 (20:45 +0000)]
Remove readnone from invariant.group.barrier
Summary:
Readnone attribute would cause CSE of two barriers with
the same argument, which is invalid by example:
struct Base {
virtual int foo() { return 42; }
};
struct Derived1 : Base {
int foo() override { return 50; }
};
struct Derived2 : Base {
int foo() override { return 100; }
};
void foo() {
Base *x = new Base{};
new (x) Derived1{};
int a = std::launder(x)->foo();
new (x) Derived2{};
int b = std::launder(x)->foo();
}
Here 2 calls of std::launder will produce @llvm.invariant.group.barrier,
which would be merged into one call, causing devirtualization
to devirtualize second call into Derived1::foo() instead of
Derived2::foo()
Reviewers: chandlerc, dberlin, hfinkel
Subscribers: llvm-commits, rsmith, amharc
Differential Revision: https://reviews.llvm.org/D31531
llvm-svn: 300101
Vassil Vassilev [Wed, 12 Apr 2017 20:43:11 +0000 (20:43 +0000)]
Append -w when LLVM_ENABLE_WARNINGS is Off.
Reviewed by rnk (D31702)!
llvm-svn: 300100
Peter Collingbourne [Wed, 12 Apr 2017 20:02:09 +0000 (20:02 +0000)]
Bitcode: Move version and global value module code parsers to separate functions. NFCI.
This will make it easier to teach this code about the string table.
Differential Revision: https://reviews.llvm.org/D31828
llvm-svn: 300099
Zachary Turner [Wed, 12 Apr 2017 19:59:37 +0000 (19:59 +0000)]
[Support] Add support for unique_ptr<> to Casting.h.
Often you have a unique_ptr<T> where T supports LLVM's
casting methods, and you wish to cast it to a unique_ptr<U>.
Prior to this patch, this requires doing hacky things like:
unique_ptr<U> Casted;
if (isa<U>(Orig.get()))
Casted.reset(cast<U>(Orig.release()));
This is overly verbose, and it would be nice to just be able
to use unique_ptr directly with cast and dyn_cast. To this end,
this patch updates cast<> to work directly with unique_ptr<T>,
so you can now write:
auto Casted = cast<U>(std::move(Orig));
Since it's possible for dyn_cast<> to fail, however, we choose
to use a slightly different API here, because it's awkward to
write
if (auto Casted = dyn_cast<U>(std::move(Orig))) {}
when Orig may end up not having been moved at all. So the
interface for dyn_cast is
if (auto Casted = unique_dyn_cast<U>(Orig)) {}
Where the inclusion of `unique` in the name of the cast operator
re-affirms that regardless of success of or fail of the casting,
exactly one of the input value and the return value will contain
a non-null result.
Differential Revision: https://reviews.llvm.org/D31890
llvm-svn: 300098
Shoaib Meenai [Wed, 12 Apr 2017 19:56:37 +0000 (19:56 +0000)]
[libc++] Use more appropriate conditional for ABI macro definition
The inline function definition ABI macro is gated on COFF dllexport
semantics, so it's more appropriate to mark it with the object file
format macro rather than the generic _WIN32 macro. We now have no uses
of _WIN32 apart from those used to define the other Windows macros :)
Clarify the ABI macro comment and make the object file format check
exhaustive while I'm here.
llvm-svn: 300097
Zachary Turner [Wed, 12 Apr 2017 19:52:47 +0000 (19:52 +0000)]
Remove svnprop eol-style:native from Casting.h
llvm-svn: 300096
Craig Topper [Wed, 12 Apr 2017 19:32:47 +0000 (19:32 +0000)]
[InstCombine] Teach SimplifyMultipleUseDemandedBits to handle And/Or/Xor known bits using the LHS/RHS known bits it already acquired without recursing back into computeKnownBits.
This replicates the known bits and constant creation code from the single use case for these instructions and adds it here. The computeKnownBits and constant creation code for other instructions is now in the default case of the opcode switch.
llvm-svn: 300094
Craig Topper [Wed, 12 Apr 2017 19:08:03 +0000 (19:08 +0000)]
[InstCombine] Remove unreachable code for turning an And where all demanded bits on both sides are known to be zero into a constant 0.
We already handled a superset check that included the known ones too and folded to a constant that may include ones. But it can also handle the case of no ones.
llvm-svn: 300093
Sanjay Patel [Wed, 12 Apr 2017 18:39:53 +0000 (18:39 +0000)]
[InstCombine] fix wrong undef handling when converting select to shuffle
As discussed in:
https://bugs.llvm.org/show_bug.cgi?id=32486
...the canonicalization of vector select to shufflevector does not hold up
when undef elements are present in the condition vector.
Try to make the undef handling clear in the code and the LangRef.
Differential Revision: https://reviews.llvm.org/D31980
llvm-svn: 300092
Craig Topper [Wed, 12 Apr 2017 18:39:27 +0000 (18:39 +0000)]
[SelectionDAG] Use APInt move assignment to avoid 2 memory allocations and copies when bit width is larger than 64-bits.
llvm-svn: 300091
Bob Haarman [Wed, 12 Apr 2017 18:36:13 +0000 (18:36 +0000)]
[coff] default to multiple parallel ThinLTO jobs
Summary:
lld-link allows the number of parallel ThinLTO jobs to be specified
using /opt:lldltojobs=N. If left unspecified, the implementation
conservatively defaults to 1. This leads to very long link times. This
change makes it so that the default is to automatically set the
parallelism, as we do in the ELF linker.
Reviewers: ruiu, hans
Reviewed By: ruiu, hans
Subscribers: pcc, mehdi_amini, Prazek, llvm-commits
Differential Revision: https://reviews.llvm.org/D31986
llvm-svn: 300089
Kyle Butt [Wed, 12 Apr 2017 18:30:32 +0000 (18:30 +0000)]
CodeGen: BlockPlacement: Add comment about DenseMap Safety.
The use of a DenseMap in precomputeTriangleChains does not cause
non-determinism, even though it is iterated over, as the only thing the
iteration does is to insert entries into a new DenseMap, which is not iterated.
Comment only change.
llvm-svn: 300088
Rui Ueyama [Wed, 12 Apr 2017 18:29:52 +0000 (18:29 +0000)]
Accept not only lld-link but also LLD-LINK, for example.
Filenames are case-insensitive on Windows, so when we dispatch based
on argv0, we need to handle it case-insensitively.
Fixes https://bugs.llvm.org/show_bug.cgi?id=32637.
llvm-svn: 300087
Peter Collingbourne [Wed, 12 Apr 2017 18:27:00 +0000 (18:27 +0000)]
llvm-lto2: Add a dump-symtab subcommand.
This allows us to test the symbol table APIs for LTO input files.
Differential Revision: https://reviews.llvm.org/D31920
llvm-svn: 300086
Craig Topper [Wed, 12 Apr 2017 18:25:25 +0000 (18:25 +0000)]
[InstCombine] In SimplifyMultipleUseDemandedBits, use a switch instead of cascaded ifs on opcode. NFC
llvm-svn: 300085
Craig Topper [Wed, 12 Apr 2017 18:17:46 +0000 (18:17 +0000)]
[InstCombine] Teach SimplifyDemandedInstructionBits that even if we reach an instruction that has multiple uses, if we know all the bits for the demanded bits for this context we can go ahead and create a constant.
Currently if we reach an instruction with multiples uses we know we can't do any optimizations to that instruction itself since we only have the demanded bits for one of the users. But if we know all of the bits are zero/one for that one user we can still go ahead and create a constant to give to that user.
This might then reduce the instruction to having a single use and allow additional optimizations on the other path.
This picks up an additional case that r300075 didn't catch.
Differential Revision: https://reviews.llvm.org/D31552
llvm-svn: 300084
Matthias Braun [Wed, 12 Apr 2017 18:09:05 +0000 (18:09 +0000)]
MachineScheduler: Skip acyclic latency heuristic for in-order cores
The current heuristic is triggered on `InFlightCount > BufferLimit`
which isn't really helpful on in-order cores where BufferLimit is zero.
Note that we already get latency hiding effects for in order cores
by instructions staying in the pending queue on stalls; The additional
latency scheduling heuristics only have minimal effects after that while
occasionally increasing register pressure too much resulting in extra
spills.
My motivation here is additional spills/reloads ending up in a loop in
464.h264ref / BlockMotionSearch function resulting in a 4% overal
regression on an in order core. rdar://
30264380
llvm-svn: 300083
Craig Topper [Wed, 12 Apr 2017 18:05:21 +0000 (18:05 +0000)]
[InstCombine] Move portion of SimplifyDemandedUseBits that deals with instructions with multiple uses out to a separate method. NFCI
llvm-svn: 300082
Renato Golin [Wed, 12 Apr 2017 18:03:09 +0000 (18:03 +0000)]
[SystemZ] Fix more target specific tests
llvm-svn: 300081
Francis Ricci [Wed, 12 Apr 2017 17:31:41 +0000 (17:31 +0000)]
Fix memory leaks in address sanitizer darwin tests
Summary: These leaks are detected by leak sanitizer for darwin.
Reviewers: glider, kubamracek, kcc, alekseyshl
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D31978
llvm-svn: 300080
Stephan T. Lavavej [Wed, 12 Apr 2017 17:16:38 +0000 (17:16 +0000)]
[libcxx] [test] Avoid Clang's -Wunused-const-variable in is_constructible.pass.cpp.
This happens when using Clang with MSVC's STL, so there are no actual uses of this variable.
Fixes D31966.
llvm-svn: 300079
Renato Golin [Wed, 12 Apr 2017 17:14:46 +0000 (17:14 +0000)]
[SystemZ] Fix target specific tests
llvm-svn: 300078
Krasimir Georgiev [Wed, 12 Apr 2017 17:13:08 +0000 (17:13 +0000)]
[clangd] Rename ClangDMain.cpp -> ClangdMain.cpp, NFC
llvm-svn: 300077
Dmitry Preobrazhensky [Wed, 12 Apr 2017 17:10:07 +0000 (17:10 +0000)]
[AMDGPU][MC] Added support for several VI-specific opcodes (s_wakeup, etc)
Added support for VI:
- s_endpgm_saved
- s_wakeup
- s_rfe_restore_b64
- v_perm_b32
Enabled for VI:
- v_mov_fed_b32
- v_mov_fed_b32_e64
See bug 32593: https://bugs.llvm.org//show_bug.cgi?id=32593
Reviewers: artem.tamazov, vpykhtin
Differential Revision: https://reviews.llvm.org/D31931
llvm-svn: 300076
Craig Topper [Wed, 12 Apr 2017 16:49:59 +0000 (16:49 +0000)]
Teach SimplifyDemandedUseBits that adding or subtractings 0s from every bit below the highest demanded bit can be simplified
If we are adding/subtractings 0s below the highest demanded bit we can just use the other operand and remove the operation.
My primary motivation is observing that we can call ShrinkDemandedConstant for the add/sub and create a 0 constant, rather than removing the add completely. In the case I saw, we modified the constant on an add instruction to a 0, but the add is not put into the worklist. So we didn't revisit it until the next InstCombine iteration. This caused an IR modification to remove add and a subsequent iteration to be ran.
With this change we get bypass the add in the first iteration and prevent the second iteration from changing anything.
Differential Revision: https://reviews.llvm.org/D31120
llvm-svn: 300075
Hans Wennborg [Wed, 12 Apr 2017 16:40:26 +0000 (16:40 +0000)]
Revert r300001 "Revert r298824 & r298816, recommit r298742 & r298754"
It caused PR32640.
llvm-svn: 300074
Dmitry Preobrazhensky [Wed, 12 Apr 2017 16:31:18 +0000 (16:31 +0000)]
[AMDGPU][MC] Corrected parsing of v_cmp_class* and v_cmpx_class*
Fixed bug 32565: https://bugs.llvm.org//show_bug.cgi?id=32565
Reviewers: vpykhtin
Differential Revision: https://reviews.llvm.org/D31820
llvm-svn: 300073
Derek Schuff [Wed, 12 Apr 2017 16:03:00 +0000 (16:03 +0000)]
[WebAssembly] Update use of Attributes after r299875
This fixes the failing WebAssemblyLowerEmscriptenEHSjLj tests
llvm-svn: 300072
Aaron Ballman [Wed, 12 Apr 2017 15:56:02 +0000 (15:56 +0000)]
Moving a C++ test out of Sema and into SemaCXX; NFC.
llvm-svn: 300071
Dmitry Preobrazhensky [Wed, 12 Apr 2017 15:36:09 +0000 (15:36 +0000)]
[AMDGPU][MC] Corrected encoding of V_MQSAD_U32_U8 for CI
Corrected encoding of V_MQSAD_U32_U8 for CI
See bug 32552: https://bugs.llvm.org//show_bug.cgi?id=32552
Reviewers: vpykhtin
Differential Revision: https://reviews.llvm.org/D31810
llvm-svn: 300070
Easwaran Raman [Wed, 12 Apr 2017 15:26:15 +0000 (15:26 +0000)]
Fix the bootstrap failure caused by r299986.
llvm-svn: 300069
Sanjay Patel [Wed, 12 Apr 2017 15:19:08 +0000 (15:19 +0000)]
[x86] fix AVX FP cmp intrinsic documentation (PR28110)
This copies the text used in the #define statements to the code comments.
The conflicting text comes from AMD manuals, but those are wrong. Sadly,
that FP cmp text has not been updated even after some docs were updated
for Zen:
http://support.amd.com/en-us/search/tech-docs
( AMD64 Architecture Programmer's Manual Volume 4 )
See PR28110 for more discussion:
https://bugs.llvm.org/show_bug.cgi?id=28110
Differential Revision: https://reviews.llvm.org/D31428
llvm-svn: 300068
Sanjay Patel [Wed, 12 Apr 2017 15:11:33 +0000 (15:11 +0000)]
[InstCombine] morph an existing instruction instead of creating a new one
One potential way to make InstCombine (very slightly?) faster is to recycle instructions
when possible instead of creating new ones. It's not explicitly stated AFAIK, but we don't
consider this an "InstSimplify". We could, however, make a new layer to house transforms
like this if that makes InstCombine more manageable (just throwing out an idea; not sure
how much opportunity is actually here).
Differential Revision: https://reviews.llvm.org/D31863
llvm-svn: 300067
Dmitry Preobrazhensky [Wed, 12 Apr 2017 14:29:45 +0000 (14:29 +0000)]
[AMDGPU][MC] Corrected ds_wrxchg2* to support two offsets
Fixed bug 28227: https://bugs.llvm.org//show_bug.cgi?id=28227
Reviewers: vpykhtin
Differential Revision: https://reviews.llvm.org/D31808
llvm-svn: 300066
Francis Ricci [Wed, 12 Apr 2017 14:25:28 +0000 (14:25 +0000)]
Use 0-padding for i386 and arm print format specifiers
Summary:
This is used for the other architectures in print_address, but is
missing from i386 and arm.
Reviewers: m.ostapenko, spetrovic
Subscribers: aemerson, rengolin, llvm-commits, kubamracek
Differential Revision: https://reviews.llvm.org/D31977
llvm-svn: 300065
Jonas Paulsson [Wed, 12 Apr 2017 14:25:08 +0000 (14:25 +0000)]
Fix a RUN line in new test.
Use '2>&1 |' and not '|&' to pipe debug output to FileCheck
Hopefully handles a "shell parser error" on
llvm-clang-x86_64-expensive-checks-win
test/Transforms/SLPVectorizer/SystemZ/SLP-cmp-cost-query.ll
llvm-svn: 300064
Serge Pavlov [Wed, 12 Apr 2017 14:13:00 +0000 (14:13 +0000)]
Remove redundant type casts
llvm-svn: 300063
Ed Maste [Wed, 12 Apr 2017 13:51:00 +0000 (13:51 +0000)]
Fix detection of backtrace() availability on FreeBSD
On FreeBSD backtrace is not part of libc and depends on libexecinfo
being available. Instead of using manual checks we can use the builtin
CMake module FindBacktrace.cmake to detect availability of backtrace()
in a portable way.
Patch By: Alex Richardson
Differential Revision: https://reviews.llvm.org/D27143
llvm-svn: 300062
Jonas Paulsson [Wed, 12 Apr 2017 13:29:25 +0000 (13:29 +0000)]
[SLPVectorizer] Pass the right type argument to getCmpSelInstrCost()
In getEntryCost(), make the scalar type for a compare instruction that of the
operands, not i1. This is needed in order to call getCmpSelInstrCost() for a
compare in a sensible way, the same way as the LoopVectorizer does.
New test: test/Transforms/SLPVectorizer/SystemZ/SLP-cmp-cost-query.ll
Review: Matthew Simpson
https://reviews.llvm.org/D31601
llvm-svn: 300061
Benjamin Kramer [Wed, 12 Apr 2017 13:26:31 +0000 (13:26 +0000)]
[MachineBlockPlacment] Add an assert to ensure there is no order dependency on DenseMap iteration order.
llvm-svn: 300060
Benjamin Kramer [Wed, 12 Apr 2017 13:26:28 +0000 (13:26 +0000)]
[MachineBlockPlacement] Clean up data structures a bit.
No functionality change intended.
llvm-svn: 300059
Jonas Paulsson [Wed, 12 Apr 2017 13:13:15 +0000 (13:13 +0000)]
[LoopVectorizer] Improve handling of branches during cost estimation.
The cost for a branch after vectorization is very different depending on if
the vectorizer will if-convert the block (branch is eliminated), or if
scalarized and predicated blocks will be produced (branch duplicated before
each block). There is also the case of remaining scalar branches, such as the
back-edge branch.
This patch handles these cases differently with TTI based cost estimates.
Review: Matthew Simpson
https://reviews.llvm.org/D31175
llvm-svn: 300058
Igor Breger [Wed, 12 Apr 2017 12:54:54 +0000 (12:54 +0000)]
[GlobalIsel][X86] support G_CONSTANT selection.
Summary: [GlobalISel][X86] support G_CONSTANT selection. Add regbank select tests.
Reviewers: zvi, guyblank
Reviewed By: guyblank
Subscribers: llvm-commits, dberris, rovka, kristof.beyls
Differential Revision: https://reviews.llvm.org/D31974
llvm-svn: 300057
Jonas Paulsson [Wed, 12 Apr 2017 12:41:37 +0000 (12:41 +0000)]
[LoopVectorizer, TTI] New method supportsEfficientVectorElementLoadStore()
Since SystemZ supports vector element load/store instructions, there is no
need for extracts/inserts if a vector load/store gets scalarized.
This patch lets Target specify that it supports such instructions by means of
a new TTI hook that defaults to false.
The use for this is in the LoopVectorizer getScalarizationOverhead() method,
which will with this patch produce a smaller sum for a vector load/store on
SystemZ.
New test: test/Transforms/LoopVectorize/SystemZ/load-store-scalarization-cost.ll
Review: Adam Nemet
https://reviews.llvm.org/D30680
llvm-svn: 300056
Dmitry Preobrazhensky [Wed, 12 Apr 2017 12:40:19 +0000 (12:40 +0000)]
[AMDGPU][MC] Corrected src0 size for s_cbranch_join
Fix for bug 28159: https://bugs.llvm.org//show_bug.cgi?id=28159
Reviewers: vpykhtin, arsenm
Differential Revision: https://reviews.llvm.org/D31595
llvm-svn: 300055
Pavel Labath [Wed, 12 Apr 2017 12:32:58 +0000 (12:32 +0000)]
Add libc++ category to the remaining libc++ data formatters
llvm-svn: 300054
Jonas Paulsson [Wed, 12 Apr 2017 12:11:41 +0000 (12:11 +0000)]
[SystemZ] Updated test fp-cast.ll
This did not get included in the previous commit for SystemZ cost functions.
llvm-svn: 300053
Jonas Paulsson [Wed, 12 Apr 2017 11:49:08 +0000 (11:49 +0000)]
[SystemZ] TargetTransformInfo cost functions implemented.
getArithmeticInstrCost(), getShuffleCost(), getCastInstrCost(),
getCmpSelInstrCost(), getVectorInstrCost(), getMemoryOpCost(),
getInterleavedMemoryOpCost() implemented.
Interleaved access vectorization enabled.
BasicTTIImpl::getCastInstrCost() improved to check for legal extending loads,
in which case the cost of the z/sext instruction becomes 0.
Review: Ulrich Weigand, Renato Golin.
https://reviews.llvm.org/D29631
llvm-svn: 300052
Krasimir Georgiev [Wed, 12 Apr 2017 11:33:26 +0000 (11:33 +0000)]
[DWARF] Fix compiler warnings in DWARFContext.cpp, NFCi
llvm-svn: 300051
Piotr Padlewski [Wed, 12 Apr 2017 11:18:19 +0000 (11:18 +0000)]
[LangRef] fix documentation
llvm-svn: 300050
Alex Lorenz [Wed, 12 Apr 2017 11:03:25 +0000 (11:03 +0000)]
Add support for __builtin_available to __has_builtin
rdar://
31576715
llvm-svn: 300049
Pavel Labath [Wed, 12 Apr 2017 10:59:34 +0000 (10:59 +0000)]
Fix TestCppIncompleteTypes for android/clang
LDFLAGS contains some .a files. If it is specified before the relevant
object files, undefined symbol errors occur.
llvm-svn: 300048
Pavel Labath [Wed, 12 Apr 2017 10:59:24 +0000 (10:59 +0000)]
Fix libc++ vector<bool> data formatter (bug #32553)
Summary:
The iteration list through the available data formatters was undefined,
which meant that the vector<bool> formatter kicked in only in cases
where it happened to be queried before the general vector formatter. To
fix this, I merge the two data formatter entries into one, and select
which implementation to use in the factory function.
Reviewers: jasonmolenda, tberghammer, EricWF
Subscribers: lldb-commits
Differential Revision: https://reviews.llvm.org/D31880
llvm-svn: 300047
Pavel Labath [Wed, 12 Apr 2017 10:13:50 +0000 (10:13 +0000)]
Fix TestGuessLanguage for gcc
gcc emits DW_LANG_C89 even if we specify -std=c99 during compilation.
Since this isn't an lldb bug, but just the way the compiler happens to
be implemented, I teach the test to expect this situation correctly.
llvm-svn: 300046
Pavel Labath [Wed, 12 Apr 2017 10:13:47 +0000 (10:13 +0000)]
Android.rules: setup correct objcopy path
This fixes a couple of tests when using android clang as a compiler.
llvm-svn: 300045
Renato Golin [Wed, 12 Apr 2017 10:12:49 +0000 (10:12 +0000)]
[LSAN] Disable on ARM/Thumb for good
I didn't pay enough attention to the patch I reverted, now I'm going to
hit it with a bigger hammer until we can understand what the problems
are.
llvm-svn: 300044
Yaron Keren [Wed, 12 Apr 2017 10:05:48 +0000 (10:05 +0000)]
Rangify for loop, NFC.
llvm-svn: 300043
Renato Golin [Wed, 12 Apr 2017 09:45:08 +0000 (09:45 +0000)]
Revert "[lsan] Fix typo in test/lsan/lit.common.cfg"
This reverts commit r299957. It broke the Thumb bots. We need to make
sure why and maybe stop it from being tested on Thumb environments. But
for now, let's get the bots green.
llvm-svn: 300042
Ismail Donmez [Wed, 12 Apr 2017 09:42:46 +0000 (09:42 +0000)]
Fix compile error
llvm-svn: 300041
Sam Kolton [Wed, 12 Apr 2017 09:36:05 +0000 (09:36 +0000)]
[AMDGPU] SDWA: make pass global
Summary: Remove checks for basic blocks.
Reviewers: vpykhtin, rampitec, arsenm
Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye
Differential Revision: https://reviews.llvm.org/D31935
llvm-svn: 300040
George Rimar [Wed, 12 Apr 2017 08:59:15 +0000 (08:59 +0000)]
[DWARF] - Refactoring of DWARFContextInMemory implementation.
This change is basically relative to D31136, where I initially wanted to
implement some relocations handling optimization which shows it can give
significant boost. Though even without any caching algorithm looks
code can have some cleanup at first.
Refactoring separates out code for taking symbol address, used in relocations
computation.
Differential revision: https://reviews.llvm.org/D31747
llvm-svn: 300039
Chandler Carruth [Wed, 12 Apr 2017 08:48:39 +0000 (08:48 +0000)]
[IR] Rename the class templates for the case iterator and case handle to
not collide with the naming convention for template *arguments*. In at
least one case they actually collided and this confuses MSVC.
llvm-svn: 300038
Daniel Sanders [Wed, 12 Apr 2017 08:23:08 +0000 (08:23 +0000)]
[globalisel][tablegen] Add experimental support for OperandWithDefaultOps, PredicateOperand, and OptionalDefOperand
Summary:
As far as instruction selection is concerned, all three appear to be same thing.
Support for these operands is experimental since AArch64 doesn't make use
of them and the in-tree targets that do use them (AMDGPU for
OperandWithDefaultOps, AMDGPU/ARM/Hexagon/Lanai for PredicateOperand, and ARM
for OperandWithDefaultOps) are not using tablegen-erated GlobalISel yet.
Reviewers: rovka, aditya_nandakumar, t.p.northover, qcolombet, ab
Reviewed By: rovka
Subscribers: inglorion, aemerson, rengolin, mehdi_amini, dberris, kristof.beyls, igorb, tpr, llvm-commits
Differential Revision: https://reviews.llvm.org/D31135
llvm-svn: 300037
Yaron Keren [Wed, 12 Apr 2017 08:17:44 +0000 (08:17 +0000)]
Remove Sema::addOverloadedOperatorToUnresolvedSet declaration. Its definition was removed in r206436.
llvm-svn: 300036
Chandler Carruth [Wed, 12 Apr 2017 08:12:30 +0000 (08:12 +0000)]
Update Clang for an API change to LLVM's switch case iterator (it is now
an actual iterator and so we need to look through it to the case
handle).
llvm-svn: 300035
Bjorn Pettersson [Wed, 12 Apr 2017 08:07:55 +0000 (08:07 +0000)]
[LoadCombine] Avoid analysing dead basic blocks
Summary:
Dead basic blocks may be forming a loop, for which SSA form is
fulfilled, but with a circular def-use chain. LoadCombine could
enter an infinite loop when analysing such dead code. This patch
solves the problem by simply avoiding to analyse all basic blocks
that aren't forward reachable, from function entry, in LoadCombine.
Fixes https://bugs.llvm.org/show_bug.cgi?id=27065
Reviewers: mehdi_amini, chandlerc, grosser, Bigcheese, davide
Reviewed By: davide
Subscribers: dberlin, zzheng, bjope, grandinj, Ka-Ka, materi, jholewinski, llvm-commits, mzolotukhin
Differential Revision: https://reviews.llvm.org/D31032
llvm-svn: 300034
Piotr Padlewski [Wed, 12 Apr 2017 07:59:35 +0000 (07:59 +0000)]
Invariant.group and mustalias docs fixes
Summary:
Alias analysis would like to know that
invariant.group.barrier returns pointer that mustalias,
but this can't imply that we can replace one pointer with another
Reviewers: dberlin, sanjoy
Subscribers: llvm-commits, chandlerc, hfinkel, nlewycky, amharc
Differential Revision: https://reviews.llvm.org/D31758
llvm-svn: 300033
Chandler Carruth [Wed, 12 Apr 2017 07:27:28 +0000 (07:27 +0000)]
[IR] Redesign the case iterator in SwitchInst to actually be an iterator
and to expose a handle to represent the actual case rather than having
the iterator return a reference to itself.
All of this allows the iterator to be used with common STL facilities,
standard algorithms, etc.
Doing this exposed some missing facilities in the iterator facade that
I've fixed and required some work to the actual iterator to fully
support the necessary API.
Differential Revision: https://reviews.llvm.org/D31548
llvm-svn: 300032
Craig Topper [Wed, 12 Apr 2017 05:57:46 +0000 (05:57 +0000)]
[IR] Fix copy and paste mistake in comment. NFC
llvm-svn: 300031
Craig Topper [Wed, 12 Apr 2017 05:49:28 +0000 (05:49 +0000)]
[InstCombine][IR] Add a commutable BinOp matcher. Use it to reduce some code. NFC
llvm-svn: 300030
Serguei Katkov [Wed, 12 Apr 2017 05:42:14 +0000 (05:42 +0000)]
[BPI] Refactor post domination calculation and simple fix for ColdCall
Collection of PostDominatedByUnreachable and PostDominatedByColdCall have been
split out of heuristics itself. Update of the data happens now for each basic
block (before update for PostDominatedByColdCall might be skipped if
unreachable or matadata heuristic handled this basic block).
This separation allows re-ordering of heuristics without loosing
the post-domination information.
Reviewers: sanjoy, junbuml, vsk, chandlerc, reames
Reviewed By: chandlerc
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D31701
llvm-svn: 300029
Martin Pelikan [Wed, 12 Apr 2017 05:30:35 +0000 (05:30 +0000)]
[XRay] [compiler-rt] Refactor rewinding FDR logging.
Summary:
While there, make the threshold in ticks for the rewind computed only
once and not per function, unify the two versions we had and slightly
reformat bits according to coding standards.
Reviewers: dberris
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D31971
llvm-svn: 300028
Bruno Cardoso Lopes [Wed, 12 Apr 2017 04:49:00 +0000 (04:49 +0000)]
[Modules] Remove darwin specific code to check for SystemVersion.plist
This isn't need anymore and modules options -fbuild-session-file and
-fmodules-validate-once-per-build-session already provide a sane
mechanism to validate the system headers.
rdar://problem/
19767523
llvm-svn: 300027
Serguei Katkov [Wed, 12 Apr 2017 04:41:35 +0000 (04:41 +0000)]
[INC] Test commit. NFC.
Just an update of comment.
llvm-svn: 300026
Duncan P. N. Exon Smith [Wed, 12 Apr 2017 03:58:58 +0000 (03:58 +0000)]
Serialization: Simulate -Werror settings in implicit modules
r293123 started serializing diagnostic pragma state for modules. This
makes the serialization work properly for implicit modules.
An implicit module build (using Clang's internal build system) uses the
same PCM file location for different `-Werror` levels.
E.g., if a TU has `-Werror=format` and tries to load a PCM built without
`-Werror=format`, a new PCM will be built in its place (and the new PCM
should have the same signature, since r297655). In the other direction,
if a TU does not have `-Werror=format` and tries to load a PCM built
with `-Werror=format`, it should "just work".
The idea is to evolve the PCM toward the strictest -Werror flags that
anyone tries.
r293123 started serializing the diagnostic pragma state for each PCM.
Since this encodes the -Werror settings at module-build time, it breaks
the implicit build model.
This commit filters the diagnostic state in order to simulate the
current compilation's diagnostic settings. Firstly, it ignores the
module's serialized first diagnostic state, replacing it with the state
from this compilation's command-line. Secondly, if a pragma warning was
upgraded to error/fatal when generating the PCM (e.g., due to `-Werror`
on the command-line), it checks whether it should still be upgraded in
its current context.
llvm-svn: 300025
Duncan P. N. Exon Smith [Wed, 12 Apr 2017 03:45:32 +0000 (03:45 +0000)]
Serialization: Emit the final diagnostic state last, almost NFC
Emit the final diagnostic state last to match source order. This also
prepares for a follow-up commit for implicit modules.
There's no real functionaliy change, just a slightly different AST file
format.
llvm-svn: 300024
Kannan Narayanan [Wed, 12 Apr 2017 03:25:12 +0000 (03:25 +0000)]
[AMDGPU] Add a new pass to insert waitcnts. Leave under an option for testing.
Based on comments in https://reviews.llvm.org/D31161.
llvm-svn: 300023
Kyle Butt [Wed, 12 Apr 2017 03:18:20 +0000 (03:18 +0000)]
CodeGen: BlockPlacement: Clear ComputedEdges between functions.
Not clearing was causing non-deterministic compiles for large files. Addresses
for MachineBasicBlocks would end up colliding and we would lay out a block that
we assumed had been pre-computed when it had not been.
llvm-svn: 300022
Duncan P. N. Exon Smith [Wed, 12 Apr 2017 02:31:17 +0000 (02:31 +0000)]
Serialization: Skip check in WritePragmaDiagnosticMappings, NFC
The record is never empty, since we always serialize the initial state.
Skip the check.
llvm-svn: 300021
Petr Hosek [Wed, 12 Apr 2017 02:28:07 +0000 (02:28 +0000)]
Reland "[CMake][libunwind] Use -nodefaultlibs for CMake checks"
This is a reland of commit r299796.
Turned out that we need gcc_s or compiler-rt on ARM when checking
the support for -funwind-tables which creates a dependency on
__aeabi_unwind_cpp_pr0 symbol that's provided by the compiler
runtime.
Differential Revision: https://reviews.llvm.org/D31858
llvm-svn: 300020
Bob Haarman [Wed, 12 Apr 2017 01:43:07 +0000 (01:43 +0000)]
ThinLTOBitcodeWriter: keep comdats together, rename if leader is renamed
Summary:
COFF requires that every comdat contain a symbol with the same name as
the comdat. ThinLTOBitcodeWriter renames symbols, which may cause this
requirement to be violated. This change avoids such violations by
renaming comdats if their leaders are renamed. It also keeps comdats
together when splitting modules.
Reviewers: pcc, mehdi_amini, tejohnson
Reviewed By: pcc
Subscribers: rnk, Prazek, llvm-commits
Differential Revision: https://reviews.llvm.org/D31963
llvm-svn: 300019
Martin Pelikan [Wed, 12 Apr 2017 01:31:17 +0000 (01:31 +0000)]
[XRay] [compiler-rt] Simplify FDR logging handler. [NFC]
Summary:
Not repeating screamy failure paths makes the 300+ line function a bit shorter.
There's no need to overload the variable name "Buffer" if it only works on the
thread local buffer. Fix some comments while there.
I plan to move the rewinding logic into a separate function too, but in this
diff it would be too much of a mess to comprehend. This is trivially NFC.
Reviewers: kpw, dberris
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D31930
llvm-svn: 300018
Douglas Yung [Wed, 12 Apr 2017 01:24:48 +0000 (01:24 +0000)]
[XRay][compiler-rt] Add another work-around to XRay FDR tests when TSC emulation is needed
This patch applies a work-around to the XRay FDR tests when TSC emulation is
needed because the processor frequency cannot be determined.
This fixes PR32620 using the suggestion given by Dean in comment 1.
Reviewers: dberris
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D31967
llvm-svn: 300017
Derek Schuff [Wed, 12 Apr 2017 01:17:31 +0000 (01:17 +0000)]
Revert "[WebAssembly] Update use of Attributes after r299875"
This reverts commit
2a0eb61dcccb15058d5b2a572bb3da0cf47fd550, r300015
I raced with rnk on the commit.
llvm-svn: 300016
Derek Schuff [Wed, 12 Apr 2017 01:09:34 +0000 (01:09 +0000)]
[WebAssembly] Update use of Attributes after r299875
This fixes the failing WebAssemblyLowerEmscriptenEHSjLj tests
llvm-svn: 300015
Reid Kleckner [Wed, 12 Apr 2017 00:38:00 +0000 (00:38 +0000)]
[IR] Add AttributeSet to hide AttributeSetNode* again, NFC
Summary:
For now, it just wraps AttributeSetNode*. Eventually, it will hold
AvailableAttrs as an inline bitset, and adding and removing enum
attributes will be super cheap.
This sinks AttributeSetNode back down to lib/IR/AttributeImpl.h.
Reviewers: pete, chandlerc
Subscribers: llvm-commits, jfb
Differential Revision: https://reviews.llvm.org/D31940
llvm-svn: 300014
Jim Ingham [Wed, 12 Apr 2017 00:19:54 +0000 (00:19 +0000)]
Teach SBFrame how to guess its language.
<rdar://problem/
31411646>
llvm-svn: 300012
Evgeniy Stepanov [Wed, 12 Apr 2017 00:13:48 +0000 (00:13 +0000)]
[lld] Keep full library path in DT_NEEDED.
Fixes PR32572.
When
(a) a library has no soname
and (b) library is given on the command line with path (and not through -L/-l flags)
DT_NEEDED entry for such library keeps the path as given.
This behavior is consistent with gold and bfd, and is used in compiler-rt test suite.
This is a second attempt after r300007 got reverted. This time relro-omagic test is
changed in a way to avoid hardcoding the path to the test directory in the objdump'd
binary.
llvm-svn: 300011
Kostya Serebryany [Wed, 12 Apr 2017 00:12:34 +0000 (00:12 +0000)]
[msan] fix iconv interceptor. before the fix the interceptor failed to mark memory as initialized if iconv returned -1. Found in a hard way while fuzzing libxml2 :(
llvm-svn: 300010
Marshall Clow [Wed, 12 Apr 2017 00:07:29 +0000 (00:07 +0000)]
Add some FAIL constexpr tests for optional's copy/move ctors.
llvm-svn: 300009
Evgeniy Stepanov [Wed, 12 Apr 2017 00:01:21 +0000 (00:01 +0000)]
Revert "[lld] Keep full library path in DT_NEEDED."
This reverts commit r300007. Reason: breaks all the bots.
llvm-svn: 300008
Evgeniy Stepanov [Tue, 11 Apr 2017 23:46:58 +0000 (23:46 +0000)]
[lld] Keep full library path in DT_NEEDED.
Fixes PR32572.
When
(a) a library has no soname
and (b) library is given on the command line with path (and not through -L/-l flags)
DT_NEEDED entry for such library keeps the path as given.
This behavior is consistent with gold and bfd, and is used in compiler-rt test suite.
llvm-svn: 300007
Benjamin Kramer [Tue, 11 Apr 2017 23:06:49 +0000 (23:06 +0000)]
Silence unused variable warning in release builds.
llvm-svn: 300006
Rui Ueyama [Tue, 11 Apr 2017 22:45:57 +0000 (22:45 +0000)]
Remove big-endianness from =<fillexp> code.
llvm-svn: 300005
Rui Ueyama [Tue, 11 Apr 2017 22:45:38 +0000 (22:45 +0000)]
Call getFiller only when filler is not zero.
llvm-svn: 300004
Yi Kong [Tue, 11 Apr 2017 22:39:55 +0000 (22:39 +0000)]
Remove xgene1 from host detection
This is not a supported mcpu tuning option. We should treat it as
"generic" variant.
Also, add record for cortex-a35.
llvm-svn: 300003
Evgeniy Stepanov [Tue, 11 Apr 2017 22:37:54 +0000 (22:37 +0000)]
[lld] --export-dynamic overrides --dynamic-list.
Fixes PR32573.
--export-dynamic exports everything, even in the presence of a --dynamic-list,
or --export-dynamic-symbol.
llvm-svn: 300002
Richard Trieu [Tue, 11 Apr 2017 22:32:03 +0000 (22:32 +0000)]
Revert r298824 & r298816, recommit r298742 & r298754
r299989 fixes the underlying issue by waiting long enough to late parsed
arguments to be processed before doing an calculating the hash.
r298742
[ODRHash] Add error messages for mismatched parameters in methods.
r298754
[ODRHash] Add support for array and decayed types.
llvm-svn: 300001
Matt Arsenault [Tue, 11 Apr 2017 22:29:31 +0000 (22:29 +0000)]
AMDGPU: Insert wait at start of callee functions
llvm-svn: 300000
Matt Arsenault [Tue, 11 Apr 2017 22:29:28 +0000 (22:29 +0000)]
AMDGPU: Refactor SIMachineFunctionInfo slightly
Prepare for handling non-entry functions.
llvm-svn: 299999