Nirav Dave [Tue, 5 Jun 2018 03:16:28 +0000 (03:16 +0000)]
[RegAllocGreedy] Use simpler map class for EvicteeInfo. NFCI.
RegAlloc keeps a insertion-time ordered map of evictee information,
but we only use membership. Replace MapVector with contextually
equivalent DenseMap which is smaller and faster.
llvm-svn: 333981
Craig Topper [Tue, 5 Jun 2018 03:12:14 +0000 (03:12 +0000)]
[X86] Mark all the builtins and intrinsics that require MMX and an SSE feature as requiring both mmx and the sse feature.
Previously we only checked the sse feature, but this means that if you passed -mno-mmx, the builtins/intrinsics wouldn't be disabled in the frontend and would instead fail backend isel.
llvm-svn: 333980
Petr Hosek [Tue, 5 Jun 2018 01:50:59 +0000 (01:50 +0000)]
[Driver][Fuchsia] Pass LTO flags to linker
Even though we use lld by default for Fuchsia, we use Gold plugin
arguments like all other drivers as lld supports Gold plugin options.
Differential Revision: https://reviews.llvm.org/D47668
llvm-svn: 333979
Reid Kleckner [Tue, 5 Jun 2018 01:33:40 +0000 (01:33 +0000)]
Reimplement the bittest intrinsic family as builtins with inline asm
We need to implement _interlockedbittestandset as a builtin for
windows.h, so we might as well do the whole family. It reduces code
duplication anyway.
Fixes PR33188, a long standing bug in our bittest implementation
encountered by Chakra.
llvm-svn: 333978
Vedant Kumar [Tue, 5 Jun 2018 00:56:08 +0000 (00:56 +0000)]
[opt] Introduce -strip-named-metadata
This renames and generalizes -strip-module-flags to erase all named
metadata from a module. This makes it easier to diff IR.
llvm-svn: 333977
Vedant Kumar [Tue, 5 Jun 2018 00:56:07 +0000 (00:56 +0000)]
[Debugify] Don't insert debug values after terminating deopts
As is the case with musttail calls, the IR does not allow for
instructions inserted after a terminating deopt.
llvm-svn: 333976
Vedant Kumar [Tue, 5 Jun 2018 00:56:07 +0000 (00:56 +0000)]
Apply clang-format on a file, NFC
llvm-svn: 333975
Jonas Devlieghere [Tue, 5 Jun 2018 00:32:41 +0000 (00:32 +0000)]
Fix Expression unittests on Darwin
Fixes the Expression unittests on Darwin after r333933 was landed.
llvm-svn: 333974
Francis Visoiu Mistrih [Tue, 5 Jun 2018 00:27:28 +0000 (00:27 +0000)]
Use MF instead of Fn for MachineFunction references. NFC
llvm-svn: 333973
Francis Visoiu Mistrih [Tue, 5 Jun 2018 00:27:24 +0000 (00:27 +0000)]
[ShrinkWrap] Add optimization remarks to the shrink-wrapping pass
Start by emitting remarks for very basic unsupported cases such as
irreducible CFGs and EHFunclets. The end goal is to be able to cover all
the cases where we give up with an explanation.
llvm-svn: 333972
Jim Ingham [Tue, 5 Jun 2018 00:19:03 +0000 (00:19 +0000)]
Add ClangHost.cpp to the Xcode project.
Also add an include that was needed for the if APPLE branch
of the function.
llvm-svn: 333971
Amara Emerson [Tue, 5 Jun 2018 00:17:13 +0000 (00:17 +0000)]
[MIRParser] Add parser support for 'true' and 'false' i1s.
We already output true and false in the printer, but the parser isn't able to
read it.
Differential Revision: https://reviews.llvm.org/D47424
llvm-svn: 333970
Matt Morehouse [Tue, 5 Jun 2018 00:11:41 +0000 (00:11 +0000)]
[clang-proto-fuzzer] Refactored LLVMFuzzerInitialize into its own file.
Copied and renamed some files in preparation for new loop-proto-fuzzer.
Patch By: emmettneyman
Differential Revision: https://reviews.llvm.org/D47666
llvm-svn: 333969
Alex Langford [Mon, 4 Jun 2018 23:47:36 +0000 (23:47 +0000)]
Change SWIG output directory when building LLDB.framework with CMake
Instead of assuming that SWIG generated files (e.g. lldb.py) will live
in scripts, we should set it to $LLDB_PYTHON_TARGET_DIR. This variable is set to
scripts, except when building LLDB.framework when it is set to
LLDB_FRAMEWORK_DIR.
Differential Revision: https://reviews.llvm.org/D47742
llvm-svn: 333968
Reid Kleckner [Mon, 4 Jun 2018 23:47:29 +0000 (23:47 +0000)]
Fix -Wcovered-switch-default warning and clang-format it
llvm-svn: 333967
Teresa Johnson [Mon, 4 Jun 2018 23:05:24 +0000 (23:05 +0000)]
[ThinLTO] Add testing of new summary index format to a couple CFI tests
Summary:
Adds testing of combined index summary entries in disassembly format
to CFI tests that were already testing the bitcode format.
Depends on D46699.
Reviewers: pcc
Subscribers: mehdi_amini, inglorion, eraman, cfe-commits
Differential Revision: https://reviews.llvm.org/D46700
llvm-svn: 333966
David Blaikie [Mon, 4 Jun 2018 22:53:38 +0000 (22:53 +0000)]
Move Compiler.h from Demangle back to Support
Code review feedback from r328123 prefers copying the few feature test
macros used by Demangle into there, rather than sinking the header into
an odd corner like Demangle.
llvm-svn: 333965
Derek Schuff [Mon, 4 Jun 2018 22:53:36 +0000 (22:53 +0000)]
Simplified WebAssemblyAsmBackend by removing explicit ELF variant.
The ELF version was broken (does not deal with wasm specific fixups),
and now is slightly less broken. It will be removed in its entirety
in the future which this change makes slightly easier (just remove
the IsELF bool).
Differential Revision: https://reviews.llvm.org/D47745
Patch by Wouter van Oortmerssen
llvm-svn: 333964
Alexander Polyakov [Mon, 4 Jun 2018 22:39:40 +0000 (22:39 +0000)]
[lldb, lldb-mi] Enable lldb-mi -break-insert test on Windows.
Summary:
The default name for a compiler output on Linux is `a.out`,
while on Windows it's `a.exe`. But if we add option `-o a.exe`,
the compiler will create the executable `a.exe` on the both systems.
Reviewers: aprantl, stella.stamenova
Reviewed By: stella.stamenova
Subscribers: ki.stfu, llvm-commits, lldb-commits
Differential Revision: https://reviews.llvm.org/D47679
llvm-svn: 333963
Sanjay Patel [Mon, 4 Jun 2018 22:26:45 +0000 (22:26 +0000)]
[InstCombine] refine UB-handling in shuffle-binop transform
As noted in rL333782, we can be both better for optimization and
safer with this transform:
BinOp (shuffle V1, Mask), C --> shuffle (BinOp V1, NewC), Mask
The only potentially unsafe-to-speculate binops are integer div/rem.
All other binops are always safe (although I don't see a way to
assert that in code here).
For opcodes like shifts that can produce poison, it can't matter
here because we know the lanes with undef are dropped by the
subsequent shuffle.
Differential Revision: https://reviews.llvm.org/D47686
llvm-svn: 333962
Amaury Sechet [Mon, 4 Jun 2018 22:09:26 +0000 (22:09 +0000)]
Remove various use of undef in the X86 test suite as patern involving undef can collapse them. NFC
llvm-svn: 333961
Amaury Sechet [Mon, 4 Jun 2018 21:49:23 +0000 (21:49 +0000)]
Revert "Regenerate expected test results for test/CodeGen/X86/pr23103.ll . NFC"
This reverts commit
cf25dfc503c861845947f3e6a9d308811ebb9da3.
llvm-svn: 333960
Vedant Kumar [Mon, 4 Jun 2018 21:43:28 +0000 (21:43 +0000)]
[Debugify] Preserve analyses in -check-debugify
The -check-debugify pass should preserve all analyses. Otherwise, it may
invalidate an optional analysis and inadvertently alter codegen.
The test case is reduced from deopt-bundle.ll. The result of `opt -O1`
on this file would differ when -debugify-each was toggled. That happened
because CheckDebugify failed to preserve GlobalsAA.
Thanks to Davide Italiano for his help chasing this down!
llvm-svn: 333959
Reid Kleckner [Mon, 4 Jun 2018 21:39:20 +0000 (21:39 +0000)]
Revert r333791 "Cap "voluntary" vector alignment at 16 for all Darwin platforms."
Adding __attribute__((aligned(32))) to __m256 breaks the implementation
of _mm256_loadu_ps on Windows. On Windows, alignment attributes have
higher precedence than packing attributes.
We also might want to carefully consider the consequences of changing
our vector typedefs, since many users copy them and invent their own
new, non-Intel specific vector type names.
llvm-svn: 333958
David Blaikie [Mon, 4 Jun 2018 21:33:56 +0000 (21:33 +0000)]
Add missing header
llvm-svn: 333957
David Blaikie [Mon, 4 Jun 2018 21:23:32 +0000 (21:23 +0000)]
Update for a header file move in LLVM
llvm-svn: 333956
David Blaikie [Mon, 4 Jun 2018 21:23:29 +0000 (21:23 +0000)]
Update for an LLVM header file move
llvm-svn: 333955
David Blaikie [Mon, 4 Jun 2018 21:23:21 +0000 (21:23 +0000)]
Move Analysis/Utils/Local.h back to Transforms
Review feedback from r328165. Split out just the one function from the
file that's used by Analysis. (As chandlerc pointed out, the original
change only moved the header and not the implementation anyway - which
was fine for the one function that was used (since it's a
template/inlined in the header) but not in general)
llvm-svn: 333954
Amaury Sechet [Mon, 4 Jun 2018 21:20:45 +0000 (21:20 +0000)]
Revert "Remove various use of undef in the X86 test suite as patern involving undef can collapse them. NFC"
This reverts commit
f0e85c194ae5e87476bc767304470dec85b6774f.
llvm-svn: 333953
Jessica Paquette [Mon, 4 Jun 2018 21:14:16 +0000 (21:14 +0000)]
[MachineOutliner] NFC - Move intermediate data structures to MachineOutliner.h
This is setting up to fix bug 37573 cleanly.
This moves data structures that are technically both used in some way by the
target and the general-purpose outlining algorithm into MachineOutliner.h. In
particular, the `Candidate` class is of importance.
Before, the outliner passed the locations of `Candidates` to the target, which
would then make some decisions about the prospective outlined function. This
change allows us to just pass `Candidates` along to the target. This will allow
the target to discard `Candidates` that would be considered unsafe before cost
calculation. Thus, we will be able to remove the unsafe candidates described in
the bug without resorting to torching the entire prospective function.
Also, as a side-effect, it makes the outliner a bit cleaner.
https://bugs.llvm.org/show_bug.cgi?id=37573
llvm-svn: 333952
Alexander Ivchenko [Mon, 4 Jun 2018 21:07:35 +0000 (21:07 +0000)]
[X86][ELF][CET] Adding the .note.gnu.property ELF section in X86
In preparation for the proposed linker ABI changes
(https://github.com/hjl-tools/linux-abi/wiki/linux-abi-draft.pdf,
https://github.com/hjl-tools/x86-psABI/wiki/x86-64-psABI-cet.pdf),
this patch enables emission of the .note.gnu.property section to
ELF object files when building CET-enabled modules.
patch by mike.dvoretsky
Differential Revision: https://reviews.llvm.org/D47145
llvm-svn: 333951
Amaury Sechet [Mon, 4 Jun 2018 20:57:27 +0000 (20:57 +0000)]
Remove various use of undef in the X86 test suite as patern involving undef can collapse them. NFC
llvm-svn: 333950
Amaury Sechet [Mon, 4 Jun 2018 20:47:00 +0000 (20:47 +0000)]
Regenerate expected test results for test/CodeGen/X86/pr23103.ll . NFC
llvm-svn: 333949
Erik Pilkington [Mon, 4 Jun 2018 20:38:23 +0000 (20:38 +0000)]
Fix a strict aliasing violation in map and unordered_map.
These containers type-punned between pair<K, V> and pair<const K, V> as an
optimization. This commit instead provides access to the pair via a pair of
references that assign through to the underlying object. It's still undefined to
mutate a const object, but clang doesn't optimize on this for data members, so
this should be safe.
Differential revision: https://reviews.llvm.org/D47607
llvm-svn: 333948
Scott Linder [Mon, 4 Jun 2018 20:19:45 +0000 (20:19 +0000)]
[CodeGen] Always update divergence in SelectionDAG::UpdateNodeOperands
Some overloads failed to update divergence.
Differential Revision: https://reviews.llvm.org/D47148
llvm-svn: 333947
Artem Dergachev [Mon, 4 Jun 2018 20:18:37 +0000 (20:18 +0000)]
[analyzer] Re-enable constructors when lifetime extension through fields occurs.
Temporary object constructor inlining was disabled in r326240 for code like
const int &x = A().x;
because automatic destructor for the lifetime-extended object A() was not
working correctly in CFG.
CFG was fixed in r333941, so inlining can be re-enabled. CFG for lifetime
extension through aggregates still needs to be fixed.
Differential Revision: https://reviews.llvm.org/D44239
llvm-svn: 333946
Zachary Turner [Mon, 4 Jun 2018 19:38:11 +0000 (19:38 +0000)]
[Support] Add functions that operate on native file handles on Windows.
Windows' CRT has a limit of 512 open file descriptors, and fds which are
generated by converting a HANDLE via _get_osfhandle count towards this
limit as well.
Regardless, often you find yourself marshalling back and forth between
native HANDLE objects and fds anyway. If we know from the getgo that
we're going to need to work directly with the handle, we can cut out the
marshalling layer while also not contributing to filling up the CRT's
very limited handle table.
On Unix these functions just delegate directly to the existing set of
functions since an fd *is* the native file type. It would be nice, very
long term, if we could convert most uses of fds to file_t.
Differential Revision: https://reviews.llvm.org/D47688
llvm-svn: 333945
Craig Topper [Mon, 4 Jun 2018 19:28:09 +0000 (19:28 +0000)]
[X86] Avoid passing _mm_undefined* to builtin_shufflevector if we are able to pass the first input a second time.
This is more consistent with other usages of builtin_shufflevector. Later optimization passes or codegen will detect the duplicate vector and replace it with undef. Using _mm_undefined just puts a zeroinitializer that still needs to be optimized out later.
llvm-svn: 333944
Amaury Sechet [Mon, 4 Jun 2018 19:23:22 +0000 (19:23 +0000)]
[DAGcombine] Teach the combiner about -a = ~a + 1
Summary: This include variant for add, uaddo and addcarry. usubo and subcarry require the carry to be flipped to preserve semantic, but we chose to do the transform anyway in that case as to push the transform down the carry chain.
Reviewers: efriedma, spatel, RKSimon, zvi, bkramer
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D46505
llvm-svn: 333943
Teresa Johnson [Mon, 4 Jun 2018 19:20:02 +0000 (19:20 +0000)]
Fix for llvm-dis/llvm-bcanalyzer overflows
Summary:
These tools failed for a very large bitcode file produced by LTO due to
64-bit values being assigned to 32-bit types. For the BitstreamReader.h
fix, the value initially fit into the 32-bit unsigned, but there was an
overflow when multiplying by 32 furter below to compute the bit offset.
No test case in the patch as this requires a huge bitcode file.
Reviewers: pcc, george.karpenkov
Subscribers: mehdi_amini, a.sidorin, llvm-commits
Differential Revision: https://reviews.llvm.org/D47731
llvm-svn: 333942
Artem Dergachev [Mon, 4 Jun 2018 18:56:25 +0000 (18:56 +0000)]
[CFG] Fix automatic destructors when a member is bound to a reference.
In code like
const int &x = A().x;
automatic destructor for the object A() lifetime-extended by reference 'x' was
not present in the clang CFG due to ad-hoc pattern-matching in
getReferenceInitTemporaryType().
Re-use skipRValueSubobjectAdjustments() again to find the lifetime-extended
object in the AST and emit the correct destructor.
Lifetime extension through aggregates with references still needs to be covered.
Differential Revision: https://reviews.llvm.org/D44238
llvm-svn: 333941
Alexander Shaposhnikov [Mon, 4 Jun 2018 18:55:41 +0000 (18:55 +0000)]
[llvm-strip] Add missing aliases for --strip-debug
Add missing aliases for --strip-debug: -g, -S, -d.
Test plan: make check-all
Differential revision: https://reviews.llvm.org/D47674
llvm-svn: 333940
Amaury Sechet [Mon, 4 Jun 2018 18:36:22 +0000 (18:36 +0000)]
Get rid of SETCCE
Summary: It has been deprecated in favor of SETCCCARRY for a year now and isn't used by any in tree backend.
Reviewers: efriedma, craig.topper, dblaikie, bkramer
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D47685
llvm-svn: 333939
Heejin Ahn [Mon, 4 Jun 2018 18:23:00 +0000 (18:23 +0000)]
Remove llvm::Triple argument from get***Personality() functions. NFC.
Summary:
Because `llvm::Triple` can be derived from `TargetInfo`, it is simpler
to take only `TargetInfo` argument.
Reviewers: sbc100
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D47620
llvm-svn: 333938
Dmitry Mikulin [Mon, 4 Jun 2018 18:18:12 +0000 (18:18 +0000)]
In thin and full LTO + CFI, direct function calls may go through jump table
entries to reach the target. Since these calls don't require type checks,
we can short-circuit them to their real targets, except in cases when they
can be pre-empted.
Differential Revision: https://reviews.llvm.org/D46326
llvm-svn: 333937
Julie Hockett [Mon, 4 Jun 2018 18:18:00 +0000 (18:18 +0000)]
[clang-doc] Adding missing dependencies to fix linker error on bot
llvm-svn: 333936
Craig Topper [Mon, 4 Jun 2018 17:58:45 +0000 (17:58 +0000)]
[X86] Don't pass ParitySrc array into isAddSubOrSubAddMask. Instead use a bool output parameter to get the real piece of info we care about. NFC
The ParitySrc array is more of an implementation detail. A single bool to get the final parity is sufficient.
llvm-svn: 333935
Stanislav Mekhanoshin [Mon, 4 Jun 2018 17:57:40 +0000 (17:57 +0000)]
[AMDGPU] Small refactoring in the scheduler
After last changes some code can be simplified.
Differential Revision: https://reviews.llvm.org/D47661
llvm-svn: 333934
Zachary Turner [Mon, 4 Jun 2018 17:41:00 +0000 (17:41 +0000)]
Remove dependency from Host to clang.
Host depended on clang because HostInfo had a function to get
the directory where clang was installed. We move this over to
the clang expression parser plugin where it's more at home.
Differential Revision: https://reviews.llvm.org/D47384
llvm-svn: 333933
Julie Hockett [Mon, 4 Jun 2018 17:22:20 +0000 (17:22 +0000)]
[clang-doc] Implement reducer portion of the frontend framework
Implements a simple, in-memory reducer for the mapped output of the
initial tool. This creates a collection object for storing the
deduplicated infos on each declaration, and populates that from the
mapper output. The collection object is serialized to LLVM
bitstream. On reading each serialized output, it checks to see if a
merge is necessary and if so, merges the new info with the existing
info (prefering the existing one if conflicts exist).
For a more detailed overview of the tool, see the design document
on the mailing list:
http://lists.llvm.org/pipermail/cfe-dev/2017-December/056203.html
Differential Revision: https://reviews.llvm.org/D43341
llvm-svn: 333932
Stanislav Mekhanoshin [Mon, 4 Jun 2018 17:21:54 +0000 (17:21 +0000)]
[AMDGPU] Factored out common part of GCNRPTracker::reset()
Differential Revision: https://reviews.llvm.org/D47664
llvm-svn: 333931
Vedant Kumar [Mon, 4 Jun 2018 17:11:15 +0000 (17:11 +0000)]
[IRMemoryMap] Use labels in the "malloc" and "free" lldb-test commands
Change the syntax of the malloc and free commands in lldb-test's
ir-memory-map subcommand to:
<malloc> ::= <label> = malloc <size> <alignment>
<free> ::= free <label>
This should make it easier to read and extend tests in the future, e.g
to test IRMemoryMap::WriteMemory or double-free behavior.
Differential Revision: https://reviews.llvm.org/D47646
llvm-svn: 333930
Sam Clegg [Mon, 4 Jun 2018 17:01:20 +0000 (17:01 +0000)]
[MachO] Add out-of-bounds check to MachOObjectFile.cpp
This is a followup to rL333496.
Differential Revision: https://reviews.llvm.org/D47544
llvm-svn: 333929
Sam Clegg [Mon, 4 Jun 2018 16:59:26 +0000 (16:59 +0000)]
[WebAssembly] Fix .td files after rL333900
Differential Revision: https://reviews.llvm.org/D47727
llvm-svn: 333928
John Brawn [Mon, 4 Jun 2018 16:53:57 +0000 (16:53 +0000)]
[ValueTracking] Match select abs pattern when there's an sext involved
When checking a select to see if it matches an abs, allow the true/false values
to be a sign-extension of the comparison value instead of requiring that they're
directly the comparison value, as all the comparison cares about is the sign of
the value.
This fixes a regression due to r333702, where we were no longer generating ctlz
due to isKnownNonNegative failing to match such a pattern.
Differential Revision: https://reviews.llvm.org/D47631
llvm-svn: 333927
Mark Searles [Mon, 4 Jun 2018 16:51:59 +0000 (16:51 +0000)]
[AMDGPU][Waitcnt] Fix handling of flat instrs
On GFX9 and earlier, flat memory ops may decrement VMCNT out-of-order as well as LGKMCNT out-of-order.
Differential Revision: https://reviews.llvm.org/D46616
llvm-svn: 333926
Simon Pilgrim [Mon, 4 Jun 2018 16:48:13 +0000 (16:48 +0000)]
[X86] Only accept const SelectionDAG to resolveTargetShuffleInputs/getFauxShuffleMask
These methods should only be using SelectionDAG for analysis (known/sign bits etc), not node creation.
llvm-svn: 333925
Benjamin Kramer [Mon, 4 Jun 2018 16:12:33 +0000 (16:12 +0000)]
[NVPTX] Delete dead code from the AsmPrinter.
llvm-svn: 333924
Leonard Chan [Mon, 4 Jun 2018 16:07:52 +0000 (16:07 +0000)]
This diff includes changes for supporting the following types.
// Primary fixed point types
signed short _Accum s_short_accum;
signed _Accum s_accum;
signed long _Accum s_long_accum;
unsigned short _Accum u_short_accum;
unsigned _Accum u_accum;
unsigned long _Accum u_long_accum;
// Aliased fixed point types
short _Accum short_accum;
_Accum accum;
long _Accum long_accum;
This diff only allows for declaration of the fixed point types. Assignment and other operations done on fixed point types according to http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1169.pdf will be added in future patches. The saturated versions of these types and the equivalent _Fract types will also be added in future patches.
The tests included are for asserting that we can declare these types.
Fixed the test that was failing by not checking for dso_local on some
targets.
Differential Revision: https://reviews.llvm.org/D46084
llvm-svn: 333923
Andrea Di Biagio [Mon, 4 Jun 2018 15:43:09 +0000 (15:43 +0000)]
[RFC][patch 3/3] Add support for variant scheduling classes in llvm-mca.
This patch is the last of a sequence of three patches related to LLVM-dev RFC
"MC support for variant scheduling classes".
http://lists.llvm.org/pipermail/llvm-dev/2018-May/123181.html
This fixes PR36672.
The main goal of this patch is to teach llvm-mca how to solve variant scheduling
classes. This patch does that, plus it adds new variant scheduling classes to
the BtVer2 scheduling model to identify so-called zero-idioms (i.e. so-called
dependency breaking instructions that are known to generate zero, and that are
optimized out in hardware at register renaming stage).
Without the BtVer2 change, this patch would not have had any meaningful tests.
This patch is effectively the union of two changes:
1) a change that teaches llvm-mca how to resolve variant scheduling classes.
2) a change to the BtVer2 scheduling model that allows us to special-case
packed XOR zero-idioms (this partially fixes PR36671).
Differential Revision: https://reviews.llvm.org/D47374
llvm-svn: 333909
Alexander Ivchenko [Mon, 4 Jun 2018 15:14:18 +0000 (15:14 +0000)]
[llvm-readobj] Support GNU_PROPERTY_X86_FEATURE_1_AND notes in .note.gnu.property
Resubmit of r333424. This version contains the fix for fails found by buildbots
on some targets.
This patch allows parsing GNU_PROPERTY_X86_FEATURE_1_AND
notes in .note.gnu.property sections. These notes
indicate that the object file is built to support Intel CET.
patch by mike.dvoretsky
Differential Revision: https://reviews.llvm.org/D47473
llvm-svn: 333908
Krzysztof Parzyszek [Mon, 4 Jun 2018 14:54:53 +0000 (14:54 +0000)]
[SelectionDAG] Add missing closing parentheses in comments, NFC
llvm-svn: 333907
Ilya Biryukov [Mon, 4 Jun 2018 14:50:59 +0000 (14:50 +0000)]
[clangd] Boost scores for decls from current file in completion
Summary: This should, arguably, give better ranking.
Reviewers: ioeric, sammccall
Reviewed By: sammccall
Subscribers: mgorny, klimek, MaskRay, jkorous, mgrang, cfe-commits
Differential Revision: https://reviews.llvm.org/D46943
llvm-svn: 333906
Nicolai Haehnle [Mon, 4 Jun 2018 14:45:20 +0000 (14:45 +0000)]
AMDGPU: Make various NamedOperands upper case
Summary:
Avoid name clashes with the corresponding bit fields in the instruction
encoding.
Change-Id: Id1644e703e976e78f7af93788d9f44cb48c3251f
Reviewers: arsenm, rampitec, kzhuravl
Subscribers: wdng, yaxunl, dstuttard, tpr, t-tye, llvm-commits
Differential Revision: https://reviews.llvm.org/D47433
llvm-svn: 333905
Nicolai Haehnle [Mon, 4 Jun 2018 14:45:12 +0000 (14:45 +0000)]
TableGen/DAGPatterns: Allow bit constants in addition to int constants
Summary:
Implicit casting is a simple quality of life improvement.
Change-Id: I3d2b31b8b8f12cbb1e84f691e359fa713a9c4b42
Reviewers: tra, simon_tatham, craig.topper, MartinO, arsenm
Subscribers: wdng, llvm-commits
Differential Revision: https://reviews.llvm.org/D47432
llvm-svn: 333904
Mikhail R. Gadelha [Mon, 4 Jun 2018 14:40:44 +0000 (14:40 +0000)]
[analyzer] False positive refutation with Z3
Summary: This is a prototype of a bug reporter visitor that invalidates bug reports by re-checking constraints of certain states on the bug path using the Z3 constraint manager backend. The functionality is available under the `crosscheck-with-z3` analyzer config flag.
Reviewers: george.karpenkov, NoQ, dcoughlin, rnkovacs
Reviewed By: george.karpenkov
Subscribers: rnkovacs, NoQ, george.karpenkov, dcoughlin, xbolva00, ddcc, mikhail.ramalho, MTC, fhahn, whisperity, baloghadamsoftware, szepet, a.sidorin, gsd, dkrupp, xazax.hun, cfe-commits
Differential Revision: https://reviews.llvm.org/D45517
llvm-svn: 333903
Nicola Zaghen [Mon, 4 Jun 2018 14:40:34 +0000 (14:40 +0000)]
[ReleaseNotes] Formatting fixes.
llvm-svn: 333902
Nicolai Haehnle [Mon, 4 Jun 2018 14:26:12 +0000 (14:26 +0000)]
TableGen: some LangRef doc fixes
Summary: Change-Id: I1442e2daa09cab727a01d8c31893b50e644a5cd3
Reviewers: tra, simon_tatham, craig.topper
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D47530
Change-Id: I397655dd18b7ff978c1affa3174740d9c1a82594
llvm-svn: 333901
Nicolai Haehnle [Mon, 4 Jun 2018 14:26:05 +0000 (14:26 +0000)]
TableGen: Streamline the semantics of NAME
Summary:
The new rules are straightforward. The main rules to keep in mind
are:
1. NAME is an implicit template argument of class and multiclass,
and will be substituted by the name of the instantiating def/defm.
2. The name of a def/defm in a multiclass must contain a reference
to NAME. If such a reference is not present, it is automatically
prepended.
And for some additional subtleties, consider these:
3. defm with no name generates a unique name but has no special
behavior otherwise.
4. def with no name generates an anonymous record, whose name is
unique but undefined. In particular, the name won't contain a
reference to NAME.
Keeping rules 1&2 in mind should allow a predictable behavior of
name resolution that is simple to follow.
The old "rules" were rather surprising: sometimes (but not always),
NAME would correspond to the name of the toplevel defm. They were
also plain bonkers when you pushed them to their limits, as the old
version of the TableGen test case shows.
Having NAME correspond to the name of the toplevel defm introduces
"spooky action at a distance" and breaks composability:
refactoring the upper layers of a hierarchy of nested multiclass
instantiations can cause unexpected breakage by changing the value
of NAME at a lower level of the hierarchy. The new rules don't
suffer from this problem.
Some existing .td files have to be adjusted because they ended up
depending on the details of the old implementation.
Change-Id: I694095231565b30f563e6fd0417b41ee01a12589
Reviewers: tra, simon_tatham, craig.topper, MartinO, arsenm, javed.absar
Subscribers: wdng, llvm-commits
Differential Revision: https://reviews.llvm.org/D47430
llvm-svn: 333900
Mikhail R. Gadelha [Mon, 4 Jun 2018 14:25:58 +0000 (14:25 +0000)]
Created a tiny SMT interface and make Z3ConstraintManager implement it
Summary:
This patch implements a simple SMTConstraintManager API, and requires the implementation of two methods for now: `addRangeConstraints` and `isModelFeasible`.
Update Z3ConstraintManager to inherit it and implement required methods.
I also moved the method to dump the SMT formula from D45517 to this patch.
This patch was created based on the reviews from D47640.
Reviewers: george.karpenkov, NoQ, ddcc, dcoughlin
Reviewed By: george.karpenkov
Differential Revision: https://reviews.llvm.org/D47689
llvm-svn: 333899
Nicola Zaghen [Mon, 4 Jun 2018 13:55:09 +0000 (13:55 +0000)]
[ReleaseNotes] Add release note for the new LLVM_DEBUG macro.
This is to provide a way to migrate from the old DEBUG macro to the new one.
Differential Revision: https://reviews.llvm.org/D47528
llvm-svn: 333898
Sam McCall [Mon, 4 Jun 2018 13:28:17 +0000 (13:28 +0000)]
[clangd] Fix inverted test (--gtest_filter strikes again...)
llvm-svn: 333897
Simon Dardis [Mon, 4 Jun 2018 12:50:32 +0000 (12:50 +0000)]
[mips] Restore the availablity of trap for microMIPS
Reviewers: smaksimovic, atanasyan, abeserminji
Differential Revision: https://reviews.llvm.org/D47584
llvm-svn: 333895
Greg Bedwell [Mon, 4 Jun 2018 12:30:10 +0000 (12:30 +0000)]
[llvm-mca][UpdateTestChecks] Prevent an IndexError being raised when given empty input
llvm-svn: 333894
Greg Bedwell [Mon, 4 Jun 2018 12:30:03 +0000 (12:30 +0000)]
[llvm-mca] Regenerate a test to remove a double newline
Command used: py update_mca_test_checks.py ..\test\tools\llvm-mca\*\*.s ..\test\tools\llvm-mca\*\*\*.s
llvm-svn: 333893
Andrea Di Biagio [Mon, 4 Jun 2018 12:23:07 +0000 (12:23 +0000)]
[llvm-mca] Track cycles contributed by resources that are in a 'Super' relationship.
This is required if we want to correctly match the behavior of method
SubtargetEmitter::ExpandProcResource() in Tablegen. When computing the set of
"consumed" processor resources and resource cycles, the logic in
ExpandProcResource() doesn't update the number of resource cycles contributed by
a "Super" resource to a group. We need to take this into account when a model
declares a processor resource which is part of a 'processor resource group', and
it is also used as the "Super" of other resources.
llvm-svn: 333892
Roman Lebedev [Mon, 4 Jun 2018 12:04:51 +0000 (12:04 +0000)]
[clang][tooling] Don't forget to link to clangToolingInclusions.
Fixes build with shared libs, broken by rL333874.
Some buildbot converage is sorely missing.
llvm-svn: 333891
Roman Lebedev [Mon, 4 Jun 2018 12:04:41 +0000 (12:04 +0000)]
[clang][tooling] Don't forget to link to clangToolingInclusions.
Fixes build with shared libs, broken by rL333874.
Some buildbot converage is sorely missing.
llvm-svn: 333890
David Carlier [Mon, 4 Jun 2018 11:59:18 +0000 (11:59 +0000)]
[LLDB] Unit tests basic support for OpenBSD
OpenBSD python module.
llvm-svn: 333889
David Carlier [Mon, 4 Jun 2018 11:57:12 +0000 (11:57 +0000)]
[LLDB] Unit tests basic support for OpenBSD
Add OpenBSD python module in order to support unit tests.
Reviewers: labath, zturner
Reviewed By: labath
Differential Revision: https://reviews.llvm.org/D47692
llvm-svn: 333888
Roman Lebedev [Mon, 4 Jun 2018 11:48:46 +0000 (11:48 +0000)]
[llvm-mca] Make sure not to end the test files with an empty line.
Summary:
It's super irritating.
[properly configured] git client then complains about that double-newline,
and you have to use `--force` to ignore the warning, since even if you
fix it manually, it will be reintroduced the very next runtime :/
Reviewers: RKSimon, andreadb, courbet, craig.topper, javed.absar, gbedwell
Reviewed By: gbedwell
Subscribers: javed.absar, tschuett, gbedwell, llvm-commits
Differential Revision: https://reviews.llvm.org/D47697
llvm-svn: 333887
Clement Courbet [Mon, 4 Jun 2018 11:43:40 +0000 (11:43 +0000)]
[llvm-exegesis][NFC] Use an enum instead of a string for benchmark mode.
Summary: YAML encoding is backwards-compatible.
Reviewers: gchatelet
Subscribers: tschuett, llvm-commits
Differential Revision: https://reviews.llvm.org/D47705
llvm-svn: 333886
Eric Liu [Mon, 4 Jun 2018 11:31:55 +0000 (11:31 +0000)]
[clangd] Avoid indexing decls associated with friend decls.
Summary:
These decls are sometime used as the canonical declarations (e.g. for go-to-def),
which seems to be bad.
- friend decls that are not definitions should be ignored for indexing purposes
- this means they should never be selected as canonical decl
- if the friend decl is the only decl, then the symbol should not be indexed
Reviewers: sammccall
Reviewed By: sammccall
Subscribers: mgorny, klimek, ilya-biryukov, MaskRay, jkorous, cfe-commits
Differential Revision: https://reviews.llvm.org/D47623
llvm-svn: 333885
Clement Courbet [Mon, 4 Jun 2018 11:11:55 +0000 (11:11 +0000)]
[llvm-exegesis] Analysis: Show inconsistencies between checked-in and measured data.
Summary:
We now highlight any sched classes whose measurements do not match the
LLVM SchedModel. "bad" clusters are marked in red.
Screenshot in phabricator diff.
Reviewers: gchatelet
Subscribers: tschuett, mgrang, RKSimon, llvm-commits
Differential Revision: https://reviews.llvm.org/D47639
llvm-svn: 333884
George Rimar [Mon, 4 Jun 2018 10:47:01 +0000 (10:47 +0000)]
[ELF] - Fix BB.
llvm-svn: 333883
Haojian Wu [Mon, 4 Jun 2018 10:43:59 +0000 (10:43 +0000)]
[clangd] Remove the dead offset fields in Symbol.
Reviewers: sammccall
Subscribers: klimek, ilya-biryukov, ioeric, MaskRay, jkorous, cfe-commits
Differential Revision: https://reviews.llvm.org/D47699
llvm-svn: 333882
Sam McCall [Mon, 4 Jun 2018 10:37:16 +0000 (10:37 +0000)]
[clangd] Hover should return null when not hovering over anything.
Summary: Also made JSON serialize Optional<T> to simplify this.
Reviewers: ioeric
Subscribers: klimek, ilya-biryukov, MaskRay, jkorous, cfe-commits
Differential Revision: https://reviews.llvm.org/D47701
llvm-svn: 333881
George Rimar [Mon, 4 Jun 2018 10:28:45 +0000 (10:28 +0000)]
[ELF] - Also use DW_AT_linkage_name when gathering information about variables for error messages.
Currently, when LLD do a lookup for variables location, it uses DW_AT_name attribute.
That is not always enough.
Imagine code:
namespace A {
int bar = 0;
}
namespace Z {
int bar = 1;
}
int hoho;
In this case there are 3 variables and their debug attributes are following:
A::bar has: DW_AT_name [DW_FORM_string] ("bar") DW_AT_linkage_name [DW_FORM_strp] ( .debug_str[0x00000006] = "_ZN1A3barE")
Z::bar has: DW_AT_name [DW_FORM_string] ("bar") DW_AT_linkage_name [DW_FORM_strp] ( .debug_str[0x0000003f] = "_ZN1Z3barE")
hoho has: DW_AT_name [DW_FORM_strp] ( .debug_str[0x0000004a] = "hoho") and has NO DW_AT_linkage_name attribute. Because it would be
the same as DW_AT_name and DWARF producers avoids emiting excessive data.
Hence LLD should also use DW_AT_linkage_name when it is available.
(currently, LLD fails to report location correctly because thinks that A::bar and Z::bar are the same things)
Differential revision: https://reviews.llvm.org/D47373
llvm-svn: 333880
Luke Geeson [Mon, 4 Jun 2018 09:41:32 +0000 (09:41 +0000)]
[AArch64] Audit on rL333634 to fix FP16 Disasm BitPatterns
llvm-svn: 333879
Pavel Labath [Mon, 4 Jun 2018 09:05:27 +0000 (09:05 +0000)]
AppleDWARFIndex: Get function method-ness directly from debug info
Summary:
When searching for methods only, we need to do extra work to make sure
the functions we get from the apple tables are indeed methods.
Previously we were resolving the DIE into a SymbolContext and then
checked whether the enclosing CompilerDeclContext is a
class (or struct, or union).
This patch changes that to operate on the debug info directly. This
should be:
- simpler
- faster
- more consistent with the ManualDWARFIndex (which does the same check,
only at indexing time).
What we lose this ways is for the language plugin to have a say in what
it considers to be a "class", but that's probably more flexibility than
we need (and if we really wanted to do that in the future, we could
implement a more direct way to consult the plugin about this).
This also fixes the find-method-local-struct test, which was failing
because we were not able to construct a CompilerDeclContext for a local
struct correctly.
As a drive-by, I rename the DWARFDIE's IsStructClassOrUnion method to
match the name on the CompilerDeclContext class.
Reviewers: clayborg, JDevlieghere
Subscribers: aprantl, lldb-commits
Differential Revision: https://reviews.llvm.org/D47470
llvm-svn: 333878
Eric Liu [Mon, 4 Jun 2018 09:04:28 +0000 (09:04 +0000)]
Reland "[clangd] Adapt file migration in r332720"
This reverts commit r333535.
llvm-svn: 333877
Eric Liu [Mon, 4 Jun 2018 09:04:25 +0000 (09:04 +0000)]
Revert "Reland "[clangd] Adapt file migration in r332720""
This reverts commit r333533.
llvm-svn: 333876
Eric Liu [Mon, 4 Jun 2018 09:04:19 +0000 (09:04 +0000)]
Reland "[clangd] Adapt file migration in r332720"
This reverts commit r332752 (i.e. reland r332721).
llvm-svn: 333875
Eric Liu [Mon, 4 Jun 2018 09:04:12 +0000 (09:04 +0000)]
Reland "Move #include manipulation code to new lib/Tooling/Inclusions."
This reverts commit r333534 (i.e. reland r332720) after fixing module build.
Differential Revision: https://reviews.llvm.org/D47068
llvm-svn: 333874
Sander de Smalen [Mon, 4 Jun 2018 07:24:23 +0000 (07:24 +0000)]
[AArch64][SVE] Fix range for DUP immediates (16bit elts)
For immediates used in DUP instructions that have the range
-128 to 127, or a multiple of 256 in the range -32768 to 32512,
one could argue that when the result element size is 16bits (.h),
the value can be considered both signed and unsigned.
Reviewers: rengolin, fhahn, SjoerdMeijer, samparker, javed.absar
Reviewed By: fhahn
Differential Revision: https://reviews.llvm.org/D47619
llvm-svn: 333873
Sander de Smalen [Mon, 4 Jun 2018 07:07:35 +0000 (07:07 +0000)]
[AArch64][SVE] Asm: Print indexed element 0 as FPR.
Print the first indexed element as a FP register, for example:
mov z0.d, z1.d[0]
Is now printed as:
mov z0.d, d1
Next to printing, this patch also adds aliases to parse 'mov z0.d, d1'.
Reviewers: rengolin, fhahn, samparker, SjoerdMeijer, javed.absar
Reviewed By: fhahn
Differential Revision: https://reviews.llvm.org/D47571
llvm-svn: 333872
Sander de Smalen [Mon, 4 Jun 2018 06:40:55 +0000 (06:40 +0000)]
[AArch64][SVE] Asm: Support for indexed DUP instructions.
Unpredicated copy of indexed SVE element to SVE vector,
along with MOV-aliases.
For example:
dup z0.h, z1.h[0]
duplicates the first 16-bit element from z1 to all elements in
the result vector z0.
Reviewers: rengolin, fhahn, samparker, SjoerdMeijer, javed.absar
Reviewed By: SjoerdMeijer
Differential Revision: https://reviews.llvm.org/D47570
llvm-svn: 333871
David Carlier [Mon, 4 Jun 2018 06:02:38 +0000 (06:02 +0000)]
[TSan] FreeBSD / intercept thr_exit
intercepting thr_exit to terminate threads under FreeBSD.
Unblock few unit tests hanging.
Reviewers: krytarowski, vitalybuka, emaste
Reviewed By: dvyukov
Differential Revision: https://reviews.llvm.org/D47677
M lib/tsan/rtl/tsan_interceptors.cc
llvm-svn: 333870
Sander de Smalen [Mon, 4 Jun 2018 05:58:06 +0000 (05:58 +0000)]
[AArch64][SVE] Asm: Support for FCPY immediate instructions.
Predicated copy of floating-point immediate value to SVE vector,
along with MOV-aliases.
Reviewers: rengolin, fhahn, samparker, SjoerdMeijer, javed.absar
Reviewed By: javed.absar
Differential Revision: https://reviews.llvm.org/D47518
llvm-svn: 333869
Sander de Smalen [Mon, 4 Jun 2018 05:40:46 +0000 (05:40 +0000)]
[AArch64][SVE] Asm: Support for CPY immediate instructions
Predicated copy of possibly shifted immediate value into SVE
vector, along with MOV-aliases.
Reviewers: rengolin, fhahn, samparker, SjoerdMeijer, javed.absar
Reviewed By: fhahn
Differential Revision: https://reviews.llvm.org/D47517
llvm-svn: 333868