lldb.git
3 years ago[clang-tidy] Fix ParentVirtualCallCheck for old MSVS compilers
Zinovy Nis [Fri, 13 Apr 2018 08:43:47 +0000 (08:43 +0000)]
[clang-tidy] Fix ParentVirtualCallCheck for old MSVS compilers

llvm-svn: 329999

3 years ago[XRay] [compiler-rt] reformat and clarify CMakeLists.txt [NFC]
Martin Pelikan [Fri, 13 Apr 2018 08:33:46 +0000 (08:33 +0000)]
[XRay] [compiler-rt] reformat and clarify CMakeLists.txt [NFC]

Summary:
- last change (+ the Apple support change) missed a lot of indentation
- shorten architecture SOURCES definitions as most fit 1 line/arch
- comment in English what's where, and where the different .a come from
  (using only the word "runtime" in the comment isn't useful, since the
  CMake primitive itself says "runtime" in its name)
- skip unsupported architectures quickly, to avoid extra indentation

Reviewers: dberris, eizan, kpw

Subscribers: mgorny, delcypher, #sanitizers, llvm-commits

Differential Revision: https://reviews.llvm.org/D45568

llvm-svn: 329998

3 years ago[clangd] Add line and column number to the index symbol.
Haojian Wu [Fri, 13 Apr 2018 08:30:39 +0000 (08:30 +0000)]
[clangd] Add line and column number to the index symbol.

Summary:
LSP is using Line & column as symbol position, clangd needs to transfer file
offset to Line & column when sending results back to LSP client, which is a high
cost, especially for finding workspace symbol -- we have to read the file
content from disk (if it isn't loaded in memory).

Saving these information in the index will make the clangd life eaiser.

Reviewers: sammccall

Subscribers: klimek, ilya-biryukov, jkorous-apple, ioeric, MaskRay, cfe-commits

Differential Revision: https://reviews.llvm.org/D45513

llvm-svn: 329997

3 years ago[ELF][MIPS] Support linking of PIE for MIPS
Simon Atanasyan [Fri, 13 Apr 2018 08:15:01 +0000 (08:15 +0000)]
[ELF][MIPS] Support linking of PIE for MIPS

MIPS ABI requires creation of the MIPS_RLD_MAP dynamic tag for non-PIE
executables only and MIPS_RLD_MAP_REL tag for both PIE and non-PIE
executables. The patch skips definition of the MIPS_RLD_MAP for PIE
files and defines MIPS_RLD_MAP_REL.

The MIPS_RLD_MAP_REL tag stores the offset to the .rld_map section
relative to the address of the tag itself.

Differential Revision: https://reviews.llvm.org/D43347

llvm-svn: 329996

3 years ago[X86] Fix cldemote builtin signature
Gabor Buella [Fri, 13 Apr 2018 08:14:21 +0000 (08:14 +0000)]
[X86] Fix cldemote builtin signature

Fix for r329993

llvm-svn: 329995

3 years ago[clang-tidy] [bugprone-parent-virtual-call] Minor cosmetic changes. NFC
Zinovy Nis [Fri, 13 Apr 2018 07:46:27 +0000 (07:46 +0000)]
[clang-tidy] [bugprone-parent-virtual-call] Minor cosmetic changes. NFC

llvm-svn: 329994

3 years ago[X86] Introduce cldemote intrinsic
Gabor Buella [Fri, 13 Apr 2018 07:37:24 +0000 (07:37 +0000)]
[X86] Introduce cldemote intrinsic

Reviewers: craig.topper, zvi

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D45257

llvm-svn: 329993

3 years ago[X86] Introduce cldemote instruction
Gabor Buella [Fri, 13 Apr 2018 07:35:08 +0000 (07:35 +0000)]
[X86] Introduce cldemote instruction

Hint to hardware to move the cache line containing the
address to a more distant level of the cache without
writing back to memory.

Reviewers: craig.topper, zvi

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D45256

llvm-svn: 329992

3 years ago[Support] Fix building for Windows on ARM
Martin Storsjo [Fri, 13 Apr 2018 06:38:02 +0000 (06:38 +0000)]
[Support] Fix building for Windows on ARM

The commit in SVN r310001 that added support for this actually didn't
use the right struct field for the frame pointer - for ARM, there is
no register named Fp in the CONTEXT struct. On Windows, the R11
register is used as frame pointer.

Differential Revision: https://reviews.llvm.org/D45590

llvm-svn: 329991

3 years ago[X86] Remove the pmuldq/pmuldq intrinsics and replace with native IR.
Craig Topper [Fri, 13 Apr 2018 06:07:18 +0000 (06:07 +0000)]
[X86] Remove the pmuldq/pmuldq intrinsics and replace with native IR.

This completes the work started in r329604 and r329605 when we changed clang to no longer use the intrinsics.

We lost some InstCombine SimplifyDemandedBit optimizations through this change as we aren't able to fold 'and', bitcast, shuffle very well.

llvm-svn: 329990

3 years ago[XRay][clang] Make -fxray-modes= additive
Dean Michael Berris [Fri, 13 Apr 2018 05:59:57 +0000 (05:59 +0000)]
[XRay][clang] Make -fxray-modes= additive

Summary:
This allows us to do the following:

  clang -fxray-modes=none ... -fxray-modes=xray-basic

It's important to be able to do this in cases where we'd like to
specialise the configuration for the invocation of the compiler, in
various scripting environments.

This is related to llvm.org/PR37066, a follow-up to D45474.

Reviewers: eizan, kpw, pelikan

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D45610

llvm-svn: 329989

3 years agoEnable debug fission for thinLTO linked via gold-plugin
Yunlian Jiang [Fri, 13 Apr 2018 05:03:28 +0000 (05:03 +0000)]
Enable debug fission for thinLTO linked via gold-plugin

Summary: This enables debug fission on implicit ThinLTO when linked with gold. It will put the .dwo files in a directory specified by user.

Reviewers: tejohnson, pcc, dblaikie

Reviewed By: pcc

Subscribers: JDevlieghere, mehdi_amini, inglorion

Differential Revision: https://reviews.llvm.org/D44792

llvm-svn: 329988

3 years ago[CallSiteSplit] Fix comment. NFC
Xin Tong [Fri, 13 Apr 2018 04:35:38 +0000 (04:35 +0000)]
[CallSiteSplit] Fix comment. NFC

llvm-svn: 329987

3 years agoFix another bot failure from r329951.
Erik Pilkington [Fri, 13 Apr 2018 02:53:26 +0000 (02:53 +0000)]
Fix another bot failure from r329951.

llvm-svn: 329986

3 years ago[XRay][clang] Add flag to choose instrumentation bundles
Dean Michael Berris [Fri, 13 Apr 2018 02:31:58 +0000 (02:31 +0000)]
[XRay][clang] Add flag to choose instrumentation bundles

Summary:
This change addresses http://llvm.org/PR36926 by allowing users to pick
which instrumentation bundles to use, when instrumenting with XRay. In
particular, the flag `-fxray-instrumentation-bundle=` has four valid
values:

- `all`: the default, emits all instrumentation kinds
- `none`: equivalent to -fnoxray-instrument
- `function`: emits the entry/exit instrumentation
- `custom`: emits the custom event instrumentation

These can be combined either as comma-separated values, or as
repeated flag values.

Reviewers: echristo, kpw, eizan, pelikan

Reviewed By: pelikan

Subscribers: mgorny, cfe-commits

Differential Revision: https://reviews.llvm.org/D44970

llvm-svn: 329985

3 years ago[CMake][Fuchsia] Don't specify libc++ ABI version for Fuchsia
Petr Hosek [Fri, 13 Apr 2018 02:02:13 +0000 (02:02 +0000)]
[CMake][Fuchsia] Don't specify libc++ ABI version for Fuchsia

This is now set automatically in libc++ config header.

Differential Revision: https://reviews.llvm.org/D45511

llvm-svn: 329984

3 years ago[CMake] Set the default ABI version for Fuchsia in CMake as well
Petr Hosek [Fri, 13 Apr 2018 01:59:15 +0000 (01:59 +0000)]
[CMake] Set the default ABI version for Fuchsia in CMake as well

This is neeeded since the CMake value is used for the SOVERSION.

Differential Revision: https://reviews.llvm.org/D45529

llvm-svn: 329983

3 years ago[tsan] Add interceptors for objc_sync_enter and objc_sync_exit
Kuba Mracek [Fri, 13 Apr 2018 01:05:29 +0000 (01:05 +0000)]
[tsan] Add interceptors for objc_sync_enter and objc_sync_exit

Objective-C's @synchronize synchronization primitive uses calls to objc_sync_enter and objc_sync_exit runtime functions. In most cases, they end up just calling pthread_mutex_lock/pthread_mutex_unlock, but there are some cases where the synchronization from pthread_mutex_lock/pthread_mutex_unlock interceptors isn't enough. Let's add explicit interceptors for objc_sync_enter and objc_sync_exit to handle all cases.

Differential Revision: https://reviews.llvm.org/D45487

llvm-svn: 329982

3 years ago[AMDGPU] Update relocation record description
Tony Tye [Fri, 13 Apr 2018 01:01:27 +0000 (01:01 +0000)]
[AMDGPU] Update relocation record description

Document which relocation records are static and dynamic.

Differential Revision: https://reviews.llvm.org/D45587

llvm-svn: 329981

3 years ago[asan] Reduce flakiness in stack-overflow detection
Kuba Mracek [Fri, 13 Apr 2018 00:29:24 +0000 (00:29 +0000)]
[asan] Reduce flakiness in stack-overflow detection

IsStackOverflow only treats accesses within 512 bytes of SP as stack-overflow. This should really be the size of a page instead.

The scariness_score_test.cc triggers stack overflow with frames that are even larger than a page, which can also trigger a fault that will not be recognized as stack-overflow. Let's just use smaller frames.

llvm-svn: 329980

3 years ago[libcxx] [test] Use TEST_IGNORE_NODISCARD.
Stephan T. Lavavej [Fri, 13 Apr 2018 00:07:48 +0000 (00:07 +0000)]
[libcxx] [test] Use TEST_IGNORE_NODISCARD.

Fixes D45595.

llvm-svn: 329979

3 years ago[libcxx] [test] Fix whitespace, NFC.
Stephan T. Lavavej [Thu, 12 Apr 2018 23:56:22 +0000 (23:56 +0000)]
[libcxx] [test] Fix whitespace, NFC.

test/std almost always uses spaces; now it is entirely tab-free.

llvm-svn: 329978

3 years ago[libcxx] [test] Use TEST_COMPILER_C1XX.
Stephan T. Lavavej [Thu, 12 Apr 2018 23:56:17 +0000 (23:56 +0000)]
[libcxx] [test] Use TEST_COMPILER_C1XX.

Also TEST_COMPILER_CLANG in one place. (More could be changed.)

llvm-svn: 329977

3 years ago[libcxx] [test] Silence MSVC warning C4146.
Stephan T. Lavavej [Thu, 12 Apr 2018 23:56:14 +0000 (23:56 +0000)]
[libcxx] [test] Silence MSVC warning C4146.

This test code triggers the MSVC warning:

"unary minus operator applied to unsigned type, result still unsigned"

Although it would be possible to change the test code to avoid
this warning, I have chosen to simply silence it.

Fixes D45594.

llvm-svn: 329976

3 years ago[libcxx] [test] Fix nodiscard warnings.
Stephan T. Lavavej [Thu, 12 Apr 2018 23:56:12 +0000 (23:56 +0000)]
[libcxx] [test] Fix nodiscard warnings.

MSVC's STL has marked to_bytes/from_bytes as nodiscard.

Fixes D45595.

llvm-svn: 329975

3 years ago[libcxx] [test] Avoid unary_function.
Stephan T. Lavavej [Thu, 12 Apr 2018 23:56:10 +0000 (23:56 +0000)]
[libcxx] [test] Avoid unary_function.

Replace unary_function inheritance (which was never required,
even in C++98) with argument_type and result_type typedefs.
This increases portability, as unary_function was removed in C++17
and MSVC has implemented that removal.

Fixes D45596.

llvm-svn: 329974

3 years ago[libcxx] [test] Avoid MSVC truncation warnings.
Stephan T. Lavavej [Thu, 12 Apr 2018 23:56:07 +0000 (23:56 +0000)]
[libcxx] [test] Avoid MSVC truncation warnings.

MSVC emits "warning C4244: 'initializing': conversion from 'int'
to 'short', possible loss of data" when it sees pair<Whatever, short>
constructed from (whatever, 4), because int is being truncated to
short within pair's constructor. (The compiler doesn't take into
account the fact that 4 is a literal at the callsite; it generates
this warning when the constructor is instantiated, because it might
be called with a runtime-valued int that would actually truncate.)

Instead of static_cast<short>, we can simply change short to int
in these tests, without affecting the pair operations that they're
trying to test: move assignment, convert copy construction, and
convert move construction.

Fixes D45016.

llvm-svn: 329973

3 years ago[lit] Remove duplicate to_string method
Aaron Smith [Thu, 12 Apr 2018 23:45:15 +0000 (23:45 +0000)]
[lit] Remove duplicate to_string method

There are two versions of to_string used by TestRunner.py. The one defined
in TestRunner.py and the one defined in utils/lit/lit/util.py. The util.py
version is superior to the TestRunner.py version.

This change removes the duplicate to_string in TestRunner.py in favor of
always using the version from util.py. Beside removing duplicate code, this
makes it easier to debug TestRunner.py since only one version of to_string
is used.

Patch by Stella Stamenova!

llvm-svn: 329972

3 years ago[docs] Add LLDB_TEST_USE_CUSTOM_C_COMPILER and LLDB_TEST_USE_CUSTOM_CXX_COMPILER...
Aaron Smith [Thu, 12 Apr 2018 23:29:49 +0000 (23:29 +0000)]
[docs] Add LLDB_TEST_USE_CUSTOM_C_COMPILER and LLDB_TEST_USE_CUSTOM_CXX_COMPILER to the build and test hmtl pages

llvm-svn: 329971

3 years ago[X86] Remove unused MoveLoadStoreItins/ShiftOpndItins schedule class wrappers.
Simon Pilgrim [Thu, 12 Apr 2018 22:57:34 +0000 (22:57 +0000)]
[X86] Remove unused MoveLoadStoreItins/ShiftOpndItins schedule class wrappers.

Was being used to move around empty/unused itineraries...

llvm-svn: 329970

3 years agoFree a pointer, fix a bot.
Erik Pilkington [Thu, 12 Apr 2018 22:54:47 +0000 (22:54 +0000)]
Free a pointer, fix a bot.

llvm-svn: 329969

3 years agoFix test failure caused by r329965.
Eli Friedman [Thu, 12 Apr 2018 22:50:50 +0000 (22:50 +0000)]
Fix test failure caused by r329965.

"-mllvm" options get parsed slightly earlier, and -arm-restrict-it is
only available if the ARM target is compiled in. Invoke "clang -cc1"
directly to avoid the issue.

llvm-svn: 329968

3 years ago[X86] Remove x86 InstrItinClass entries (PR37093)
Simon Pilgrim [Thu, 12 Apr 2018 22:44:47 +0000 (22:44 +0000)]
[X86] Remove x86 InstrItinClass entries (PR37093)

This removes the last of the x86 schedule itineraries, I'm intending to cleanup the remaining uses of NoItinerary/OpndItins/etc. before resolving PR37093.

llvm-svn: 329967

3 years ago[CachePruning] Clarify the per-directory entry limit on Linux ext4.
Fangrui Song [Thu, 12 Apr 2018 22:27:38 +0000 (22:27 +0000)]
[CachePruning] Clarify the per-directory entry limit on Linux ext4.

Summary:
508   root node entries (root_limit)
510   internal node entries (node_limit)

For a filename with 40 bytes, its sizeof(ext4_dir_entry_2) = 48, a linear directory can contain at most floor(4096/48)=85 of them.
The real per-directory entry limit should be 508*510*85 = 22021800
The limit varies with the average length of filenames.

However, the Linux ext4 code does not try rebalancing the htree, so we will not be able to create filenames in a full leaf node. This is demonstrated with the following example, certain filenames cannot be used while others can:

  % touch d/0000000000000000000000000000000000816a6f
  touch: cannot touch 'd/0000000000000000000000000000000000816a6f': No
  space left on device
  % touch d/0000000000000000000000000000000000816a70
  # succeeded

Reviewers: pcc

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D45546

llvm-svn: 329966

3 years agoRemove -cc1 option "-backend-option".
Eli Friedman [Thu, 12 Apr 2018 22:21:36 +0000 (22:21 +0000)]
Remove -cc1 option "-backend-option".

It means the same thing as -mllvm; there isn't any reason to have two
options which do the same thing.

Differential Revision: https://reviews.llvm.org/D45109

llvm-svn: 329965

3 years ago[DAGCombiner] simplify code; NFC
Sanjay Patel [Thu, 12 Apr 2018 22:14:58 +0000 (22:14 +0000)]
[DAGCombiner] simplify code; NFC

llvm-svn: 329964

3 years ago[PowerPC] add fsub-fneg test; NFC
Sanjay Patel [Thu, 12 Apr 2018 22:14:23 +0000 (22:14 +0000)]
[PowerPC] add fsub-fneg test; NFC

This is a test for a transform that was suggested in the post-commit
mailing list thread for rL329821. The target in question is not in
trunk, so PPC gets to stand in for it because it's the only in-tree
target that sets 'isFPExtFree()' to 'true'.

llvm-svn: 329963

3 years ago[asan] Remove malloc_context_size=0 from asan_device_setup.
Evgeniy Stepanov [Thu, 12 Apr 2018 22:06:18 +0000 (22:06 +0000)]
[asan] Remove malloc_context_size=0 from asan_device_setup.

This line was added in
  r243679 - [asan] Support arm64 devices in asan_device_setup
without any good reason.

llvm-svn: 329962

3 years agoDon't call skipModule for CFI lowering passes.
Eli Friedman [Thu, 12 Apr 2018 22:04:11 +0000 (22:04 +0000)]
Don't call skipModule for CFI lowering passes.

opt-bisect shouldn't skip these passes; they lower intrinsics which
no other pass can handle.

llvm-svn: 329961

3 years agoDo not keep shared symbols created from garbage-collected eliminated DSOs.
Rui Ueyama [Thu, 12 Apr 2018 21:57:04 +0000 (21:57 +0000)]
Do not keep shared symbols created from garbage-collected eliminated DSOs.

If all references to a DSO happen to be weak, and if the DSO is
specified with --as-needed, the DSO is not added to DT_NEEDED.
If that happens, we also need to eliminate shared symbols created
from the DSO. Otherwise, they become dangling references that point
to non-exsitent DSO.

Fixes https://bugs.llvm.org/show_bug.cgi?id=36991

Differential Revision: https://reviews.llvm.org/D45536

llvm-svn: 329960

3 years ago[ProfileSummary] Remove repeated cutoffs; NFCI
George Burgess IV [Thu, 12 Apr 2018 21:38:43 +0000 (21:38 +0000)]
[ProfileSummary] Remove repeated cutoffs; NFCI

I'm told the repeat of "500000, 600000," is accidental, and should be
removed.

llvm-svn: 329959

3 years ago[clangd][nfc] Simplify readDelimitedMessage()
Jan Korous [Thu, 12 Apr 2018 21:33:24 +0000 (21:33 +0000)]
[clangd][nfc] Simplify readDelimitedMessage()

istream::eof() is always false after successful getline()

llvm-svn: 329958

3 years agoLet llvm-diff correctly deal with Undef/ConstantAggregateZero/ConstantVector/IndirectBr
Brian Gesiak [Thu, 12 Apr 2018 21:28:04 +0000 (21:28 +0000)]
Let llvm-diff correctly deal with Undef/ConstantAggregateZero/ConstantVector/IndirectBr

Summary:
llvm-diff incorrectly reports that there's a diff when input IR contains undef/zeroinitializer/constantvector/indirectbr.
(This happens even if two identical files are given, e.g. `llvm-diff x.ll x.ll`)

This is fix to the bug report https://bugs.llvm.org/show_bug.cgi?id=33623 .

Reviewers: dexonsmith, rjmccall

Reviewed By: rjmccall

Subscribers: chenwj, mgrang, llvm-commits

Differential Revision: https://reviews.llvm.org/D34856

llvm-svn: 329957

3 years agoAArch64: Introduce a DAG combine for folding offsets into addresses.
Peter Collingbourne [Thu, 12 Apr 2018 21:23:55 +0000 (21:23 +0000)]
AArch64: Introduce a DAG combine for folding offsets into addresses.

This is a code size win in code that takes offseted addresses
frequently, such as C++ constructors that typically need to compute
an offseted address of a vtable. This reduces the size of Chromium
for Android's .text section by 108KB.

Differential Revision: https://reviews.llvm.org/D45199

llvm-svn: 329956

3 years ago[DebugInfo] Create merged locations for instructions other than calls
Vedant Kumar [Thu, 12 Apr 2018 20:58:24 +0000 (20:58 +0000)]
[DebugInfo] Create merged locations for instructions other than calls

This lifts a restriction on DILocation::getMergedLocation(), allowing it
to create merged locations for instructions other than calls.

Instruction::applyMergedLocation() now defaults to creating merged
locations for all instructions.

The default behavior of getMergedLocation() is unchanged: callers which
invoke it directly are unaffected.

This change will enable a follow-up Mem2Reg fix which improves crash
reporting.

Differential Revision: https://reviews.llvm.org/D45396

llvm-svn: 329955

3 years ago[ProfileSummary] Move a vector we're about to destroy anyway; NFC
George Burgess IV [Thu, 12 Apr 2018 20:54:05 +0000 (20:54 +0000)]
[ProfileSummary] Move a vector we're about to destroy anyway; NFC

llvm-svn: 329954

3 years ago[X86] Remove InstrItinClass entries from all x86 instruction defs (PR37093)
Simon Pilgrim [Thu, 12 Apr 2018 20:47:34 +0000 (20:47 +0000)]
[X86] Remove InstrItinClass entries from all x86 instruction defs (PR37093)

llvm-svn: 329953

3 years ago[NFC] Fix terrible formatting of CGRecordLower constructor.
Erich Keane [Thu, 12 Apr 2018 20:46:31 +0000 (20:46 +0000)]
[NFC] Fix terrible formatting of CGRecordLower constructor.

llvm-svn: 329952

3 years ago[demangler] Add a partial demangling API for LLDB.
Erik Pilkington [Thu, 12 Apr 2018 20:41:38 +0000 (20:41 +0000)]
[demangler] Add a partial demangling API for LLDB.

This parses a mangled name into an AST (typically an intermediate stage in
itaniumDemangle) and provides some functions to query certain properties or
print certain parts of the demangled name.

Differential revision: https://reviews.llvm.org/D44668

llvm-svn: 329951

3 years ago[demangler] NFC: Some refactoring to support partial demangling.
Erik Pilkington [Thu, 12 Apr 2018 20:41:06 +0000 (20:41 +0000)]
[demangler] NFC: Some refactoring to support partial demangling.

I'm committing this to libcxxabi too so that the two demanglers remain as
simular as possible.

llvm-svn: 329950

3 years agoRevert "[clang-tidy] [modernize-use-auto] Get only a length of token, not the token...
Zinovy Nis [Thu, 12 Apr 2018 20:33:24 +0000 (20:33 +0000)]
Revert "[clang-tidy] [modernize-use-auto] Get only a length of token, not the token itself"

This reverts r329873 as getting only a single token length is wrong for multi-token type names,
like 'unsigned long int'.

llvm-svn: 329949

3 years ago[WebAssembly] Match llvm change to custom section size
Sam Clegg [Thu, 12 Apr 2018 20:31:35 +0000 (20:31 +0000)]
[WebAssembly] Match llvm change to custom section size

Summary:
The content of custome sections no longer includes the
name itself.

See: https://reviews.llvm.org/D45579

Subscribers: jfb, dschuff, jgravelle-google, aheejin, sunfish, llvm-commits

Differential Revision: https://reviews.llvm.org/D45580

llvm-svn: 329948

3 years ago[WebAssembly] libObject: Don't include the name the size of custom sections
Sam Clegg [Thu, 12 Apr 2018 20:31:12 +0000 (20:31 +0000)]
[WebAssembly] libObject: Don't include the name the size of custom sections

Differential Revision: https://reviews.llvm.org/D45579

llvm-svn: 329947

3 years ago[MinGW] Look for libc++ headers in a triplet prefixed path as well
Martin Storsjo [Thu, 12 Apr 2018 20:07:38 +0000 (20:07 +0000)]
[MinGW] Look for libc++ headers in a triplet prefixed path as well

This makes it consistent with libstdc++ and the other default
include directories.

If these headers are found in both locations and one isn't a
symlink to the other, this will cause errors due to libc++ headers
having wrapper headers for some standard C headers, wrappers that
do #include_next the actual one.

If the same libc++ standard C wrapper header exists in more than one
include directory before the real system one, the header include
guard will stop it from doing another #include_next to pick up the
real one, breaking things.

As this is a rather uncommon situation, this should be acceptable
and toolchain maintainers can adapt accordingly if necessary.

Also simplify some of the existing code with a local variable.

Differential Revision: https://reviews.llvm.org/D45500

llvm-svn: 329946

3 years ago[X86] Remove InstrItinClass entries from SSE/AVX instructions defs (PR37093)
Simon Pilgrim [Thu, 12 Apr 2018 19:59:35 +0000 (19:59 +0000)]
[X86] Remove InstrItinClass entries from SSE/AVX instructions defs (PR37093)

llvm-svn: 329945

3 years ago[ORC] Use insert rather than emplace.
Lang Hames [Thu, 12 Apr 2018 19:54:41 +0000 (19:54 +0000)]
[ORC] Use insert rather than emplace.

Hopefully this will fix the build failure at
http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/9028

llvm-svn: 329944

3 years agoSimplify; NFCI
George Burgess IV [Thu, 12 Apr 2018 19:48:05 +0000 (19:48 +0000)]
Simplify; NFCI

llvm-svn: 329943

3 years agoFix doc typo
Vlad Tsyrklevich [Thu, 12 Apr 2018 19:35:39 +0000 (19:35 +0000)]
Fix doc typo

llvm-svn: 329942

3 years ago[RISCV] Fix logic to check if frame pointer should be used
Mandeep Singh Grang [Thu, 12 Apr 2018 19:31:37 +0000 (19:31 +0000)]
[RISCV] Fix logic to check if frame pointer should be used

Summary: The logic was broken for Linux triples as it returns true in the switch for Triple.isOSLinux().

Reviewers: asb, apazos

Reviewed By: asb

Subscribers: kito-cheng, shiva0217, cfe-commits

Differential Revision: https://reviews.llvm.org/D45237

llvm-svn: 329941

3 years ago[X86] Remove explicit SSE/AVX schedule itineraries from defs (PR37093)
Simon Pilgrim [Thu, 12 Apr 2018 19:25:07 +0000 (19:25 +0000)]
[X86] Remove explicit SSE/AVX schedule itineraries from defs (PR37093)

llvm-svn: 329940

3 years ago[RISCV] Add c.mv rs1, rs2 pattern for addi rs1, rs2, 0
Sameer AbuAsal [Thu, 12 Apr 2018 19:22:40 +0000 (19:22 +0000)]
[RISCV] Add c.mv rs1, rs2 pattern for addi rs1, rs2, 0

Summary:
GCC compresses the pseudo instruction "mv rd, rs",  which is an alias of
"addi rd, rs, 0", to "c.mv rd, rs".

In LLVM we rely on the canonical MC instruction (MCInst) to do our compression
checks and since there is no rule to compress "addi rd, rs, 0" --> "c.mv
rd, rs" we lose this compression opportunity to gcc.

 In this patch we fix that by adding an addi to c.mv compression pattern, the
 instruction "mv rd, rs" will be compressed to "c.mv rd, rs" just like
 gcc does.

Patch by Zhaoshi Zheng (zzheng) and Sameer (sabuasal).

Reviewers: asb, apazos, zzheng, mgrang, shiva0217

Reviewed By: asb

Subscribers: rbar, johnrusso, simoncook, jordy.potman.lists, niosHD, kito-cheng, llvm-commits

Differential Revision: https://reviews.llvm.org/D45583

llvm-svn: 329939

3 years ago[X86] Remove remaining gpr schedule itineraries (PR37093)
Simon Pilgrim [Thu, 12 Apr 2018 18:46:15 +0000 (18:46 +0000)]
[X86] Remove remaining gpr schedule itineraries (PR37093)

llvm-svn: 329938

3 years ago[X86] Introduce wbinvd intrinsic
Gabor Buella [Thu, 12 Apr 2018 18:42:02 +0000 (18:42 +0000)]
[X86] Introduce wbinvd intrinsic

A previously missing intrinsic for an old instruction.

Reviewers: craig.topper, echristo

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D45311

llvm-svn: 329937

3 years ago[X86] Introduce LLVM wbinvd intrinsic
Gabor Buella [Thu, 12 Apr 2018 18:38:18 +0000 (18:38 +0000)]
[X86] Introduce LLVM wbinvd intrinsic

A previously missing intrinsic for an old instruction.

Reviewers: craig.topper, echristo

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D45312

llvm-svn: 329936

3 years agoFix a typo in a comment; NFC
George Burgess IV [Thu, 12 Apr 2018 18:36:01 +0000 (18:36 +0000)]
Fix a typo in a comment; NFC

llvm-svn: 329935

3 years ago[ORC] Plumb error notifications through the VSO interface.
Lang Hames [Thu, 12 Apr 2018 18:35:08 +0000 (18:35 +0000)]
[ORC] Plumb error notifications through the VSO interface.

This allows materializers to notify the VSO that they were unable to
resolve or finalize symbols.

llvm-svn: 329934

3 years ago[X86] Remove gpr shift/extension schedule itineraries (PR37093)
Simon Pilgrim [Thu, 12 Apr 2018 18:25:38 +0000 (18:25 +0000)]
[X86] Remove gpr shift/extension schedule itineraries (PR37093)

llvm-svn: 329933

3 years agoNFC - Indentation fixes in predefined-arch-macros.c
Gabor Buella [Thu, 12 Apr 2018 18:15:39 +0000 (18:15 +0000)]
NFC - Indentation fixes in predefined-arch-macros.c

Consistently separating tests with empty lines.
Helps while navigating this file.

Reviewers: craig.topper

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D45561

llvm-svn: 329932

3 years ago[Power9]Legalize and emit code for converting (Un)Signed DWord to Quad-Precision
Lei Huang [Thu, 12 Apr 2018 18:00:14 +0000 (18:00 +0000)]
[Power9]Legalize and emit code for converting (Un)Signed DWord to Quad-Precision

Legalize and emit code for:

  * xscvsdqp
  * xscvudqp

Differential Revision: https://reviews.llvm.org/D45230

llvm-svn: 329931

3 years agoFix the try_acquire_capability attribute to behave like the other try-lock functions...
Aaron Ballman [Thu, 12 Apr 2018 17:53:21 +0000 (17:53 +0000)]
Fix the try_acquire_capability attribute to behave like the other try-lock functions. Fixes PR32954.

llvm-svn: 329930

3 years ago[MCJIT] Remove the anchor from mcjit.
Benjamin Kramer [Thu, 12 Apr 2018 17:28:30 +0000 (17:28 +0000)]
[MCJIT] Remove the anchor from mcjit.

This is a layering violation. LTO shouldn't depend on MCJIT. The right
fix for this is moving the class somewhere else.

llvm-svn: 329929

3 years agoSet the license header for all OMPT files
Joachim Protze [Thu, 12 Apr 2018 17:23:26 +0000 (17:23 +0000)]
Set the license header for all OMPT files

llvm-svn: 329928

3 years ago[Documentation] Order of changes in existing checks in Release Notes.
Eugene Zelenko [Thu, 12 Apr 2018 17:19:09 +0000 (17:19 +0000)]
[Documentation] Order of changes in existing checks in Release Notes.

llvm-svn: 329927

3 years ago[MIPS GlobalISel] remove superfluous #includes (NFC)
Petar Jovanovic [Thu, 12 Apr 2018 17:01:46 +0000 (17:01 +0000)]
[MIPS GlobalISel] remove superfluous #includes (NFC)

Remove superfluous #includes.
Minor code style change in MipsCallLowering::lowerFormalArguments().

llvm-svn: 329926

3 years ago[scudo] Remove duplicate cmake flags
Kostya Kortchinsky [Thu, 12 Apr 2018 16:41:57 +0000 (16:41 +0000)]
[scudo] Remove duplicate cmake flags

Summary:
Now that common options are propagated again for runtimes build with D45507,
the -f{data,function}-sections flags are now duplicates, remove them.

Reviewers: alekseyshl

Reviewed By: alekseyshl

Subscribers: mgorny, delcypher, #sanitizers, llvm-commits

Differential Revision: https://reviews.llvm.org/D45575

llvm-svn: 329925

3 years agoCorrectly diagnose when a conversion function is declared with a type qualifier in...
Aaron Ballman [Thu, 12 Apr 2018 16:41:55 +0000 (16:41 +0000)]
Correctly diagnose when a conversion function is declared with a type qualifier in the declaration specifiers rather than in the conversion type id. Fixes PR30595.

llvm-svn: 329924

3 years ago[Hexagon] Enable auto-vectorization only when -fvectorize was given
Krzysztof Parzyszek [Thu, 12 Apr 2018 16:25:35 +0000 (16:25 +0000)]
[Hexagon] Enable auto-vectorization only when -fvectorize was given

llvm-svn: 329923

3 years ago[AArch64] Move AFI->setRedZone(false) to top of emitPrologue
Jessica Paquette [Thu, 12 Apr 2018 16:16:18 +0000 (16:16 +0000)]
[AArch64] Move AFI->setRedZone(false) to top of emitPrologue

AFI->setRedZone(false) was put in the wrong place before, and so it only fired
on functions that didn't have stack frames. This moves that to the top of
emitPrologue to make sure that every function without a redzone has it set
correctly.

This also adds a function representing one of the early exit cases (GHC calling
convention) to the MachineOutliner noredzone test to ensure that we can outline
from functions like these, where we never use a redzone.

llvm-svn: 329922

3 years ago[Test Fix] Fix broken test Index/comment-objc-parameterized-classes.m
Ben Hamilton [Thu, 12 Apr 2018 16:00:05 +0000 (16:00 +0000)]
[Test Fix] Fix broken test Index/comment-objc-parameterized-classes.m

I broke this test in D45498 when I changed the formatter to remove
spaces before Objective-C lightweight generics.

This fixes the test.

Test Plan:
  % make -j16 check-llvm-tools-llvm-lit && ./bin/llvm-lit -sv ../llvm/tools/clang/test/Index/comment-objc-parameterized-classes.m

llvm-svn: 329921

3 years agorevert r328921 - [DAGCombine] (float)((int) f) --> ftrunc (PR36617)
Sanjay Patel [Thu, 12 Apr 2018 15:27:01 +0000 (15:27 +0000)]
revert r328921 - [DAGCombine] (float)((int) f) --> ftrunc (PR36617)

This change is exposing UB in source code - as was warned/predicted. :)
See D44909 for discussion. Reverting while we figure out how to fix things.

llvm-svn: 329920

3 years ago[clang-format] Do not break after ObjC category open paren
Ben Hamilton [Thu, 12 Apr 2018 15:11:55 +0000 (15:11 +0000)]
[clang-format] Do not break after ObjC category open paren

Summary:
Previously, `clang-format` would break Objective-C
category extensions after the opening parenthesis to avoid
breaking the protocol list:

```
% echo "@interface ccccccccccccc (ccccccccccc) <ccccccccccccc> { }" | \
  clang-format -assume-filename=foo.h -style="{BasedOnStyle: llvm, \
  ColumnLimit: 40}"
@interface ccccccccccccc (
    ccccccccccc) <ccccccccccccc> {
}
```

This looks fairly odd, as we could have kept the category extension
on the previous line.

Category extensions are a single item, so they are generally very
short compared to protocol lists. We should prefer breaking after the
opening `<` of the protocol list over breaking after the opening `(`
of the category extension.

With this diff, we now avoid breaking after the category extension's
open paren, which causes us to break after the protocol list's
open angle bracket:

```
% echo "@interface ccccccccccccc (ccccccccccc) <ccccccccccccc> { }" | \
  ./bin/clang-format -assume-filename=foo.h -style="{BasedOnStyle: llvm, \
  ColumnLimit: 40}"
@interface ccccccccccccc (ccccccccccc) <
    ccccccccccccc> {
}
```

Test Plan: New test added. Confirmed test failed before diff and
  passed after diff by running:
  % make -j16 FormatTests && ./tools/clang/unittests/Format/FormatTests

Reviewers: djasper, jolesiak

Reviewed By: djasper

Subscribers: klimek, cfe-commits

Differential Revision: https://reviews.llvm.org/D45526

llvm-svn: 329919

3 years ago[clang-format] Improve ObjC guessing heuristic by supporting all @keywords
Ben Hamilton [Thu, 12 Apr 2018 15:11:53 +0000 (15:11 +0000)]
[clang-format] Improve ObjC guessing heuristic by supporting all @keywords

Summary:
This diff improves the Objective-C guessing heuristic by
replacing the hard-coded list of a subset of Objective-C @keywords
with a general check which supports all @keywords.

I also added a few more Foundation keywords which were missing from
the heuristic.

Test Plan: Unit tests updated. Ran tests with:
  % make -j16 FormatTests && ./tools/clang/unittests/Format/FormatTests

Reviewers: djasper, jolesiak

Reviewed By: djasper

Subscribers: klimek, cfe-commits

Differential Revision: https://reviews.llvm.org/D45521

llvm-svn: 329918

3 years ago[clang-format] Don't insert space between ObjC class and lightweight generic
Ben Hamilton [Thu, 12 Apr 2018 15:11:51 +0000 (15:11 +0000)]
[clang-format] Don't insert space between ObjC class and lightweight generic

Summary:
In D45185, I added clang-format parser support for Objective-C
generics. However, I didn't touch the whitespace logic, so they
got the same space logic as Objective-C protocol lists.

In every example in the Apple SDK and in the documentation,
there is no space between the class name and the opening `<`
for the lightweight generic specification, so this diff
removes the space and updates the tests.

Test Plan: Tests updated. Ran tests with:
  % make -j16 FormatTests && ./tools/clang/unittests/Format/FormatTests

Reviewers: djasper, jolesiak

Reviewed By: djasper

Subscribers: klimek, cfe-commits

Differential Revision: https://reviews.llvm.org/D45498

llvm-svn: 329917

3 years ago[clang-format] Always indent wrapped Objective-C selector names
Ben Hamilton [Thu, 12 Apr 2018 15:11:48 +0000 (15:11 +0000)]
[clang-format] Always indent wrapped Objective-C selector names

Summary:
Currently, indentation of Objective-C method names which are wrapped
onto the next line due to a long return type is controlled by the
style option `IndentWrappedFunctionNames`.

This diff changes the behavior so we always indent wrapped Objective-C
selector names.

NOTE: I partially reverted https://github.com/llvm-mirror/clang/commit/6159c0fbd1876c7f5f984b4830c664cc78f16e2e / rL242484, as it was causing wrapped selectors to be double-indented. Its tests in FormatTestObjC.cpp still pass.

Test Plan: Tests updated. Ran tests with:
  % make -j12 FormatTests && ./tools/clang/unittests/Format/FormatTests

Reviewers: djasper, jolesiak, stephanemoore, thakis

Reviewed By: djasper

Subscribers: stephanemoore, klimek, cfe-commits

Differential Revision: https://reviews.llvm.org/D45004

llvm-svn: 329916

3 years ago[Pipeliner] Use std::stable_sort when ordering NodeSets
Krzysztof Parzyszek [Thu, 12 Apr 2018 15:11:11 +0000 (15:11 +0000)]
[Pipeliner] Use std::stable_sort when ordering NodeSets

There are cases when individual NodeSets can be equal with respect to
the ordering criteria. Since they are stored in an ordered container,
use stable_sort to preserve the relative order of equal NodeSets.

This should remove non-determinism discovered by shuffling done in
llvm::sort with expensive checks enabled.

llvm-svn: 329915

3 years agoDiagnose cases of "return x" that should be "return std::move(x)" for efficiency
Malcolm Parsons [Thu, 12 Apr 2018 14:48:48 +0000 (14:48 +0000)]
Diagnose cases of "return x" that should be "return std::move(x)" for efficiency

Summary:
This patch adds two new diagnostics, which are off by default:

**-Wreturn-std-move**

This diagnostic is enabled by `-Wreturn-std-move`, `-Wmove`, or `-Wall`.
Diagnose cases of `return x` or `throw x`, where `x` is the name of a local variable or parameter, in which a copy operation is performed when a move operation would have been available. The user probably expected a move, but they're not getting a move, perhaps because the type of "x" is different from the return type of the function.
A place where this comes up in the wild is `stdext::inplace_function<Sig, N>` which implements conversion via a conversion operator rather than a converting constructor; see https://github.com/WG21-SG14/SG14/issues/125#issue-297201412
Another place where this has come up in the wild, but where the fix ended up being different, was

    try { ... } catch (ExceptionType ex) {
        throw ex;
    }

where the appropriate fix in that case was to replace `throw ex;` with `throw;`, and incidentally to catch by reference instead of by value. (But one could contrive a scenario where the slicing was intentional, in which case throw-by-move would have been the appropriate fix after all.)
Another example (intentional slicing to a base class) is dissected in https://github.com/accuBayArea/Slides/blob/master/slides/2018-03-07.pdf

**-Wreturn-std-move-in-c++11**

This diagnostic is enabled only by the exact spelling `-Wreturn-std-move-in-c++11`.
Diagnose cases of "return x;" or "throw x;" which in this version of Clang *do* produce moves, but which prior to Clang 3.9 / GCC 5.1 produced copies instead. This is useful in codebases which care about portability to those older compilers.
The name "-in-c++11" is not technically correct; what caused the version-to-version change in behavior here was actually CWG 1579, not C++14. I think it's likely that codebases that need portability to GCC 4.9-and-earlier may understand "C++11" as a colloquialism for "older compilers." The wording of this diagnostic is based on feedback from @rsmith.

**Discussion**

Notice that this patch is kind of a negative-space version of Richard Trieu's `-Wpessimizing-move`. That diagnostic warns about cases of `return std::move(x)` that should be `return x` for speed. These diagnostics warn about cases of `return x` that should be `return std::move(x)` for speed. (The two diagnostics' bailiwicks do not overlap: we don't have to worry about a `return` statement flipping between the two states indefinitely.)

I propose to write a paper for San Diego that would relax the implicit-move rules so that in C++2a the user //would// see the moves they expect, and the diagnostic could be re-worded in a later version of Clang to suggest explicit `std::move` only "in C++17 and earlier." But in the meantime (and/or forever if that proposal is not well received), this diagnostic will be useful to detect accidental copy operations.

Reviewers: rtrieu, rsmith

Reviewed By: rsmith

Subscribers: lebedev.ri, Rakete1111, rsmith, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D43322

Patch by Arthur O'Dwyer.

llvm-svn: 329914

3 years ago[mips] Correct the predicates of the load/store (double)word for coprocessor 3.
Simon Dardis [Thu, 12 Apr 2018 14:41:38 +0000 (14:41 +0000)]
[mips] Correct the predicates of the load/store (double)word for coprocessor 3.

llvm-svn: 329913

3 years ago[X86] Remove AES/CLMUL/CRC32/LDDQU/MOVNT/POPCNT/SHA schedule itineraries (PR37093)
Simon Pilgrim [Thu, 12 Apr 2018 14:31:42 +0000 (14:31 +0000)]
[X86] Remove AES/CLMUL/CRC32/LDDQU/MOVNT/POPCNT/SHA schedule itineraries (PR37093)

llvm-svn: 329912

3 years ago[OpenCL] Added -std/-cl-std=c++
Anastasia Stulova [Thu, 12 Apr 2018 14:17:04 +0000 (14:17 +0000)]
[OpenCL] Added -std/-cl-std=c++

This is std option for OpenCL C++ v1.0.

Differential Revision: https://reviews.llvm.org/D45363

llvm-svn: 329911

3 years agoRevert "Reapply "[PR16756] Use SSAUpdaterBulk in JumpThreading." one more time."
Benjamin Kramer [Thu, 12 Apr 2018 13:52:02 +0000 (13:52 +0000)]
Revert "Reapply "[PR16756] Use SSAUpdaterBulk in JumpThreading." one more time."

This reverts commit r329865. Causes stage2/stage3 miscompare.

llvm-svn: 329910

3 years ago[AArch64][AsmParser] Unify 'addVectorListOperands' functions.
Sander de Smalen [Thu, 12 Apr 2018 13:19:32 +0000 (13:19 +0000)]
[AArch64][AsmParser] Unify 'addVectorListOperands' functions.

Summary:
Merged 'addVectorList64Operands' and 'addVectorList128Operands' into a
generic 'addVectorListOperands', which can be easily extended to work
for SVE vectors.

This is patch [4/6] in a series to add assembler/disassembler support for
SVE's contiguous ST1 (scalar+imm) instructions.

Reviewers: fhahn, rengolin, javed.absar, huntergr, SjoerdMeijer, t.p.northover, echristo, evandro

Reviewed By: rengolin

Subscribers: kristof.beyls, llvm-commits

Differential Revision: https://reviews.llvm.org/D45430

llvm-svn: 329909

3 years ago[CodeGen] Allow printing MachineMemOperands with less context in SDAGDumper
Francis Visoiu Mistrih [Thu, 12 Apr 2018 12:59:50 +0000 (12:59 +0000)]
[CodeGen] Allow printing MachineMemOperands with less context in SDAGDumper

Don't assume SelectionDAG is non-null as the targets can use it with a
null pointer.

Differential Revision: https://reviews.llvm.org/D44611

llvm-svn: 329908

3 years ago[IRCE] isKnownNonNegative helper function
Sam Parker [Thu, 12 Apr 2018 12:49:40 +0000 (12:49 +0000)]
[IRCE] isKnownNonNegative helper function

Created a helper function to query for non negative SCEVs. Uses the
SGE predicate to catch constants that could be interpreted as
negative.

Differential Revision: https://reviews.llvm.org/D45481

llvm-svn: 329907

3 years ago[X86] Remove remaining system/special schedule itineraries (PR37093)
Simon Pilgrim [Thu, 12 Apr 2018 12:43:49 +0000 (12:43 +0000)]
[X86] Remove remaining system/special schedule itineraries (PR37093)

llvm-svn: 329906

3 years ago[mips] Correct the predicates for special nops, tlb ctrl instrs, software breakpoint...
Simon Dardis [Thu, 12 Apr 2018 12:37:02 +0000 (12:37 +0000)]
[mips] Correct the predicates for special nops, tlb ctrl instrs, software breakpoint and prefx.

Reviewers: atanasyan, abeserminji

Differential Revision: https://reviews.llvm.org/D44436

llvm-svn: 329905

3 years agoAllow [[maybe_unused]] on static data members; these are considered variables and...
Aaron Ballman [Thu, 12 Apr 2018 12:21:41 +0000 (12:21 +0000)]
Allow [[maybe_unused]] on static data members; these are considered variables and the attribute should appertain to them.

Patch by S. B. Tam.

llvm-svn: 329904

3 years ago[X86] Remove system/control schedule itineraries (PR37093)
Simon Pilgrim [Thu, 12 Apr 2018 12:09:24 +0000 (12:09 +0000)]
[X86] Remove system/control schedule itineraries (PR37093)

llvm-svn: 329903

3 years ago[clang-tidy] readability-function-size: add VariableThreshold param.
Roman Lebedev [Thu, 12 Apr 2018 12:06:42 +0000 (12:06 +0000)]
[clang-tidy] readability-function-size: add VariableThreshold param.

Summary:
Pretty straight-forward, just count all the variable declarations in the function's body, and if more than the configured threshold - do complain.

Note that this continues perverse practice of disabling the new option by default.
I'm not certain where is the balance point between not being too noisy, and actually enforcing the good practice.
If we really want to not disable this by default, but also to not cause too many new warnings, we could default to 50 or so.
But that is a lot of variables too...

I was able to find one coding style referencing variable count:
  - https://www.kernel.org/doc/html/v4.15/process/coding-style.html#functions

    > Another measure of the function is the number of local variables. They shouldn’t exceed 5-10, or you’re doing something wrong.

Reviewers: hokein, xazax.hun, JonasToth, aaron.ballman, alexfh

Reviewed By: aaron.ballman

Subscribers: kimgr, Eugene.Zelenko, rnkovacs, cfe-commits

Tags: #clang-tools-extra

Differential Revision: https://reviews.llvm.org/D44602

llvm-svn: 329902

3 years ago[InstCombine][NFC]: Add tests: foldSelectICmpAndAnd(): and is commutative
Roman Lebedev [Thu, 12 Apr 2018 12:04:57 +0000 (12:04 +0000)]
[InstCombine][NFC]: Add tests: foldSelectICmpAndAnd(): and is commutative

Summary:
The fold added in D45108 did not account for the fact that
the and instruction is commutative, and if the mask is a variable,
the mask variable and the fold variable may be swapped.

I have noticed this by accident when looking into [[ https://bugs.llvm.org/show_bug.cgi?id=6773 | PR6773 ]]

Reviewers: spatel, craig.topper

Reviewed By: spatel

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D45538

llvm-svn: 329901

3 years ago[AArch64][AsmParser] Make parse function for VectorLists generic to other vector...
Sander de Smalen [Thu, 12 Apr 2018 11:40:52 +0000 (11:40 +0000)]
[AArch64][AsmParser] Make parse function for VectorLists generic to other vector types.

Summary:
Added 'RegisterKind' to the VectorListOp structure, so that this operand
type can be reused for SVE vector lists in a later patch. It also
refactors the 'tryParseVectorList' function so it can be used directly
in the ParserMethod of an operand. The parsing can now parse multiple
kinds of vectors and recover if there is no match.

This is patch [3/6] in a series to add assembler/disassembler support for
SVE's contiguous ST1 (scalar+imm) instructions.

Reviewers: fhahn, rengolin, javed.absar, huntergr, SjoerdMeijer, t.p.northover, echristo, evandro

Reviewed By: rengolin

Subscribers: kristof.beyls, llvm-commits

Differential Revision: https://reviews.llvm.org/D45429

llvm-svn: 329900