Matt Arsenault [Wed, 15 Aug 2018 21:03:44 +0000 (21:03 +0000)]
DAG: Use getObjectOffset helper
llvm-svn: 339813
Simon Pilgrim [Wed, 15 Aug 2018 20:41:19 +0000 (20:41 +0000)]
[TableGen] Remove unnecessary TypeSetByHwMode -> ValueTypeByHwMode -> TypeSetByHwMode conversions in getPatternSize
I noticed this during profiling of tablegen (PR28222) that we were calling Child->getType(0) which creates a ValueTypeByHwMode on the fly from the requested internal TypeSetByHwMode type and returns it by value, we then treat it as a TypeSetByHwMode reference which involves constructing a new TypeSetByHwMode on the stack with a large amount of std::map iterating/copying all along the way.
I am not an expert on tablegen, but AFAICT this is all unnecessary and we should be calling Child->getExtType(0) which returns the original TypeSetByHwMode by reference.
This gives me a 90sec reduction in msvc debug builds of x86 -gen-dag-isel.
Differential Revision: https://reviews.llvm.org/D50789
llvm-svn: 339812
Matt Arsenault [Wed, 15 Aug 2018 20:34:54 +0000 (20:34 +0000)]
DAG: Try to custom lower when promoting float operands
For some reason this wasn't done for floats like
integers.
llvm-svn: 339811
Stephen Kelly [Wed, 15 Aug 2018 20:32:06 +0000 (20:32 +0000)]
Add a newline to SourceLocation dump output
Summary:
Migrate callers to print().
dump() should be useful to downstreams and third parties as a debugging
aid. Everyone trips up on this and creates confusing output.
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D50661
llvm-svn: 339810
Lang Hames [Wed, 15 Aug 2018 20:11:21 +0000 (20:11 +0000)]
[MCJIT] Fix a case of Error::success() being passed to report_fatal_error.
MCJIT::getSymbolAddress was handling a non-fatal error condition of JITSymbol
as fatal. JITSymbol::operator bool returns false if no address is available
but no error is set. This can occur e.g. if the symbol name was not found.
Patch by Jascha Wetzel. Thanks Jascha!
llvm-svn: 339809
David Carlier [Wed, 15 Aug 2018 20:09:52 +0000 (20:09 +0000)]
[CStringSyntaxChecker] Reduces space around error message for strlcat.
llvm-svn: 339808
Chris Bieneman [Wed, 15 Aug 2018 20:09:38 +0000 (20:09 +0000)]
Refactor Darwin driver to refer to runtimes by component
Summary:
In r335809, Petr Hosek lays out support for what he calls the multiarch
runtimes layout. This new way of laying out the directories for runtime
libraries is workable for all platforms. Petr did some of the common
infrastructure and made it work for Linux and Fuscia. This patch is a
cleanup to the Darwin and MachO drivers to serve as a step toward
supporting it in Darwin.
This patch does primarily two things:
(1) Changes the APIs for how the Darwin driver refers to compiler-rt
libraries to use the component names, similar to how Linux and Fuscia do
(2) Removes some legacy functionality for supporting macOS versions
before 10.6. This functionality is effectively dead code because in
r339277, the support was removed from compiler-rt for generating the 10.4
runtime support library, and Xcode 10 (currently in beta) removes
libgcc_s.10.4 and libgcc_s.10.5 from the macOS SDK.
With this patch landed a subsequent patch can modify
MachO::AddLinkRuntimeLib to support the multiarch runtimes layout.
Worth noting: None of the removed functionality was actually covered in
the test suite. So no test case updates are required.
Reviewers: phosek, bruno, arphaman
Reviewed By: phosek, arphaman
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D50618
llvm-svn: 339807
Vitaly Buka [Wed, 15 Aug 2018 20:09:35 +0000 (20:09 +0000)]
Revert "[ARM] Allow signed icmps in ARMCodeGenPrepare"
use-after-poison in check-llvm under asan
This reverts commit r339755.
llvm-svn: 339806
Alexey Bataev [Wed, 15 Aug 2018 19:45:12 +0000 (19:45 +0000)]
[OPENMP] FIx processing of declare target variables.
The compiler may produce unexpected error messages/crashes when declare
target variables were used. Patch fixes problems with the declarations
marked as declare target to or link.
llvm-svn: 339805
Marshall Clow [Wed, 15 Aug 2018 19:27:53 +0000 (19:27 +0000)]
Mark the at_exit and at_quick_exit tests as unsupported under C++98 an 03, since those calls were introduced in C++11. They're already guarded by an ifdef in the code, so this is a 'belt-and-suspenders' change.
llvm-svn: 339804
Daniel Jasper [Wed, 15 Aug 2018 19:07:55 +0000 (19:07 +0000)]
clang-format: Change Google style wrt. the formatting of empty messages.
Before:
message Empty {
}
After:
message Empty {}
llvm-svn: 339803
Lang Hames [Wed, 15 Aug 2018 18:42:11 +0000 (18:42 +0000)]
[Support] Add a basic C API for llvm::Error.
Summary:
The C-API supports consuming errors, converting an error to a string error
message, and querying an error's type. Other LLVM C APIs that wish to use
llvm::Error can supply error-type-id checkers and custom
error-to-structured-type converters for any custom errors they provide.
Reviewers: bogner, zturner, labath, dblaikie
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D50716
llvm-svn: 339802
Thomas Lively [Wed, 15 Aug 2018 18:15:18 +0000 (18:15 +0000)]
[WebAssembly][NFC] Standardize SIMD multiclass format
Summary:
This CL changes the ExtractLane ISEL multiclass to more closely mirror
the structure of the splat and replace_lane multiclasses.
Reviewers: aheejin, dschuff
Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits
Differential Revision: https://reviews.llvm.org/D50794
llvm-svn: 339801
Peter Collingbourne [Wed, 15 Aug 2018 18:05:55 +0000 (18:05 +0000)]
cfi: Remove blacklist entries for libc++.
These functions have had no-CFI annotations in the source code for
a while now.
llvm-svn: 339800
Peter Collingbourne [Wed, 15 Aug 2018 17:58:22 +0000 (17:58 +0000)]
llvm-readobj: Fix addend in relocations for android packed format
If a relocation group doesn't have the RELOCATION_GROUP_HAS_ADDEND_FLAG set, then this implies the group's addend equals zero.
In this case android packed format won't encode an explicit addend delta, instead we need to set Addend, the "previous addend" variable, to zero by ourself.
Patch by Yi-Yo Chiang!
Differential Revision: https://reviews.llvm.org/D50601
llvm-svn: 339799
Thomas Lively [Wed, 15 Aug 2018 17:50:22 +0000 (17:50 +0000)]
[WebAssembly] Test commit
Changes a comment and some whitespace to test commit access.
llvm-svn: 339798
Peter Collingbourne [Wed, 15 Aug 2018 17:49:30 +0000 (17:49 +0000)]
libcxx: Mark __temp_value::__temp_value as _LIBCPP_NO_CFI.
This constructor needs to cast a pointer to uninitialized
memory to a pointer to object type in order to call
allocator_traits::construct(). This cast is not allowed when CFI cast
checks are enabled.
I did this instead of marking __addr() as _LIBCPP_NO_CFI so that we
don't lose CFI checks on get() or the dtor.
Differential Revision: https://reviews.llvm.org/D50743
llvm-svn: 339797
Amara Emerson [Wed, 15 Aug 2018 17:46:22 +0000 (17:46 +0000)]
[InstCombine] Fix IC trying to create a xor of pointer types.
rdar://
42473741
Differential Revision: https://reviews.llvm.org/D50775
llvm-svn: 339796
Alina Sbirlea [Wed, 15 Aug 2018 17:34:55 +0000 (17:34 +0000)]
[MemorySSA] Expose the verify as a debug option.
Summary: Expose VerifyMemorySSA as a debug option. If set, passes will call the MSSA->verifyMemorySSA() after calling into the updater's APIs when MemorySSA should be valid.
Reviewers: george.burgess.iv
Subscribers: sanjoy, jlebar, Prazek, llvm-commits
Differential Revision: https://reviews.llvm.org/D50749
llvm-svn: 339795
Dimitry Andric [Wed, 15 Aug 2018 17:30:32 +0000 (17:30 +0000)]
For FreeBSD, don't define _M in nasty_macros.hpp
Because FreeBSD uses _M in its <sys/types.h>, and it is hard to avoid
including that header, only define _M to NASTY_MACRO for other operating
systems. This fixes almost 2000 unexpected test failures.
Discussed with Eric Fiselier.
llvm-svn: 339794
Sanjay Patel [Wed, 15 Aug 2018 17:06:21 +0000 (17:06 +0000)]
[AArch64] add tests for poor vector intrinsic lowering via legalization (PR38527); NFC
These correspond to the x86 tests added with rL339790 / rL339791, but I widened
the non-fsin tests to v3f32 to show the problem because AArch supports v2f32 ops.
llvm-svn: 339793
Krzysztof Parzyszek [Wed, 15 Aug 2018 17:04:58 +0000 (17:04 +0000)]
[RegisterCoalescer] Ensure that both registers have subranges if one does
llvm-svn: 339792
Sanjay Patel [Wed, 15 Aug 2018 16:56:09 +0000 (16:56 +0000)]
[x86] add fabs test for vector intrinsic to potential libcall bug; NFC
This is a negative test for x86 because it has custom lowering for fabs.
llvm-svn: 339791
Sanjay Patel [Wed, 15 Aug 2018 16:35:50 +0000 (16:35 +0000)]
[x86] add tests for poor vector intrinsic lowering via legalization (PR38527); NFC
llvm-svn: 339790
Bruno Ricci [Wed, 15 Aug 2018 16:28:58 +0000 (16:28 +0000)]
[AST] Pack the unsigned of PackExpansionType into Type
The bit-fields of `Type` have enough space for
the `unsigned NumExpansions` of `PackExpansionType`
Reviewed By: erichkeane
Differential Revision: https://reviews.llvm.org/D50711
llvm-svn: 339789
Krzysztof Parzyszek [Wed, 15 Aug 2018 16:21:53 +0000 (16:21 +0000)]
[RegisterCoalescer] Reset VNInfo def when copying segments over
llvm-svn: 339788
Bruno Ricci [Wed, 15 Aug 2018 16:21:17 +0000 (16:21 +0000)]
[AST] Pack the bits of TemplateSpecializationType into Type
Type has enough space for two members of
TemplateSpecializationType. Mechanical patch.
Reviewed By: erichkeane
Differential Revision: https://reviews.llvm.org/D50643
llvm-svn: 339787
Derek Schuff [Wed, 15 Aug 2018 16:18:51 +0000 (16:18 +0000)]
[WebAssembly] SIMD replace_lane
Implement and test replace_lane instructions.
Patch by Thomas Lively
Differential Revision: https://reviews.llvm.org/D50750
llvm-svn: 339786
Julie Hockett [Wed, 15 Aug 2018 16:18:46 +0000 (16:18 +0000)]
[clang-doc] Explicitly cast to unique_ptr
Older compilers don't like the implicit cast & move when returning a
unique_ptr to an llvm::Expected type.
llvm-svn: 339785
Krzysztof Parzyszek [Wed, 15 Aug 2018 16:07:47 +0000 (16:07 +0000)]
[RegAlloc] Check that subreg liveness tracking applies to given virtual reg
Subregister liveness applies selectively to register classes with certain
properties. Make sure that when it's enabled, it applies to a given virtual
register (in virtual register rewriter).
llvm-svn: 339784
Julie Hockett [Wed, 15 Aug 2018 16:02:28 +0000 (16:02 +0000)]
Reland "[clang-doc] Updating BitcodeReader to use llvm::Error""
With explicit unique_ptr casts so that bots with older compilers don't
break.
llvm-svn: 339783
Jan Korous [Wed, 15 Aug 2018 15:58:05 +0000 (15:58 +0000)]
[clangd][tests] Rename tests of clangd instance termination
Just making testnames better reflect their testing scenarios.
Differential Revision: https://reviews.llvm.org/D50641
llvm-svn: 339782
Jan Korous [Wed, 15 Aug 2018 15:50:45 +0000 (15:50 +0000)]
[clangd][tests] Fix typo in tests - invalid LSP exit message
Syntactically invalid JSON payload was causing clangd to terminate because of unexpected EOF rather than exit as a response to LSP exit message.
Differential Revision: https://reviews.llvm.org/D50641
llvm-svn: 339781
Krzysztof Parzyszek [Wed, 15 Aug 2018 15:43:13 +0000 (15:43 +0000)]
[SystemZ] Add testcase for r339778
llvm-svn: 339780
Nemanja Ivanovic [Wed, 15 Aug 2018 15:30:36 +0000 (15:30 +0000)]
[PowerPC] Enhance the selection(ISD::VSELECT) of vector type
To make ISD::VSELECT available(legal) so long as there are altivec instruction,
otherwise it's default behavior is expanding.
Use xxsel to match vselect if vsx is open, or use vsel.
In order to do not write many patterns in td file, promote (for vector it's
bitcast) all other type into v4i32 and only pattern match vselect of v4i32 into
vsel or xxsel.
Patch by wuzish
Differential revision: https://reviews.llvm.org/D49531
llvm-svn: 339779
Krzysztof Parzyszek [Wed, 15 Aug 2018 15:21:23 +0000 (15:21 +0000)]
[SystemZ] Replace subreg_r with subreg_h
Change
subreg_r32 -> subreg_h32
subreg_r64 -> subreg_h64
subreg_hr32 -> subreg_hh32
The subregisters subreg_r32 and subreg_r64 were added to emphasize the
fact that modifying these subregisters may clobber the entire register.
This is not necessarily the case for subreg_h32, et al.
However, the ability to compose subreg_h64 with subreg_r32, and with
subreg_h32 and subreg_l32 at the same time makes the compositions be
treated as non-overlapping (leading to problems when tracking subreg
liveness). See D50468 for more details.
Differential Revision: https://reviews.llvm.org/D50725
llvm-svn: 339778
Marcello Maggioni [Wed, 15 Aug 2018 15:06:53 +0000 (15:06 +0000)]
[GVN] Fix typo in IsValueFullyAvailableInBlock. NFC.
DenseMap insert() method return a pair<iterator, bool>
not pair<iterator, char>
Noticed it and thought I might just fix it ...
llvm-svn: 339777
Jonas Paulsson [Wed, 15 Aug 2018 15:04:49 +0000 (15:04 +0000)]
[SystemZ] New CL option to enable subreg liveness
This option is needed to enable subreg liveness tracking during register
allocation.
Review: Ulrich Weigand
https://reviews.llvm.org/D50779
llvm-svn: 339776
George Rimar [Wed, 15 Aug 2018 14:59:38 +0000 (14:59 +0000)]
[LLD][ELF] - Stop using binary input in merge-invalid-size.s test. NFCI.
This rewrites the test using yaml.
llvm-svn: 339775
George Rimar [Wed, 15 Aug 2018 14:10:15 +0000 (14:10 +0000)]
[LLD][ELF] - Convert binary input to yaml in sht-group.s test. NFC.
This removes test that used binary input and adds a yaml based test instead.
llvm-svn: 339774
Chijun Sima [Wed, 15 Aug 2018 13:56:21 +0000 (13:56 +0000)]
[SimplifyCFG] Remove pointer from SmallPtrSet before deletion
Summary:
Previously, `eraseFromParent()` calls `delete` which invalidates the value of the pointer. Copying the value of the pointer later is undefined behavior in C++11 and implementation-defined (which may cause a segfault on implementations having strict pointer safety) in C++14.
This patch removes the BasicBlock pointer from related SmallPtrSet before `delete` invalidates it in the SimplifyCFG pass.
Reviewers: kuhar, dmgreen, davide, trentxintong
Reviewed By: kuhar, dmgreen
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D50717
llvm-svn: 339773
George Rimar [Wed, 15 Aug 2018 13:55:22 +0000 (13:55 +0000)]
[yaml2obj] - Teach yaml2obj to produce SHT_GROUP section with a custom Info field.
This allows to set custom Info field value for SHT_GROUP sections.
It is useful to allow this because we would be able to replace at least one binary
object committed in LLD and replace it with the yaml2obj based test.
Differential revision: https://reviews.llvm.org/D50776
llvm-svn: 339772
Joachim Protze [Wed, 15 Aug 2018 13:54:28 +0000 (13:54 +0000)]
[OMPT] Remove OMPT idle callback
The idle callback was removed from the spec as of TR7.
This removes it from the implementation.
Patch provided by Simon Convent
Reviewers: hbae, protze.joachim
Differential Revision: https://reviews.llvm.org/D48362
llvm-svn: 339771
Sam Parker [Wed, 15 Aug 2018 13:29:50 +0000 (13:29 +0000)]
[ARM] TypeSize lower bound for ARMCodeGenPrepare
We only try to promote types with are smaller than 16-bits, but we
also need to check that the type is not less than 8-bits.
Differential Revision: https://reviews.llvm.org/D50769
llvm-svn: 339770
Nemanja Ivanovic [Wed, 15 Aug 2018 12:58:13 +0000 (12:58 +0000)]
[PowerPC] Don't run BV DAG Combine before legalization if it assumes legal types
When trying to combine a DAG that builds a vector out of sign-extensions of
vector extracts, the code assumes legal input types. Due to that, we have to
disable this combine prior to legalization.
In some cases, the DAG will look slightly different after legalization so
account for that in the matching code.
This is a fix for https://bugs.llvm.org/show_bug.cgi?id=38087
Differential Revision: https://reviews.llvm.org/D49080
llvm-svn: 339769
Andrea Di Biagio [Wed, 15 Aug 2018 12:53:38 +0000 (12:53 +0000)]
[llvm-mca] Fix PR38575: Avoid an invalid implicit truncation of a processor resource mask (an uint64_t value) to unsigned.
This patch fixes a regression introduced at revision 338702.
A processor resource mask was incorrectly implicitly truncated to an unsigned
quantity. Later on, the truncated mask was used to initialize an element of a
vector of processor resource descriptors.
On targets with more than 32 processor resources, some elements of the vector
are left uninitialized. As a consequence, this bug might have eventually caused
a crash due to null dereference in the Scheduler.
This patch fixes PR38575, and adds a test for it.
llvm-svn: 339768
Simon Pilgrim [Wed, 15 Aug 2018 12:32:09 +0000 (12:32 +0000)]
Remove lambda default argument to fix gcc pedantic warning.
llvm-svn: 339767
Momchil Velikov [Wed, 15 Aug 2018 12:22:08 +0000 (12:22 +0000)]
Use .cpp extension for certain tests instead of .cc
The tests `CodeGen/aapcs[64]-align.cc` are not run since files with a `.cc`
suffix aren't recognisze as tests. This patch renames the above two files to
`.cpp`.
Differential Revision: https://reviews.llvm.org/D46013
Comitting as obvious.
llvm-svn: 339766
George Rimar [Wed, 15 Aug 2018 12:20:38 +0000 (12:20 +0000)]
[LLD][ELF] - Handle SHT_GROUP more carefully. NFCI.
This patch solves 2 problems:
1) It adds a test to check the line below:
https://github.com/llvm-mirror/lld/blob/master/ELF/InputFiles.cpp#L334
Test case contains SHT_GROUP section with a broken (0xFF) flag.
2) The patch fixes the case when we silently accepted such broken groups
in the case when there were no other objects with the same group signature.
llvm-svn: 339765
George Rimar [Wed, 15 Aug 2018 11:43:00 +0000 (11:43 +0000)]
[yaml2obj] - Teach tool to produce SHT_GROUP section with a custom type.
Currently, it is possible to use yaml2obj for producing SHT_GROUP sections
of type GRP_COMDAT. For LLD test case I need to produce an object with
a broken (different from GRP_COMDAT) type.
The patch teaches tool to do such things.
Differential revision: https://reviews.llvm.org/D50761
llvm-svn: 339764
Simon Pilgrim [Wed, 15 Aug 2018 11:11:05 +0000 (11:11 +0000)]
[TargetLowering] Minor cleanup of TargetLowering::BuildSDIV. NFCI.
Pull out some types to match layout in TargetLowering::BuildUDIV. Early step towards adding non-uniform vector support.
llvm-svn: 339763
David Green [Wed, 15 Aug 2018 10:59:41 +0000 (10:59 +0000)]
[UnJ] Rename hasInvariantIterationCount to hasIterationCountInvariantInParent NFC
This hopefully describes the API of the function more precisely.
llvm-svn: 339762
Simon Pilgrim [Wed, 15 Aug 2018 10:59:29 +0000 (10:59 +0000)]
[X86][SSE] Add sdiv by nonuniform constant vector tests
Tests cover each TargetLowering::BuildSDIV path separately plus combos
llvm-svn: 339761
Aleksandr Urakov [Wed, 15 Aug 2018 10:54:06 +0000 (10:54 +0000)]
[X86] Add sibling-call test cases
This commit adds new sibling-call test cases, so it will be possible to see
how these test cases will be changed after applying D45653.
See D45653 for details.
llvm-svn: 339760
David Green [Wed, 15 Aug 2018 10:39:43 +0000 (10:39 +0000)]
Fix ASTMatchersTraversalTest testcase compile on older compilers
Some versions of gcc, especially when invoked through ccache (-E), can have
trouble with raw string literals inside macros. This moves the string out of
the macro.
llvm-svn: 339759
Simon Pilgrim [Wed, 15 Aug 2018 10:11:13 +0000 (10:11 +0000)]
[TargetLowering] Minor refactor to TargetLowering::BuildUDIV to merge scalar/vector magic value collection. NFCI.
Use the same ISD::matchUnaryPredicate pattern that was used in D50392.
llvm-svn: 339758
Simon Pilgrim [Wed, 15 Aug 2018 10:02:54 +0000 (10:02 +0000)]
[DagCombiner] Don't bother adding to the work list if TLI.BuildSDIVPow2 failed. NFCI.
Matches the code in BuildSDIV/BuildUDIV
llvm-svn: 339757
Simon Pilgrim [Wed, 15 Aug 2018 09:35:12 +0000 (09:35 +0000)]
[TargetLowering] Add support for non-uniform vectors to BuildExactSDIV
This patch refactors the existing BuildExactSDIV implementation to support non-uniform constant vector denominators.
Differential Revision: https://reviews.llvm.org/D50392
llvm-svn: 339756
Sam Parker [Wed, 15 Aug 2018 08:23:03 +0000 (08:23 +0000)]
[ARM] Allow signed icmps in ARMCodeGenPrepare
Treat signed icmps as 'sinks', allowing them to be in the use-def
tree, enabling more promotions to be performed. As a sink, any
promoted incoming values need to be truncated before being used by
the signed icmp.
Differential Revision: https://reviews.llvm.org/D50067
llvm-svn: 339755
Sam Parker [Wed, 15 Aug 2018 07:52:35 +0000 (07:52 +0000)]
[ARM] Allow pointer values in ARMCodeGenPrepare
Add pointers to the list of allowed types, but don't try to promote
them. Also fixed a bug with the promotion of undef values, so a new
value is now created instead of mutating in place. We also now only
promote if there's an instruction in the use-def chains other than
the icmp, sinks and sources.
Differential Revision: https://reviews.llvm.org/D50054
llvm-svn: 339754
Max Kazantsev [Wed, 15 Aug 2018 06:21:02 +0000 (06:21 +0000)]
[AliasSetTracker] Do not treat experimental_guard intrinsic as memory writing instruction
The `experimental_guard` intrinsic has memory write semantics to model the thread-exiting
logic, but does not do any actual writes to memory. Currently, `AliasSetTracker` treats it as a
normal memory write. As result, a loop-invariant load cannot be hoisted out of loop because
the guard may possibly alias with it.
This patch makes `AliasSetTracker` so that it doesn't treat guards as memory writes.
Differential Revision: https://reviews.llvm.org/D50497
Reviewed By: reames
llvm-svn: 339753
Max Kazantsev [Wed, 15 Aug 2018 05:55:43 +0000 (05:55 +0000)]
[NFC] Refactoring of LoopSafetyInfo, step 1
Turn structure into class, encapsulate methods, add clarifying comments.
Differential Revision: https://reviews.llvm.org/D50693
Reviewed By: reames
llvm-svn: 339752
Max Kazantsev [Wed, 15 Aug 2018 05:50:38 +0000 (05:50 +0000)]
[NFC] Add sanitizing assertion to ICF tracker
llvm-svn: 339751
Max Kazantsev [Wed, 15 Aug 2018 02:49:12 +0000 (02:49 +0000)]
[NFC][LICM] Make hoist method void
Method hoist always returns true. This patch makes it void.
Differential Revision: https://reviews.llvm.org/D50696
Reviewed By: hiraditya
llvm-svn: 339750
Craig Topper [Wed, 15 Aug 2018 01:23:00 +0000 (01:23 +0000)]
[X86] Change legacy SSE scalar fp to integer intrinsics to use specific ISD opcodes instead of keeping as intrinsics. Unify SSE and AVX512 isel patterns.
AVX512 added new versions of these intrinsics that take a rounding mode. If the rounding mode is 4 the new intrinsics are equivalent to the old intrinsics.
The AVX512 intrinsics were being lowered to ISD opcodes, but the legacy SSE intrinsics were left as intrinsics. This resulted in the AVX512 instructions needing separate patterns for the ISD opcodes and the legacy SSE intrinsics.
Now we convert SSE intrinsics and AVX512 intrinsics with rounding mode 4 to the same ISD opcode so we can share the isel patterns.
llvm-svn: 339749
Chandler Carruth [Wed, 15 Aug 2018 01:22:50 +0000 (01:22 +0000)]
[SDAG] Update the AVR backend for the SelectionDAG API changes in
r339740, fixing the build for this target.
llvm-svn: 339748
Richard Smith [Wed, 15 Aug 2018 01:06:30 +0000 (01:06 +0000)]
Silence "unused variable" warning.
llvm-svn: 339747
Evgeniy Stepanov [Wed, 15 Aug 2018 00:39:35 +0000 (00:39 +0000)]
[hwasan] Add a basic API.
Summary:
Add user tag manipulation functions:
__hwasan_tag_memory
__hwasan_tag_pointer
__hwasan_print_shadow (very simple and ugly, for now)
Reviewers: vitalybuka, kcc
Subscribers: kubamracek, hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D50746
llvm-svn: 339746
Artem Dergachev [Wed, 15 Aug 2018 00:33:55 +0000 (00:33 +0000)]
[analyzer] Add support for constructors of arguments.
Once CFG-side support for argument construction contexts landed in r338436,
the analyzer could make use of them to evaluate argument constructors properly.
When evaluated as calls, constructors of arguments now use the variable region
of the parameter as their target. The corresponding stack frame does not yet
exist when the parameter is constructed, and this stack frame is created
eagerly.
Construction of functions whose body is unavailable and of virtual functions
is not yet supported. Part of the reason is the analyzer doesn't consistently
use canonical declarations o identify the function in these cases, and every
re-declaration or potential override comes with its own set of parameter
declarations. Also it is less important because if the function is not
inlined, there's usually no benefit in inlining the argument constructor.
Differential Revision: https://reviews.llvm.org/D49443
llvm-svn: 339745
Derek Schuff [Wed, 15 Aug 2018 00:30:27 +0000 (00:30 +0000)]
[WebAssembly] SIMD Splats
Implement and test SIMD splat ops.
Patch by Thomas Lively
Differential Revision: https://reviews.llvm.org/D50741
llvm-svn: 339744
Louis Dionne [Wed, 15 Aug 2018 00:30:03 +0000 (00:30 +0000)]
[libcxx] Fix XFAILs for aligned allocation tests on older OSX versions
Summary:
Since r338934, Clang emits an error when aligned allocation functions are
used in conjunction with a system libc++ dylib that does not support those
functions. This causes some tests to fail when testing against older libc++
dylibs. This commit marks those tests as UNSUPPORTED, and also documents the
various reasons for the tests being unsupported.
Reviewers: vsapsai, EricWF
Subscribers: christof, dexonsmith, cfe-commits, mclow.lists, EricWF
Differential Revision: https://reviews.llvm.org/D50341
llvm-svn: 339743
Louis Dionne [Wed, 15 Aug 2018 00:18:01 +0000 (00:18 +0000)]
[libc++] Disable failing C11 feature tests for <cfloat> and <float.h>
Summary:
Those tests are breaking the test bots. A Bugzilla has been filed to
make sure those tests are re-enabled: https://bugs.llvm.org/show_bug.cgi?id=38572
Reviewers: mclow.lists, EricWF
Subscribers: krytarowski, christof, dexonsmith, cfe-commits
Differential Revision: https://reviews.llvm.org/D50748
llvm-svn: 339742
Louis Dionne [Wed, 15 Aug 2018 00:16:41 +0000 (00:16 +0000)]
[libc++] Detect C11 features on non-Clang compilers
Summary:
The macros were inside `#if defined(_LIBCPP_COMPILER_CLANG)`, which means
we would never detect C11 features on non-Clang compilers. According to
Marshall Clow, this is not the intended behavior.
Reviewers: mclow.lists, EricWF
Subscribers: krytarowski, christof, dexonsmith, cfe-commits
Differential Revision: https://reviews.llvm.org/D50748
llvm-svn: 339741
Chandler Carruth [Tue, 14 Aug 2018 23:30:32 +0000 (23:30 +0000)]
[SDAG] Remove the reliance on MI's allocation strategy for
`MachineMemOperand` pointers attached to `MachineSDNodes` and instead
have the `SelectionDAG` fully manage the memory for this array.
Prior to this change, the memory management was deeply confusing here --
The way the MI was built relied on the `SelectionDAG` allocating memory
for these arrays of pointers using the `MachineFunction`'s allocator so
that the raw pointer to the array could be blindly copied into an
eventual `MachineInstr`. This creates a hard coupling between how
`MachineInstr`s allocate their array of `MachineMemOperand` pointers and
how the `MachineSDNode` does.
This change is motivated in large part by a change I am making to how
`MachineFunction` allocates these pointers, but it seems like a layering
improvement as well.
This would run the risk of increasing allocations overall, but I've
implemented an optimization that should avoid that by storing a single
`MachineMemOperand` pointer directly instead of allocating anything.
This is expected to be a net win because the vast majority of uses of
these only need a single pointer.
As a side-effect, this makes the API for updating a `MachineSDNode` and
a `MachineInstr` reasonably different which seems nice to avoid
unexpected coupling of these two layers. We can map between them, but we
shouldn't be *surprised* at where that occurs. =]
Differential Revision: https://reviews.llvm.org/D50680
llvm-svn: 339740
Alex Lorenz [Tue, 14 Aug 2018 22:27:03 +0000 (22:27 +0000)]
[clangd] update the new test to check for diagnostic's category as well
llvm-svn: 339739
Alex Lorenz [Tue, 14 Aug 2018 22:21:40 +0000 (22:21 +0000)]
[clangd] add an extension field to LSP to transfer the diagnostic's category
This patch adds a 'category' extension field to the LSP diagnostic that's sent
by Clangd. This extension is always on by default.
Differential Revision: https://reviews.llvm.org/D50571
llvm-svn: 339738
Alex Lorenz [Tue, 14 Aug 2018 22:20:35 +0000 (22:20 +0000)]
[clangd] add missing test from r339454
I forgot to checkin the test for the fixits into SVN.
llvm-svn: 339737
Heejin Ahn [Tue, 14 Aug 2018 22:14:51 +0000 (22:14 +0000)]
[WebAssembly] Delete a specific push number from test expectations
Summary:
This shouldn't have been a specific number but rather a regex. This was
a part of rL339474 which got reverted.
Reviewers: aardappel
Subscribers: dschuff, sbc100, jgravelle-google, sunfish, llvm-commits
Differential Revision: https://reviews.llvm.org/D50728
llvm-svn: 339736
Cameron McInally [Tue, 14 Aug 2018 22:13:11 +0000 (22:13 +0000)]
[FPEnv] Scalarize StrictFP vector operations
Add a helper function to scalarize constrained FP operations as needed.
Differential Revision: https://reviews.llvm.org/D50720
llvm-svn: 339735
Eli Friedman [Tue, 14 Aug 2018 22:10:25 +0000 (22:10 +0000)]
[ARM] Make PerformSHLSimplify add nodes to the DAG worklist correctly.
Intentionally excluding nodes from the DAGCombine worklist is likely to
lead to weird optimizations and infinite loops, so it's generally a bad
idea.
To avoid the infinite loops, fix DAGCombine to use the
isDesirableToCommuteWithShift target hook before performing the
transforms in question, and implement the target hook in the ARM backend
disable the transforms in question.
Fixes https://bugs.llvm.org/show_bug.cgi?id=38530 . (I don't have a
reduced testcase for that bug. But we should have sufficient test
coverage for PerformSHLSimplify given that we're not playing weird
tricks with the worklist. I can try to bugpoint it if necessary,
though.)
Differential Revision: https://reviews.llvm.org/D50667
llvm-svn: 339734
Matt Morehouse [Tue, 14 Aug 2018 22:04:34 +0000 (22:04 +0000)]
[SanitizerCoverage] Add associated metadata to PC guards.
Summary:
Without this metadata LLD strips unused PC table entries
but won't strip unused guards. This metadata also seems
to influence the linker to change the ordering in the PC
guard section to match that of the PC table section.
The libFuzzer runtime library depends on the ordering
of the PC table and PC guard sections being the same. This
is not generally guaranteed, so we may need to redesign
PC tables/guards/counters in the future.
Reviewers: eugenis
Reviewed By: eugenis
Subscribers: kcc, hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D50483
llvm-svn: 339733
Vlad Tsyrklevich [Tue, 14 Aug 2018 21:38:50 +0000 (21:38 +0000)]
SafeStack: Disable Darwin support
SafeStack support for Darwin has not been functional and was disabled in
r339719/r339720. Disable Darwin for the safestack debuginfo test.
llvm-svn: 339732
Stephen Kelly [Tue, 14 Aug 2018 21:34:29 +0000 (21:34 +0000)]
Remove obsolete comment
This related to the code as first checked in in r266292 ([ASTImporter]
Implement some expression-related AST node import., 2016-04-14).
llvm-svn: 339731
Stephen Kelly [Tue, 14 Aug 2018 21:33:28 +0000 (21:33 +0000)]
Fix Stmt::ignoreImplicit
Summary:
A CXXBindTemporaryExpr can appear inside an ImplicitCastExpr, and was
not ignored previously.
Fixes the case reported in PR37327.
Reviewers: rsmith, dblaikie, klimek
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D50666
llvm-svn: 339730
Stephen Kelly [Tue, 14 Aug 2018 21:25:49 +0000 (21:25 +0000)]
Remove vestiges of configure buildsystem
Subscribers: mgorny, llvm-commits
Differential Revision: https://reviews.llvm.org/D50528
llvm-svn: 339729
Reid Kleckner [Tue, 14 Aug 2018 21:15:57 +0000 (21:15 +0000)]
Fix lit fatal errors about requiring a USE_Z3_SOLVER param
llvm-svn: 339728
Artem Dergachev [Tue, 14 Aug 2018 21:10:46 +0000 (21:10 +0000)]
[CFG] [analyzer] Find argument constructors in CXXTemporaryObjectExprs.
CXXTemporaryObjectExpr is a sub-class of CXXConstructExpr. If it has arguments
that are structures passed by value, their respective constructors need to be
handled by providing a ConstructionContext, like for regular function calls and
for regular constructors.
Differential Revision: https://reviews.llvm.org/D50487
llvm-svn: 339727
Artem Dergachev [Tue, 14 Aug 2018 21:06:30 +0000 (21:06 +0000)]
[analyzer] Add a test forgotten in r339088.
Differential Revision: https://reviews.llvm.org/D50363
llvm-svn: 339726
Alina Sbirlea [Tue, 14 Aug 2018 20:49:19 +0000 (20:49 +0000)]
Add proper headers in CFGUpdate.h and add CFGDiff.h in the list of delayed headers for LLVM_intrinsic_gen.
Summary:
Fix module build after r339694.
Add headers needed in CFGUpdate.h.
Add CFGDiff.h in the list of delayed headers for LLVM_intrinsic_gen.
Up for post-commit review.
Subscribers: sanjoy, jlebar, llvm-commits
Differential Revision: https://reviews.llvm.org/D50734
llvm-svn: 339724
Vlad Tsyrklevich [Tue, 14 Aug 2018 20:28:58 +0000 (20:28 +0000)]
Reland "SafeStack: Delay thread stack clean-up""
This relands commit r339405 (reverted in commit r339408.) The original
revert was due to tests failing on a darwin buildbot; however, after
looking at the affected code more I realized that the Darwin safestack
support has always been broken and disabled it in r339719. This relands
the original commit.
llvm-svn: 339723
Anna Thomas [Tue, 14 Aug 2018 20:25:13 +0000 (20:25 +0000)]
NFC: Clarify comment in loop vectorization legality
Clarifying the comment about PSCEV and external IV users by referencing
the bug in question.
llvm-svn: 339722
Craig Topper [Tue, 14 Aug 2018 20:21:05 +0000 (20:21 +0000)]
[InlineAsm] Update the min-legal-vector-width function attribute based on inputs and outputs to inline assembly
Summary:
Another piece of my ongoing to work for prefer-vector-width.
min-legal-vector-width will eventually be used by the X86 backend to know whether it needs to make 512 bits type legal when prefer-vector-width=256. If the user used inline assembly that passed in/out a 512-bit register, we need to make sure 512 bits are considered legal. Otherwise we'll get an assert failure when we try to wire up the inline assembly to the rest of the code.
This patch just checks the LLVM IR types to see if they are vectors and then updates the attribute based on their total width. I'm not sure if this is the best way to do this or if there's any subtlety I might have missed. So if anyone has other opinions on how to do this I'm open to suggestions.
Reviewers: chandlerc, rsmith, rnk
Reviewed By: rnk
Subscribers: eraman, cfe-commits
Differential Revision: https://reviews.llvm.org/D50678
llvm-svn: 339721
Vlad Tsyrklevich [Tue, 14 Aug 2018 19:50:41 +0000 (19:50 +0000)]
SafeStack: Disable Darwin support
Summary:
Darwin support does not appear to be used as evidenced by the fact that
the runtime has never supported non-trivial programs.
Reviewers: pcc, kubamracek
Reviewed By: pcc
Subscribers: cfe-commits, kcc
Differential Revision: https://reviews.llvm.org/D50724
llvm-svn: 339720
Vlad Tsyrklevich [Tue, 14 Aug 2018 19:46:16 +0000 (19:46 +0000)]
SafeStack: Disable Darwin support
Summary:
Darwin support does not appear to be used as evidenced by the fact that
the pthread interceptors have never worked and there is no support for
other common threading mechanisms like GCD.
Reviewers: pcc, eugenis, kubamracek
Reviewed By: pcc, kubamracek
Subscribers: kubamracek, mgorny, delcypher, llvm-commits, #sanitizers, kcc
Differential Revision: https://reviews.llvm.org/D50718
llvm-svn: 339719
Stefan Granitz [Tue, 14 Aug 2018 19:38:54 +0000 (19:38 +0000)]
Remove asseration from ConstString::GetConstCStringAndSetMangledCounterPart() to fix more tests first
llvm-svn: 339716
Raphael Isemann [Tue, 14 Aug 2018 19:36:58 +0000 (19:36 +0000)]
Stability improvements for CompletionTest
Summary:
CompletionTest.DirCompletionAbsolute had a random failure on a CI node
(in the failure, the completion count was 0, while we expected it to be 1),
but there seems no good reason for it to fail. The sanitizers don't complain
about the test when it's run, so I think we don't have some uninitialized
memory that we access here.
My best bet is that the unique directory selection randomly failed on the CI
node because maybe the FS there doesn't actually guarantee the atomic fopen
assumptions we make in the LLVM code (or some other funny race condition).
In this case a different test run could get the same directory and clean its contents
which would lead to 0 results.
The other possible explanation is that someone changed the CI configuration
on the node and changed the working dir to something very long, which would
make our PATH_MAX test fail (which also leads to 0 results), but I think that case
is unlikely.
This patch is just a stab in the dark that (hopefully) fixes this random failure by
giving each test a (more) unique working directory by appending the unique
test name to the temp-dir prefix. Also adds one more ASSERT_NO_ERROR to
one of our chdir calls just in case that is the reason for failing.
The good thing is that this refactor gets rid of most of the static variables
and files that we previously had as shared state between the different tests.
Potentially fixes rdar://problem/
43150260
Reviewers: aprantl
Reviewed By: aprantl
Subscribers: jfb, lldb-commits
Differential Revision: https://reviews.llvm.org/D50722
llvm-svn: 339715
Adrian Prantl [Tue, 14 Aug 2018 19:35:34 +0000 (19:35 +0000)]
[DebugInfoMetadata] Added DIFlags interface in DIBasicType.
Flags in DIBasicType will be used to pass attributes used in
DW_TAG_base_type, such as DW_AT_endianity.
Patch by Chirag Patel!
Differential Revision: https://reviews.llvm.org/D49610
llvm-svn: 339714
Sanjay Patel [Tue, 14 Aug 2018 19:13:07 +0000 (19:13 +0000)]
[InstCombine] fix typos in tests; NFC
See D50036.
llvm-svn: 339713
Heejin Ahn [Tue, 14 Aug 2018 19:10:50 +0000 (19:10 +0000)]
[WebAssembly] SIMD encoding tests
Modifies existing SIMD tests to also check that SIMD instructions are
lowered to the expected bytes. This CL depends on D50597.
Reviewers: aheejin
Subscribers: sunfish, jgravelle-google, sbc100, llvm-commits
Differential Revision: https://reviews.llvm.org/D50660
Patch by Thomas Lively (tlively)
llvm-svn: 339712
Sanjay Patel [Tue, 14 Aug 2018 19:05:37 +0000 (19:05 +0000)]
[InstCombine] add tests for pow->sqrt; NFC
D50036 should fix the missed optimizations.
llvm-svn: 339711