Louis Dionne [Mon, 15 Jul 2019 20:06:01 +0000 (20:06 +0000)]
[libc++] Implement P0433: deduction guides for <unordered_map>
Thanks to Arthur O'Dwyer for the patch.
Differential Revision: https://reviews.llvm.org/D58590
llvm-svn: 366124
Evgeniy Stepanov [Mon, 15 Jul 2019 20:02:23 +0000 (20:02 +0000)]
ARM MTE stack sanitizer.
Add "memtag" sanitizer that detects and mitigates stack memory issues
using armv8.5 Memory Tagging Extension.
It is similar in principle to HWASan, which is a software implementation
of the same idea, but there are enough differencies to warrant a new
sanitizer type IMHO. It is also expected to have very different
performance properties.
The new sanitizer does not have a runtime library (it may grow one
later, along with a "debugging" mode). Similar to SafeStack and
StackProtector, the instrumentation pass (in a follow up change) will be
inserted in all cases, but will only affect functions marked with the
new sanitize_memtag attribute.
Reviewers: pcc, hctim, vitalybuka, ostannard
Subscribers: srhines, mehdi_amini, javed.absar, kristof.beyls, hiraditya, cryptoad, steven_wu, dexonsmith, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D64169
llvm-svn: 366123
Eric Fiselier [Mon, 15 Jul 2019 19:53:42 +0000 (19:53 +0000)]
Constrain workaround to avoid affecting other buildbots
llvm-svn: 366122
Matt Arsenault [Mon, 15 Jul 2019 19:50:07 +0000 (19:50 +0000)]
AMDGPU/GlobalISel: Select G_AND/G_OR/G_XOR
llvm-svn: 366121
Matt Arsenault [Mon, 15 Jul 2019 19:48:36 +0000 (19:48 +0000)]
AMDGPU/GlobalISel: Don't constrain source register of VCC copies
This is a hack until I come up with a better way of dealing with the
pseudo-register banks used for boolean values. If the use instruction
constrains the register, the selector for the def instruction won't
see that the bank was VCC. A 1-bit SReg_32 is could ambiguously have
been SCCRegBank or VCCRegBank in wave32.
This is necessary to successfully select branches with and and/or/xor
condition.
llvm-svn: 366120
Matt Arsenault [Mon, 15 Jul 2019 19:46:48 +0000 (19:46 +0000)]
AMDGPU/GlobalISel: Fix selecting vcc->vcc bank copies
The extra test change is correct, although how it arrives there is a
bug that needs work. With wave32, the test for isVCC ambiguously
reports true for an SCC or VCC source. A new allocatable pseudo
register class for SCC may be necesssary.
llvm-svn: 366119
Matt Arsenault [Mon, 15 Jul 2019 19:45:49 +0000 (19:45 +0000)]
AMDGPU/GlobalISel: Fix not constraining result reg of copies to VCC
llvm-svn: 366118
Matt Arsenault [Mon, 15 Jul 2019 19:44:07 +0000 (19:44 +0000)]
AMDGPU/GlobalISel: Fix handling of sgpr (not scc bank) s1 to VCC
This was emitting a copy from a 32-bit register to a 64-bit.
llvm-svn: 366117
Matt Arsenault [Mon, 15 Jul 2019 19:43:04 +0000 (19:43 +0000)]
AMDGPU/GlobalISel: Custom legalize G_INSERT_VECTOR_ELT
llvm-svn: 366116
Matt Arsenault [Mon, 15 Jul 2019 19:40:59 +0000 (19:40 +0000)]
AMDGPU/GlobalISel: Custom legalize G_EXTRACT_VECTOR_ELT
Turn the constant cases into G_EXTRACTs.
llvm-svn: 366115
Matt Arsenault [Mon, 15 Jul 2019 19:39:31 +0000 (19:39 +0000)]
AMDGPU/GlobalISel: Fix G_ICMP for wave32
llvm-svn: 366114
Matt Arsenault [Mon, 15 Jul 2019 19:37:34 +0000 (19:37 +0000)]
GlobalISel: Implement narrowScalar for vector extract/insert indexes
llvm-svn: 366113
Matt Arsenault [Mon, 15 Jul 2019 19:12:00 +0000 (19:12 +0000)]
AMDGPU: Fix missing immarg from interp intrinsics
llvm-svn: 366110
Thomas Preud'homme [Mon, 15 Jul 2019 19:04:56 +0000 (19:04 +0000)]
[FileCheck] Store line numbers as optional values
Summary:
Processing of command-line definition of variable and logic around
implicit not directives both reuse parsing code that expects a line
number to be defined. So far, a special line number of 0 was used for
those users of the parsing code where a line number does not make sense.
This commit instead represents line numbers as Optional values so that
they can be None for those cases.
Reviewers: jhenderson, chandlerc, jdenny, probinson, grimar, arichardson, rnk
Subscribers: JonChesterfield, rogfer01, hfinkel, kristina, rnk, tra, arichardson, grimar, dblaikie, probinson, llvm-commits, hiraditya
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64639
llvm-svn: 366109
Keno Fischer [Mon, 15 Jul 2019 19:04:04 +0000 (19:04 +0000)]
[cmake] Don't set install rules for tblgen if building utils is disabled
Summary:
This is a follow up to D64032. Afterwards if building utils is disabled
and cross compilation is attempted, CMake will complain that adding
`install()` directives to targets with EXCLUDE_FROM_ALL set is "undefined".
Indeed, it appears depending on the CMake version and the selected
Generator, the install rule will error because the underlying target isn't
built. Fix that by not adding the install rule if building utils is not
requested. Note that this doesn't prevent building tblgen as a
dependency in not cross-build, even if building tools is disabled.
Reviewed By: smeenai
Differential Revision: https://reviews.llvm.org/D64225
llvm-svn: 366108
Nico Weber [Mon, 15 Jul 2019 18:56:56 +0000 (18:56 +0000)]
Expand comment about how StringsToBuckets was computed, and add more entries
The construction was explained in
https://reviews.llvm.org/D44810?id=139526#inline-391999 but reading the code
shouldn't require hunting down old reviews to understand it.
The precomputed list was missing an entry for the empty list case, and
one entry at the very end. (The current last entry is the last one where
3 * BucketCount fits in a signed int, but the reference implementation
uses unsigneds as far as I can tell, so there's room for one more entry.)
No behavior change for inputs seen in practice.
Differential Revision: https://reviews.llvm.org/D64738
llvm-svn: 366107
David Green [Mon, 15 Jul 2019 18:42:54 +0000 (18:42 +0000)]
[ARM] MVE vector for 64bit types
We need to make sure that we are sensibly dealing with vectors of types v2i64
and v2f64, even if most of the time we cannot generate native operations for
them. This mostly adds a lot of testing, plus fixes up a couple of the issues
found. And, or and xor can be legal for v2i64, and shifts combining needs a
slight fixup.
Differential Revision: https://reviews.llvm.org/D64316
llvm-svn: 366106
Matthew G McGovern [Mon, 15 Jul 2019 18:42:14 +0000 (18:42 +0000)]
[sanitizers][windows][mingw32] Mingw32 RTL fixes
RTL interception broke mingw32, this should fix those builds by
removing dependency on windows.h
reviewed in https://reviews.llvm.org/D64694
llvm-svn: 366105
Wouter van Oortmerssen [Mon, 15 Jul 2019 18:36:07 +0000 (18:36 +0000)]
[WebAssembly] Assembler: recognize .init_array as data section.
Reviewers: sbc100
Subscribers: dschuff, jgravelle-google, aheejin, sunfish, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64602
llvm-svn: 366104
Matt Arsenault [Mon, 15 Jul 2019 18:31:10 +0000 (18:31 +0000)]
AMDGPU/GlobalISel: Widen vector extracts
llvm-svn: 366103
Matt Arsenault [Mon, 15 Jul 2019 18:25:24 +0000 (18:25 +0000)]
AMDGPU/GlobalISel: Handle llvm.amdgcn.if.break
llvm-svn: 366102
Konstantin Zhuravlyov [Mon, 15 Jul 2019 18:22:06 +0000 (18:22 +0000)]
AMDGPU: Remove reserved value accidentally left in for gfx908
llvm-svn: 366101
Matt Arsenault [Mon, 15 Jul 2019 18:18:46 +0000 (18:18 +0000)]
AMDGPU/GlobalISel: Select llvm.amdgcn.end.cf
llvm-svn: 366099
Sanjay Patel [Mon, 15 Jul 2019 18:17:23 +0000 (18:17 +0000)]
[x86] try to keep FP casted+truncated+extracted vector element out of GPRs
inttofp (trunc (extelt X, 0)) --> inttofp (extelt (bitcast X), 0)
We have pseudo-vectorization of scalar int to FP casts, so this tries to
make that more likely by replacing a truncate with a bitcast. I didn't see
any test diffs starting from 'uitofp', so I left that as a TODO. We can't
only match the shorter trunc+extract pattern because there's an opposing
transform somewhere, so we infinite loop. Waiting to try this during
lowering is another possibility.
A motivating case is shown in PR39975 and included in the test diffs here:
https://bugs.llvm.org/show_bug.cgi?id=39975
Differential Revision: https://reviews.llvm.org/D64710
llvm-svn: 366098
Stella Stamenova [Mon, 15 Jul 2019 18:15:12 +0000 (18:15 +0000)]
[llvm-lib] Add a dependency to intrinsics_gen to the LLVMLibDriver build
Summary:
Occasionally the build of LLVMLibDriver will fail because Attributes.inc has not been generated yet. Add an explicit dependency, so that we can guarantee that the file has been generated before LLVMLibDriver is build.
##[error]llvm\include\llvm\IR\Attributes.h(73,0): Error C1083: Cannot open include file: 'llvm/IR/Attributes.inc': No such file or directory
llvm\include\llvm/IR/Attributes.h(73): fatal error C1083: Cannot open include file: 'llvm/IR/Attributes.inc': No such file or directory [LLVMLibDriver.vcxproj]
Reviewers: asmith
Subscribers: mgorny, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64357
llvm-svn: 366097
Craig Topper [Mon, 15 Jul 2019 17:56:57 +0000 (17:56 +0000)]
[X86] Return UNDEF from LowerScalarImmediateShift when the shift amount is out of range.
I think we only turn out of range shiftss to undef when
all elements are out of range or the shift amount is a splat out
of range. I'm not sure which, I didn't check.
During lowering we can split a shift where some elements
are out of range into multiple shifts. This can create a
new shift with a splat shift amount that is out of range.
This patch returns undef for this case.
Fixes PR42615.
Differential Revision: https://reviews.llvm.org/D64699
llvm-svn: 366096
Reid Kleckner [Mon, 15 Jul 2019 17:51:02 +0000 (17:51 +0000)]
Reland "[COFF] Add null check in case of symbols defined in LTO blobs"
This reverts r365990 (git commit
1a6053ebc61cb0b8146f5ca27b74859a9a91e0a3)
The test no longer depends on the Visual C++ libraries. I confirmed that
the crash still reproduces with the new test case if I remove the null
check.
llvm-svn: 366095
Matt Arsenault [Mon, 15 Jul 2019 17:50:31 +0000 (17:50 +0000)]
AMDGPU: Add 24-bit mul intrinsics
Insert these during codegenprepare.
This works around a DAG issue where generic combines eliminate the and
asserting the high bits are zero, which then exposes an unknown read
source to the mul combine. It doesn't worth the hassle of trying to
insert an AssertZext or something to try to deal with it.
llvm-svn: 366094
Matt Arsenault [Mon, 15 Jul 2019 17:50:28 +0000 (17:50 +0000)]
Add some release notes for 9.0 release
llvm-svn: 366093
Stanislav Mekhanoshin [Mon, 15 Jul 2019 17:49:25 +0000 (17:49 +0000)]
[AMDGPU] Copy missing predicate from pseudo to real
NFC at the momemnt, needed for future commit.
Differential Revision: https://reviews.llvm.org/D64761
llvm-svn: 366092
Sylvestre Ledru [Mon, 15 Jul 2019 17:47:22 +0000 (17:47 +0000)]
Update __VERSION__ to remove the hardcoded 4.2.1 version
Summary:
Just like in https://reviews.llvm.org/D56803
for -dumpversion
Reviewers: rnk
Reviewed By: rnk
Subscribers: dexonsmith, lebedev.ri, hubert.reinterpretcast, xbolva00, fedor.sergeev, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D63048
llvm-svn: 366091
Johannes Doerfert [Mon, 15 Jul 2019 17:31:26 +0000 (17:31 +0000)]
[FunctionAttrs] Remove readonly and writeonly assertion
There are scenarios where mutually recursive functions may cause the SCC
to contain both read only and write only functions. This removes an
assertion when adding read attributes which caused a crash with a the
provided test case, and instead just doesn't add the attributes.
Patch by Luke Lau <luke.lau@intel.com>
Differential Revision: https://reviews.llvm.org/D60761
llvm-svn: 366090
David Green [Mon, 15 Jul 2019 17:29:06 +0000 (17:29 +0000)]
[ARM] Minor formatting in ARMInstrMVE.td. NFC
llvm-svn: 366089
Nico Weber [Mon, 15 Jul 2019 17:27:46 +0000 (17:27 +0000)]
Use a unique_ptr instead of manual memory management for LineTable
llvm-svn: 366088
Matt Arsenault [Mon, 15 Jul 2019 17:26:43 +0000 (17:26 +0000)]
AMDGPU/GlobalISel: Select easy cases for G_BUILD_VECTOR
llvm-svn: 366087
Matt Arsenault [Mon, 15 Jul 2019 17:20:40 +0000 (17:20 +0000)]
AMDGPU/GlobalISel: RegBankSelect for G_CONCAT_VECTORS
llvm-svn: 366086
Nico Weber [Mon, 15 Jul 2019 17:20:34 +0000 (17:20 +0000)]
Use a unique_ptr instead of manual memory management for CustomDiagInfo
llvm-svn: 366085
Nico Weber [Mon, 15 Jul 2019 17:12:08 +0000 (17:12 +0000)]
Use unique_ptr instead of manual delete in one place. No behavior change.
llvm-svn: 366084
Raphael Isemann [Mon, 15 Jul 2019 17:10:44 +0000 (17:10 +0000)]
[lldb][doc] Document how our LLDB table gen initialized options
Summary: This patch adds documentation that should make it easier to migrate from using the old initializers to the table gen format.
Reviewers: jingham
Reviewed By: jingham
Subscribers: abidh, lldb-commits, JDevlieghere
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D64670
llvm-svn: 366083
Sanjay Patel [Mon, 15 Jul 2019 16:59:38 +0000 (16:59 +0000)]
[x86] add tests for reductions that might be better with more horizontal ops; NFC
llvm-svn: 366082
Ilya Biryukov [Mon, 15 Jul 2019 16:43:36 +0000 (16:43 +0000)]
Revert "r366069: [PatternMatch] Implement matching code for LibFunc"
Reason: the change introduced a layering violation by adding a
dependency on IR to Analysis.
llvm-svn: 366081
James Henderson [Mon, 15 Jul 2019 16:40:34 +0000 (16:40 +0000)]
[docs][llvm-nm] Fix inconsistent grammar
llvm-svn: 366080
Simon Pilgrim [Mon, 15 Jul 2019 16:23:42 +0000 (16:23 +0000)]
[X86][SSE] Regenerated packss.ll test file.
Not sure what went wrong in rL366077....
llvm-svn: 366079
Simon Pilgrim [Mon, 15 Jul 2019 15:43:04 +0000 (15:43 +0000)]
[X86][SSE] Add PACKSS with zero shuffle masks.
This is an example of expansion due to D61129 - it should combine back to a PACKSS with a zero operand.
llvm-svn: 366077
Yonghong Song [Mon, 15 Jul 2019 15:42:41 +0000 (15:42 +0000)]
fix unnamed fiefield issue and add tests for __builtin_preserve_access_index intrinsic
This is a followup patch for https://reviews.llvm.org/D61809.
Handle unnamed bitfield properly and add more test cases.
Fixed the unnamed bitfield issue. The unnamed bitfield is ignored
by debug info, so we need to ignore such a struct/union member
when we try to get the member index in the debug info.
D61809 contains two test cases but not enough as it does
not checking generated IRs in the fine grain level, and also
it does not have semantics checking tests.
This patch added unit tests for both code gen and semantics checking for
the new intrinsic.
Signed-off-by: Yonghong Song <yhs@fb.com>
llvm-svn: 366076
Lang Hames [Mon, 15 Jul 2019 15:36:37 +0000 (15:36 +0000)]
[ORC] Start adding ORCv1 to ORCv2 transition tips to the ORCv2 doc.
llvm-svn: 366075
Stanislav Mekhanoshin [Mon, 15 Jul 2019 15:34:05 +0000 (15:34 +0000)]
[AMDGPU] fixed scheduler crash in gfx908
For some reason scheduler can send down an SUnit without an
instruction.
Differential Revision: https://reviews.llvm.org/D64709
llvm-svn: 366074
Kadir Cetinkaya [Mon, 15 Jul 2019 15:16:57 +0000 (15:16 +0000)]
[clangd] Fix doc
llvm-svn: 366073
Nico Weber [Mon, 15 Jul 2019 15:14:09 +0000 (15:14 +0000)]
gn build: Add a note on how to locally tell git to ignore build dir
llvm-svn: 366072
Dmitry Preobrazhensky [Mon, 15 Jul 2019 15:12:16 +0000 (15:12 +0000)]
[AMDGPU][MC][GFX9][GFX10] Added support of GET_DOORBELL message
Reviewers: artem.tamazov, arsenm
Differential Revision: https://reviews.llvm.org/D64729
llvm-svn: 366071
Johan Vikstrom [Mon, 15 Jul 2019 15:08:27 +0000 (15:08 +0000)]
[clangd] Fix duplicate highlighting tokens appearing in initializer lists.
Summary: The RecursiveASTVisitor sometimes visits exprs in initializer lists twice. Added deduplication to prevent duplicate highlighting tokens from appearing. Done by sorting and a linear search.
Reviewers: hokein, sammccall, ilya-biryukov
Subscribers: MaskRay, jkorous, mgrang, arphaman, kadircet, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D64634
llvm-svn: 366070
Dmitry Venikov [Mon, 15 Jul 2019 14:47:45 +0000 (14:47 +0000)]
[PatternMatch] Implement matching code for LibFunc
Summary: Provides m_LibFunc pattern that can be used to match LibFuncs.
Reviewers: spatel, hfinkel, efriedma, lebedev.ri
Reviewed By: lebedev.ri
Subscribers: lebedev.ri, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D42047
llvm-svn: 366069
Alexey Bataev [Mon, 15 Jul 2019 14:46:23 +0000 (14:46 +0000)]
[OPENMP]Add support for analysis of if clauses.
Summary:
Added support for analysis of if clauses in the OpenMP directives to be
able to check for the use of uninitialized variables.
Reviewers: NoQ
Subscribers: guansong, jfb, jdoerfert, caomhin, kkwli0, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D64646
llvm-svn: 366068
Dmitry Preobrazhensky [Mon, 15 Jul 2019 14:37:57 +0000 (14:37 +0000)]
[AMDGPU][MC] Corrected encoding of src0 for DS_GWS_* instructions
See bug 42599: https://bugs.llvm.org/show_bug.cgi?id=42599
Reviewers: artem.tamazov, arsenm
Differential Revision: https://reviews.llvm.org/D64716
llvm-svn: 366067
Simon Pilgrim [Mon, 15 Jul 2019 14:29:14 +0000 (14:29 +0000)]
[X86] isTargetShuffleEquivalent - assert the expected mask is correctly formed. NFCI.
While we don't make any assumptions about the actual mask, assert that the expected mask only contains valid mask element values.
llvm-svn: 366066
David Zarzycki [Mon, 15 Jul 2019 14:12:35 +0000 (14:12 +0000)]
[Testing] Add missing "REQUIRES: asserts"
This broke after r366048 / https://reviews.llvm.org/D63923
llvm-svn: 366065
Simon Atanasyan [Mon, 15 Jul 2019 13:12:36 +0000 (13:12 +0000)]
[mips] Remove "else-after-return". NFC
llvm-svn: 366064
Anastasia Stulova [Mon, 15 Jul 2019 13:02:21 +0000 (13:02 +0000)]
[OpenCL] Deduce addr space for pointee of dependent types in instantiation.
Since pointee doesn't require context sensitive addr space deduction
it's easier to handle pointee of dependent types during templ
instantiation.
Differential Revision: https://reviews.llvm.org/D64400
llvm-svn: 366063
Simon Pilgrim [Mon, 15 Jul 2019 13:00:43 +0000 (13:00 +0000)]
Fix uninitialized variable analyzer warning. NFCI.
llvm-svn: 366062
Balazs Keri [Mon, 15 Jul 2019 12:16:30 +0000 (12:16 +0000)]
[ASTImporter] Using Lang_CXX14 in ASTImporterVisibilityTest.
Summary:
These tests may work with C++14 language constructs in the future
(variable templates and others).
To avoid warnings about language version C++ version constants in the tests
are updated.
Reviewers: martong, a.sidorin
Reviewed By: martong
Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D64477
llvm-svn: 366061
Nico Weber [Mon, 15 Jul 2019 12:10:02 +0000 (12:10 +0000)]
PDB HashTable: Make iterator key type const
Having the hash table key change during iteration is bad, so make it
impossible. Nothing relied on the key type not being const.
(This is also necessary to be able to call the const version of
iterator_facade_base::operator->(). Nothing calls this, and nothing
will, but I tried using it locally during development and it took me a
while to understand what was going wrong.)
Also rename the iterator typedef to const_iterator.
No behavior change.
Differential Revision: https://reviews.llvm.org/D64641
llvm-svn: 366060
Anastasia Stulova [Mon, 15 Jul 2019 11:58:10 +0000 (11:58 +0000)]
[OpenCL][PR41727] Prevent ICE on global dtors
Pass NULL to pointer arg of __cxa_atexit if addr space
is not matching with its param. This doesn't align yet
with how dtors are generated that should be changed too.
Differential Revision: https://reviews.llvm.org/D62413
llvm-svn: 366059
George Rimar [Mon, 15 Jul 2019 11:53:39 +0000 (11:53 +0000)]
Recommit r366052 "[obj2yaml] - Rework tool's error reporting logic for ELF target."
No changes, LLD code was updated in r366057.
Original commit message:
ELF.h contains two getSymbol methods
which seems to be used only from obj2yaml.
One of these methods calls another, which in turn
contains untested error message which doesn't
provide enough information.
Problem is that after improving only just that message,
obj2yaml will not show it,
("Error reading file: yaml: Invalid data was
encountered while parsing the file" message will be shown instead),
because internal errors handling of tool is based on ErrorOr<> class which
stores a error code and as a result can only show a predefined error string, what
actually isn't very useful.
In this patch, I rework obj2yaml's error reporting system
for ELF targets to use Error Expected<> classes.
Also, I improve the error message produced
by getSymbol for demonstration of the new functionality.
Differential revision: https://reviews.llvm.org/D64631
llvm-svn: 366058
George Rimar [Mon, 15 Jul 2019 11:47:54 +0000 (11:47 +0000)]
[LLD][ELF] - Minor simplification. NFC.
This removes a call to `object::getSymbol<ELFT>`.
We used this function in a next way: it was given an
array of symbols and index and returned either a symbol
at the index given or a error.
This function was removed in D64631.
(rL366052, but was reverted because of LLD compilation error
that I didn't know about).
It does not make much sense to keep this function on LLVM side
only for LLD, because having only a list of symbols and the index it
is not able to produce a valueable error message about context anyways.
llvm-svn: 366057
David Green [Mon, 15 Jul 2019 11:35:39 +0000 (11:35 +0000)]
[ARM] MVE Vector Shifts
This adds basic lowering for MVE shifts. There are many shifts in MVE, but the
instructions handled here are:
VSHL (imm)
VSHRu (imm)
VSHRs (imm)
VSHL (vector)
VSHL (register)
MVE, like NEON before it, doesn't have shift right by a vector (or register).
We instead have to negate the amount and shift in the opposite direction. This
means we have to convert any SHR's into a form of SHL (that is still signed or
unsigned) with a negated condition and selecting from there. MVE still does
have shifting by an immediate for SHL, ASR and LSR.
This adds lowering for these and for register forms, which work well for shift
lefts but may require an extra fold of neg(vdup(x)) -> vdup(neg(x)) to potentially
work optimally for right shifts.
Differential Revision: https://reviews.llvm.org/D64212
llvm-svn: 366056
Diana Picus [Mon, 15 Jul 2019 11:33:41 +0000 (11:33 +0000)]
[libFuzzer] Disable fork.test on AArch64
This crashes sporadically on our AArch64 buildbots. Disable for now.
llvm-svn: 366055
David Green [Mon, 15 Jul 2019 11:22:05 +0000 (11:22 +0000)]
[ARM] Move Shifts after Bits. NFC
This just moves the shift instruction definitions further down the
ARMInstrMVE.td file, to make positioning patterns slightly more natural.
llvm-svn: 366054
George Rimar [Mon, 15 Jul 2019 11:00:42 +0000 (11:00 +0000)]
Revert r366052 "[obj2yaml] - Rework tool's error reporting logic for ELF target."
Seems it broke LLD:
http://lab.llvm.org:8011/builders/sanitizer-windows/builds/48434
llvm-svn: 366053
George Rimar [Mon, 15 Jul 2019 10:50:03 +0000 (10:50 +0000)]
[obj2yaml] - Rework tool's error reporting logic for ELF target.
ELF.h contains two getSymbol methods
which seems to be used only from obj2yaml.
One of these methods calls another, which in turn
contains untested error message which doesn't
provide enough information.
Problem is that after improving only just that message,
obj2yaml will not show it,
("Error reading file: yaml: Invalid data was
encountered while parsing the file" message will be shown instead),
because internal errors handling of tool is based on ErrorOr<> class which
stores a error code and as a result can only show a predefined error string, what
actually isn't very useful.
In this patch, I rework obj2yaml's error reporting system
for ELF targets to use Error Expected<> classes.
Also, I improve the error message produced
by getSymbol for demonstration of the new functionality.
Differential revision: https://reviews.llvm.org/D64631
llvm-svn: 366052
David Green [Mon, 15 Jul 2019 10:44:50 +0000 (10:44 +0000)]
[ARM] Adjust how NEON shifts are lowered
This adjusts the way that we lower NEON shifts to use a DAG target node, not
via a neon intrinsic. This is useful for handling MVE shifts operations in the
same the way. It also renames some of the immediate shift nodes for
consistency, and moves some of the processing of immediate shifts into
LowerShift allowing it to capture more cases.
Differential Revision: https://reviews.llvm.org/D64426
llvm-svn: 366051
Serguei Katkov [Mon, 15 Jul 2019 09:13:11 +0000 (09:13 +0000)]
[Loop Peeling] Fix the bug with IDom setting for exit loops
It is possible that loop exit has two predecessors in a loop body.
In this case after the peeling the iDom of the exit should be a clone of
iDom of original exit but no a clone of a block coming to this exit.
Reviewers: reames, fhahn
Reviewed By: reames
Subscribers: hiraditya, zzheng, llvm-commits
Differential Revision: https://reviews.llvm.org/D64618
llvm-svn: 366050
Florian Hahn [Mon, 15 Jul 2019 08:48:47 +0000 (08:48 +0000)]
[LoopVectorize] Pass unfiltered list of arguments to getIntrinsicInstCost.
We do not compute the scalarization overhead in getVectorIntrinsicCost
and TTI::getIntrinsicInstrCost requires the full arguments list.
llvm-svn: 366049
Serguei Katkov [Mon, 15 Jul 2019 08:26:45 +0000 (08:26 +0000)]
[Loop Peeling] Enable peeling for loops with multiple exits
This CL enables peeling of the loop with multiple exits where
one exit should be from latch and others are basic blocks with
call to deopt.
The peeling is enabled under the flag which is false by default.
Reviewers: reames, mkuper, iajbar, fhahn
Reviewed By: reames
Subscribers: xbolva00, hiraditya, zzheng, llvm-commits
Differential Revision: https://reviews.llvm.org/D63923
llvm-svn: 366048
Johan Vikstrom [Mon, 15 Jul 2019 08:12:21 +0000 (08:12 +0000)]
[clangd] Added highlighting for members and methods.
Summary: Added highlighting for members and methods.
Reviewers: hokein, sammccall, ilya-biryukov
Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D64617
llvm-svn: 366047
Richard Sandiford [Mon, 15 Jul 2019 08:09:21 +0000 (08:09 +0000)]
DeveloperPolicy: fix a typo
llvm-svn: 366046
Johan Vikstrom [Mon, 15 Jul 2019 07:41:12 +0000 (07:41 +0000)]
[clangd] Added highlighting to enum constants.
Summary: VSCode does not have a scope for enum constants. So they were placed under "constant.other.enum" as that seems to be the most correct scope for enum constants. However, this makes theia color them blue (the same color it uses for keywords).
Reviewers: hokein, sammccall, ilya-biryukov
Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D64624
llvm-svn: 366045
Fangrui Song [Mon, 15 Jul 2019 07:25:11 +0000 (07:25 +0000)]
[PowerPC] Support -mabi=ieeelongdouble and -mabi=ibmlongdouble
gcc PowerPC supports 3 representations of long double:
* -mlong-double-64
long double has the same representation of double but is mangled as `e`.
In clang, this is the default on AIX, FreeBSD and Linux musl.
* -mlong-double-128
2 possible 128-bit floating point representations:
+ -mabi=ibmlongdouble
IBM extended double format. Mangled as `g`
In clang, this is the default on Linux glibc.
+ -mabi=ieeelongdouble
IEEE 754 quadruple-precision format. Mangled as `u9__ieee128` (`U10__float128` before gcc 8.2)
This is currently unavailable.
This patch adds -mabi=ibmlongdouble and -mabi=ieeelongdouble, and thus
makes the IEEE 754 quadruple-precision long double available for
languages supported by clang.
Reviewed By: hfinkel
Differential Revision: https://reviews.llvm.org/D64283
llvm-svn: 366044
Hideto Ueno [Mon, 15 Jul 2019 06:49:04 +0000 (06:49 +0000)]
[Attributor] Deduce "nonnull" attribute
Summary:
Porting nonnull attribute to attributor.
Reviewers: jdoerfert, sstefan1
Reviewed By: jdoerfert
Subscribers: xbolva00, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D63604
llvm-svn: 366043
Serguei Katkov [Mon, 15 Jul 2019 06:42:39 +0000 (06:42 +0000)]
[LoopUtils] Extend the scope of getLoopEstimatedTripCount
With this patch the getLoopEstimatedTripCount function will
accept also the loops where there are more than one exit but
all exits except latch block should ends up with a call to deopt.
This side exits should not impact the estimated trip count.
Reviewers: reames, mkuper, danielcdh
Reviewed By: reames
Subscribers: fhahn, lebedev.ri, hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D64553
llvm-svn: 366042
Bill Wendling [Mon, 15 Jul 2019 06:35:28 +0000 (06:35 +0000)]
Remove set but unused variable.
llvm-svn: 366041
Serguei Katkov [Mon, 15 Jul 2019 05:51:10 +0000 (05:51 +0000)]
[LoopInfo] Introduce getUniqueNonLatchExitBlocks utility function
Extract the code from LoopUnrollRuntime into utility function to
re-use it in D63923.
Reviewers: reames, mkuper
Reviewed By: reames
Subscribers: fhahn, hiraditya, zzheng, dmgreen, llvm-commits
Differential Revision: https://reviews.llvm.org/D64548
llvm-svn: 366040
Fangrui Song [Mon, 15 Jul 2019 05:02:32 +0000 (05:02 +0000)]
[PowerPC] Support fp128 libcalls
On PowerPC, IEEE 754 quadruple-precision libcall names use "kf" instead of "tf".
In libgcc, libgcc/config/rs6000/float128-sed converts TF names to KF
names. This patch implements its 24 substitution rules.
Reviewed By: hfinkel
Differential Revision: https://reviews.llvm.org/D64282
llvm-svn: 366039
Yonghong Song [Mon, 15 Jul 2019 04:51:34 +0000 (04:51 +0000)]
[BPF] add unit tests for preserve_{array,union,struct}_access_index intrinsics
This is a followup patch for https://reviews.llvm.org/D61810/new/,
which adds new intrinsics preserve_{array,union,struct}_access_index.
Currently, only BPF backend utilizes preserve_{array,union,struct}_access_index
intrinsics, so all tests are compiled with BPF target.
https://reviews.llvm.org/D61524 already added some tests for these
intrinsics, but some of them pretty complex.
This patch added a few unit test cases focusing on individual intrinsic
functions.
Also made a few clarification on language reference for these intrinsics.
Differential Revision: https://reviews.llvm.org/D64606
llvm-svn: 366038
Kang Zhang [Mon, 15 Jul 2019 03:55:10 +0000 (03:55 +0000)]
[NFC][PowerPC] Add the test block-placement.mir
llvm-svn: 366037
Johannes Doerfert [Mon, 15 Jul 2019 03:24:35 +0000 (03:24 +0000)]
[ValueTracking] Look through constant Int2Ptr/Ptr2Int expressions
Summary:
This is analogous to the int2ptr/ptr2int instruction handling introduced
in D54956.
Reviewers: fhahn, efriedma, spatel, nlopes, sanjoy, lebedev.ri
Subscribers: hiraditya, bollu, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64708
llvm-svn: 366036
Craig Topper [Mon, 15 Jul 2019 02:02:31 +0000 (02:02 +0000)]
[X86] Separate the memory size of vzext_load/vextract_store from the element size of the result type. Use them improve the codegen of v2f32 loads/stores with sse1 only.
Summary:
SSE1 only supports v4f32. But does have instructions like movlps/movhps that load/store 64-bits of memory.
This patch breaks the connection between the node VT of the vzext_load/vextract_store patterns and the memory VT. Enabling a v4f32 node with a 64-bit memory VT. I've used i64 as the memory VT here. I've written the PatFrag predicate to just check the store size not the specific VT. I think the VT will only matter for CSE purposes. We could use v2f32, but if we want to start using these operations in more places a simple integer type might make the most sense.
I'd like to maybe use this same thing for SSE2 and later as well, but that will need more work to be supported by EltsFromConsecutiveLoads to avoid regressing lit tests. I'd maybe also like to combine bitcasts with these load/stores nodes now that the types are disconnected. And I'd also like to consider canonicalizing (scalar_to_vector + load) to vzext_load.
If you want I can split the mechanical tablegen stuff where I added the 32/64 off from the sse1 change.
Reviewers: spatel, RKSimon
Reviewed By: RKSimon
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64528
llvm-svn: 366034
Eric Fiselier [Sun, 14 Jul 2019 21:29:39 +0000 (21:29 +0000)]
Improve compile time of variant.
In particular, improve the compile time of the overload set builder
that variant uses to determine which alternative to construct.
Instead of having the __overload type construct itself recursively,
this patch uses a flat construction for the overload set.
llvm-svn: 366033
Eric Fiselier [Sun, 14 Jul 2019 20:59:51 +0000 (20:59 +0000)]
Add test for variant construction with duplicate types.
llvm-svn: 366032
Alexandros Lamprineas [Sun, 14 Jul 2019 20:31:15 +0000 (20:31 +0000)]
[TargetParser][ARM] Account dependencies when processing target features
Teaches ARM::appendArchExtFeatures to account dependencies when processing
target features: i.e. when you say -march=armv8.1-m.main+mve.fp+nofp it
means mve.fp should get discarded too. (Split from D63936)
Differential Revision: https://reviews.llvm.org/D64048
llvm-svn: 366031
Florian Hahn [Sun, 14 Jul 2019 20:12:36 +0000 (20:12 +0000)]
[LV] Exclude loop-invariant inputs from scalar cost computation.
Loop invariant operands do not need to be scalarized, as we are using
the values outside the loop. We should ignore them when computing the
scalarization overhead.
Fixes PR41294
Reviewers: hsaito, rengolin, dcaballe, Ayal
Reviewed By: Ayal
Differential Revision: https://reviews.llvm.org/D59995
llvm-svn: 366030
Simon Pilgrim [Sun, 14 Jul 2019 19:13:09 +0000 (19:13 +0000)]
Fix uninitialized variable analyzer warning. NFCI.
llvm-svn: 366029
JF Bastien [Sun, 14 Jul 2019 18:33:51 +0000 (18:33 +0000)]
Support __seg_fs and __seg_gs on x86
Summary:
GCC supports named address spaces macros:
https://gcc.gnu.org/onlinedocs/gcc/Named-Address-Spaces.html
clang does as well with address spaces:
https://clang.llvm.org/docs/LanguageExtensions.html#memory-references-to-specified-segments
Add the __seg_fs and __seg_gs macros for compatibility with GCC.
<rdar://problem/
52944935>
Subscribers: jkorous, dexonsmith, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D64676
llvm-svn: 366028
Alexandros Lamprineas [Sun, 14 Jul 2019 18:32:42 +0000 (18:32 +0000)]
[clang][Driver][ARM] Favor -mfpu over default CPU features
When processing the command line options march, mcpu and mfpu, we store
the implied target features on a vector. The change D62998 introduced a
temporary vector, where the processed features get accumulated. When
calling DecodeARMFeaturesFromCPU, which sets the default features for
the specified CPU, we certainly don't want to override the features
that have been explicitly specified on the command line. Therefore, the
default features should appear first in the final vector. This problem
became evident once I added the missing (unhandled) target features in
ARM::getExtensionFeatures.
Differential Revision: https://reviews.llvm.org/D63936
llvm-svn: 366027
Eric Fiselier [Sun, 14 Jul 2019 18:31:55 +0000 (18:31 +0000)]
Cleanup whitespace in <variant>. NFC.
llvm-svn: 366026
Eric Fiselier [Sun, 14 Jul 2019 18:30:34 +0000 (18:30 +0000)]
Harden variant test added in r366022
The test was brittle since it only went boom for one specific type, when
really it should go boom for all of them.
llvm-svn: 366025
Sylvestre Ledru [Sun, 14 Jul 2019 18:25:09 +0000 (18:25 +0000)]
consistency in the release notes
llvm-svn: 366024
Johannes Doerfert [Sun, 14 Jul 2019 18:24:19 +0000 (18:24 +0000)]
[GitSVN][NFC] Mark dry-run commits as such in the log output
Summary: This helps to avoid worries about the "dry run flag" while testing.
Reviewers: jyknight, rnk, mehdi_amini
Subscribers: bollu, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64697
llvm-svn: 366023
Eric Fiselier [Sun, 14 Jul 2019 18:21:15 +0000 (18:21 +0000)]
Avoid eager template instantiation caused by the variant narrowing checks.
The standard disallows narrowing conversions when constructing a variant.
This is checked by attempting to perform braced initialization of the
destination type from the argument type. However, braced initialization
can force the compiler (mostly clang) to eagerly instantiate the
constructors of the destintation type -- which can lead to errors in
a non-immediate context.
However, as variant is currently specified, the narrowing checks only
observably apply when the destination type is arithmetic. Meaning we can
skip the check for class types. Hense avoiding the hard errors.
In order to cause fewer build breakages, this patch avoids the narrowing
check except when the destination type is arithmetic.
llvm-svn: 366022
Nikita Popov [Sun, 14 Jul 2019 15:55:32 +0000 (15:55 +0000)]
[InstCombine] Add assume context test; NFC
Baseline test for D37215.
llvm-svn: 366021
Simon Pilgrim [Sun, 14 Jul 2019 15:05:05 +0000 (15:05 +0000)]
[Hashing] hash_1to3_bytes - avoid trunc(v + zext(x)) NFCI.
MSVC complains about the extension to uint64_t for an addition followed by truncation back to uint32_t - add an explicit uint32_t cast to avoid this.
llvm-svn: 366020