Seiya Nuta [Tue, 25 Jun 2019 01:08:21 +0000 (01:08 +0000)]
[llvm-objcopy][NFCI] Fix build failure with GCC
Here is unreachable since the switch statement above is exhaustive.
llvm-svn: 364263
Matt Arsenault [Tue, 25 Jun 2019 01:07:22 +0000 (01:07 +0000)]
AMDGPU/GlobalISel: Fix regbankselect for amdgcn.class
llvm-svn: 364262
Vitaly Buka [Tue, 25 Jun 2019 01:01:46 +0000 (01:01 +0000)]
[sanitizer] Enabled getpw_getgr.cc on iOS
Reviewers: kubamracek, delcypher, yln
Reviewed By: delcypher
Subscribers: yln, delcypher, llvm-commits, kubamracek, #sanitizers
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D57786
llvm-svn: 364261
Adrian Prantl [Tue, 25 Jun 2019 00:55:27 +0000 (00:55 +0000)]
Reapply "Fix a crash in option parsing."
with an additional read-out-of-bounds bugfix applied.
Differential Revision: https://reviews.llvm.org/D63110
llvm-svn: 364260
Csaba Dabis [Tue, 25 Jun 2019 00:44:33 +0000 (00:44 +0000)]
[analyzer] ExprEngine: Escape pointers in bitwise operations
Summary:
After evaluation it would be an Unknown value and tracking would be lost.
Reviewers: NoQ, xazax.hun, ravikandhadai, baloghadamsoftware, Szelethus
Reviewed By: NoQ
Subscribers: szepet, rnkovacs, a.sidorin, mikhail.ramalho, donat.nagy,
dkrupp, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D63720
llvm-svn: 364259
Huihui Zhang [Tue, 25 Jun 2019 00:14:02 +0000 (00:14 +0000)]
[InstCombine][NFC] Add test to show missing fold for icmp ult/uge (shl %x, C2), C1.
Summary:
'shl' inequality test
```
icmp ult/uge (shl %x, C2), C1 iff C1 is power of two
```
can be simplified as 'and' equality test
```
icmp eq/ne (and %x, (lshr -C1, C2)), 0.
```
Reviewers: lebedev.ri, efriedma
Reviewed By: lebedev.ri
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D63670
llvm-svn: 364256
Huihui Zhang [Tue, 25 Jun 2019 00:09:10 +0000 (00:09 +0000)]
[InstCombine] Fold icmp eq/ne (and %x, C), 0 iff (-C) is power of two -> %x u</u>= (-C) earlier.
Summary:
To generate simplified IR, make sure fold
(X & ~C) ==/!= 0 --> X u</u>= C+1
is scheduled before fold
((X << Y) & C) == 0 -> (X & (C >> Y)) == 0.
https://rise4fun.com/Alive/7ZN
Reviewers: lebedev.ri, efriedma, spatel, craig.topper
Reviewed By: lebedev.ri
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D63505
llvm-svn: 364255
Seiya Nuta [Tue, 25 Jun 2019 00:02:04 +0000 (00:02 +0000)]
[llvm-objcopy][NFC] Refactor output target parsing
Summary:
Use an enum instead of string to hold the output file format in Config.InputFormat and Config.OutputFormat. It's essential to support other output file formats other than ELF.
Reviewers: espindola, alexshap, rupprecht, jhenderson
Reviewed By: rupprecht, jhenderson
Subscribers: jyknight, compnerd, emaste, arichardson, fedor.sergeev, jakehehrlich, MaskRay, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D63239
llvm-svn: 364254
David Blaikie [Mon, 24 Jun 2019 23:45:18 +0000 (23:45 +0000)]
DataExtractor: use decodeSLEB128 to implement getSLEB128
Should've been NFC, but turns out DataExtractor had better test coverage
for decoding SLEB128 than the decodeSLEB128 did - revealing a couple of
bugs (one in the error handling, another in sign extension). So fixed
those to get the DataExtractor tests passing again.
llvm-svn: 364253
Seiya Nuta [Mon, 24 Jun 2019 23:39:01 +0000 (23:39 +0000)]
[llvm-objcopy][MachO] Fix strict-aliasing warning. NFCI
Summary:
Use MachOObjectFile::isRelocationScattered instead of reinterpret_cast.
Fixes https://bugs.llvm.org/show_bug.cgi?id=42360
Reviewers: alexshap, rupprecht, jhenderson
Reviewed By: alexshap
Subscribers: dendibakh, bjope, uabelho, jakehehrlich, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D63699
llvm-svn: 364252
Matt Arsenault [Mon, 24 Jun 2019 23:34:06 +0000 (23:34 +0000)]
AMDGPU: Fix missing declaration for mbcnt builtins
llvm-svn: 364251
Tim Shen [Mon, 24 Jun 2019 23:29:20 +0000 (23:29 +0000)]
Revert "[NVPTX][NFC] Fix documentation for shfl instructions." The
original documentation is correct as it matches the C++ builtins.
llvm-svn: 364250
Douglas Yung [Mon, 24 Jun 2019 23:16:32 +0000 (23:16 +0000)]
[NFC] Fix tests added in r364225 which failed on Windows due to incorrect path separators.
llvm-svn: 364249
Tim Shen [Mon, 24 Jun 2019 23:16:32 +0000 (23:16 +0000)]
[NVPTX][NFC] Fix documentation for shfl instructions.
llvm-svn: 364248
Vitaly Buka [Mon, 24 Jun 2019 22:42:53 +0000 (22:42 +0000)]
[NFC] Add missing consts into memoryaccess_def_iterator
llvm-svn: 364247
Sanjay Patel [Mon, 24 Jun 2019 22:35:26 +0000 (22:35 +0000)]
[InstCombine] squash is-not-power-of-2 using ctpop
This is the Demorgan'd 'not' of the pattern handled in:
D63660 / rL364153
This is another intermediate IR step towards solving PR42314:
https://bugs.llvm.org/show_bug.cgi?id=42314
We can test if a value is not a power-of-2 using ctpop(X) > 1,
so combining that with an is-zero check of the input is the
same as testing if not exactly 1 bit is set:
(X == 0) || (ctpop(X) u> 1) --> ctpop(X) != 1
llvm-svn: 364246
Douglas Yung [Mon, 24 Jun 2019 22:26:08 +0000 (22:26 +0000)]
Fix test cl-response-file.c to work on all platforms including Windows/Solaris.
Differential Revision: https://reviews.llvm.org/D63678
llvm-svn: 364245
Matt Arsenault [Mon, 24 Jun 2019 22:21:02 +0000 (22:21 +0000)]
AMDGPU/GlobalISel: Add tests for regbankselect of v2s16 and/or/xor
llvm-svn: 364244
Jason Molenda [Mon, 24 Jun 2019 22:08:43 +0000 (22:08 +0000)]
Don't link against the DebugSymbols private framework; try to dlopen
+ dlsym the two functions we need from there at runtime.
I'm not maintaining a negative cache if DebugSymbols is absent, so
we'll try to dlopen() it on every call to
LocateMacOSXFilesUsingDebugSymbols but this file is only built on
mac and iOS type systems, so there's a slight perf impact running
lldb on an iOS type system.
I store the function pointer results in two global variables without
any locking; two threads calling into LocateMacOSXFilesUsingDebugSymbols
for the first time will both try to set these fptrs, but they'll be
setting them to the same value, so I'm not too worried.
I didn't see where in the cmake build configurations we link against
DebugSymbols, but I removed the dependency from the xcode project
file.
<rdar://problem/
49458356>
llvm-svn: 364243
Richard Smith [Mon, 24 Jun 2019 22:01:03 +0000 (22:01 +0000)]
Fix test failures due to modified wording in Clang diagnostics.
llvm-svn: 364241
Jason Molenda [Mon, 24 Jun 2019 21:48:13 +0000 (21:48 +0000)]
Add windows abi plugin, breakpointprecondition.
llvm-svn: 364240
Richard Smith [Mon, 24 Jun 2019 21:46:05 +0000 (21:46 +0000)]
Fix test failures when using a custom ABI namespace.
llvm-svn: 364239
Vasileios Porpodas [Mon, 24 Jun 2019 21:40:48 +0000 (21:40 +0000)]
[SLP] NFC: Fixed typo in comment
llvm-svn: 364237
Ilya Biryukov [Mon, 24 Jun 2019 21:39:51 +0000 (21:39 +0000)]
[Syntax] Do not glue multiple empty PP expansions to a single mapping
Summary:
This change makes sure we have a single mapping for each macro expansion,
even if the result of expansion was empty.
To achieve that, we take information from PPCallbacks::MacroExpands into
account. Previously we relied only on source locations of expanded tokens.
Reviewers: sammccall
Reviewed By: sammccall
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D62953
llvm-svn: 364236
Matt Arsenault [Mon, 24 Jun 2019 21:37:03 +0000 (21:37 +0000)]
InstCombine: Preserve nuw when reassociating nuw ops [3/3]
Alive says this is OK.
llvm-svn: 364235
Matt Arsenault [Mon, 24 Jun 2019 21:37:02 +0000 (21:37 +0000)]
InstCombine: Preserve nuw when reassociating nuw ops [2/3]
Alive says this is OK.
llvm-svn: 364234
Matt Arsenault [Mon, 24 Jun 2019 21:36:59 +0000 (21:36 +0000)]
InstCombine: Preserve nuw when reassociating nuw ops [1/3]
Alive says this is OK.
llvm-svn: 364233
Cameron McInally [Mon, 24 Jun 2019 21:36:09 +0000 (21:36 +0000)]
[NFC][Reassociate] Add unary FNeg tests to fast-ReassociateVector.ll
llvm-svn: 364232
Sajjad Mirza [Mon, 24 Jun 2019 21:32:50 +0000 (21:32 +0000)]
(Reland with changes) Adding a function for setting coverage output file.
Summary:
User code can open a file on its own and pass it to the runtime, rather than
specifying a name and having the runtime open the file. This supports the use
case where a process cannot open a file on its own but can receive a file
descriptor from another process.
Relanding https://reviews.llvm.org/D62541. The original revision unlocked
the file before calling flush, this revision fixes that.
Reviewers: Dor1s, davidxl
Reviewed By: Dor1s
Subscribers: #sanitizers, llvm-commits
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D63581
llvm-svn: 364231
David Blaikie [Mon, 24 Jun 2019 20:43:36 +0000 (20:43 +0000)]
NFC: DataExtractor: use decodeULEB128 to implement getULEB128
llvm-svn: 364230
Alex Langford [Mon, 24 Jun 2019 20:33:09 +0000 (20:33 +0000)]
[Target] Hoist LanguageRuntime::GetDeclVendor
Summary:
It's possible that each LanguageRuntime could have its own DeclVendor,
so let's hoist that out of ObjCLanguageRuntime into LanguageRuntime.
Additionally, this gives the opportunity to remove SBTarget's dependency
on ObjCLanguageRuntime.
Reviewers: JDevlieghere, labath, compnerd, davide
Subscribers: lldb-commits
Differential Revision: https://reviews.llvm.org/D63622
llvm-svn: 364229
Nikita Popov [Mon, 24 Jun 2019 20:13:13 +0000 (20:13 +0000)]
[CVP] Reenable nowrap flag inference
Inference of nowrap flags in CVP has been disabled, because it
triggered a bug in LFTR (https://bugs.llvm.org/show_bug.cgi?id=31181).
This issue has been fixed in D60935, so we should be able to reenable
nowrap flag inference now.
Differential Revision: https://reviews.llvm.org/D62776
llvm-svn: 364228
Sanjay Patel [Mon, 24 Jun 2019 20:11:40 +0000 (20:11 +0000)]
[InstCombine] add tests for more variants of isPowerOf2; NFC
llvm-svn: 364227
Aaron Ballman [Mon, 24 Jun 2019 20:07:11 +0000 (20:07 +0000)]
Augment location information when dumping the AST to JSON.
Rather than create JSON objects for source locations and ranges, we instead stream them out directly. This allows us to elide duplicate information (without JSON field reordering causing an issue) like file names and line numbers, similar to the text dump. This also adds token length information when dumping the source location.
llvm-svn: 364226
Peter Collingbourne [Mon, 24 Jun 2019 20:03:23 +0000 (20:03 +0000)]
llvm-symbolizer: Add a FRAME command.
This command prints a description of the referenced function's stack frame.
For each formal parameter and local variable, the tool prints:
- function name
- variable name
- file/line of declaration
- FP-relative variable location (if available)
- size in bytes
- HWASAN tag offset
This information will be used by the HWASAN runtime to identify local
variables in UAR reports.
Differential Revision: https://reviews.llvm.org/D63468
llvm-svn: 364225
Huihui Zhang [Mon, 24 Jun 2019 19:49:42 +0000 (19:49 +0000)]
[InstCombine] Regenerate test pr17827. NFCI.
Prep work for upcoming patch D63505.
llvm-svn: 364224
Alex Langford [Mon, 24 Jun 2019 19:43:22 +0000 (19:43 +0000)]
[ABI] Remove unused variables in ABIWindows_x86_64
llvm-svn: 364223
Julie Hockett [Mon, 24 Jun 2019 19:31:02 +0000 (19:31 +0000)]
[clang-doc] Add basic support for templates and typedef
In serialize::parseBases(...), when a base record is a template
specialization, the specialization was used as the parent. It should be
the base template so there is only one file generated for this record.
When the specialized template is implicitly declared the reference USR
corresponded to the GlobalNamespace's USR, this will now be the base
template's USR.
More information about templates will be added later.
In serialize::emiInfo(RecorDecl*, ...), typedef records were not handled
and the name was empty. This is now handled and a IsTypeDef attribute is
added to RecordInfo struct.
In serialize::emitInfo(CXXMethodDecl*, ...), template specialization is
handled like in serialize::parseBases(...).
Bitcode writer and reader are modified to handle the new attribute of
RecordInfo.
Submitted on behalf of Diego Astiazarán (diegoaat97@gmail.com)
Differential Revision: https://reviews.llvm.org/D63367
llvm-svn: 364222
Roland Froese [Mon, 24 Jun 2019 19:27:07 +0000 (19:27 +0000)]
[CodeGen] Add missing vector type legalization for ctlz_zero_undef
Widen vector result type for ctlz_zero_undef and cttz_zero_undef the same as
ctlz and cttz.
Differential Revision: https://reviews.llvm.org/D63463
llvm-svn: 364221
Philip Reames [Mon, 24 Jun 2019 19:26:17 +0000 (19:26 +0000)]
[Tests] Add cases where we're failing to discharge provably loop exits (tests for D63733)
llvm-svn: 364220
Cameron McInally [Mon, 24 Jun 2019 19:24:23 +0000 (19:24 +0000)]
[SLP] Support unary FNeg vectorization
Differential Revision: https://reviews.llvm.org/D63609
llvm-svn: 364219
Nico Weber [Mon, 24 Jun 2019 18:47:53 +0000 (18:47 +0000)]
Remove flag for no longer supported MSVC version
llvm-svn: 364218
Alex Langford [Mon, 24 Jun 2019 18:21:05 +0000 (18:21 +0000)]
[ABI] Implement Windows ABI for x86_64
Summary:
Implement the ABI for WIndows-x86_64 including register info and calling convention.
Handled nested struct returned in register (SysV doesn't have it supported)
Reviewers: xiaobai, compnerd
Reviewed By: compnerd
Subscribers: labath, jasonmolenda, fedor.sergeev, mgorny, teemperor, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D62213
llvm-svn: 364216
Matt Arsenault [Mon, 24 Jun 2019 18:02:18 +0000 (18:02 +0000)]
AMDGPU/GlobalISel: Select G_TRUNC
llvm-svn: 364215
Matt Arsenault [Mon, 24 Jun 2019 18:00:47 +0000 (18:00 +0000)]
AMDGPU/GlobalISel: RegBankSelect for amdgcn.class
llvm-svn: 364214
Jinsong Ji [Mon, 24 Jun 2019 18:00:34 +0000 (18:00 +0000)]
[PowerPC][UpdateTestChecks] powerpc- triple support
There are quite some old testcases with powerpc- triple,
we should add this triple support so that we can update them with script.
Differential Revision: https://reviews.llvm.org/D63723
llvm-svn: 364213
Matt Arsenault [Mon, 24 Jun 2019 17:54:12 +0000 (17:54 +0000)]
AMDGPU/GlobalISel: Split VALU s64 G_ZEXT/G_SEXT in RegBankSelect
Scalar extends to s64 can use S_BFE_{I64|U64}, but vector extends need
to extend to the 32-bit half, and then to 64.
I'm not sure what the line should be between what RegBankSelect
handles, and what instruction select does, but for now I'm erring on
the side of RegBankSelect for future post-RBS combines.
llvm-svn: 364212
Yuanfang Chen [Mon, 24 Jun 2019 17:47:56 +0000 (17:47 +0000)]
[llvm-objdump] Match GNU objdump on symbol types shown in disassembly
output.
STT_OBJECT and STT_COMMON are dumped as data, not disassembled.
https://bugs.llvm.org/show_bug.cgi?id=41947
Differential Revision: https://reviews.llvm.org/D62964
llvm-svn: 364211
Aaron Smith [Mon, 24 Jun 2019 17:43:47 +0000 (17:43 +0000)]
Move common functionality from processwindows into processdebugger
Summary:
This change extracts functionalities from processwindows into a
introduced processdebugger that can be reused in native process
debugging.
The main reason is that the native process debugging
can't directly be based on processwindows or be implemented
as a pass-through to this plugin since the plugin has ties to
Target and Process classes that are needed in host debugging but
not necessary in native debugging.
Reviewers: labath, Hui, jfb, clayborg, amccarth
Reviewed By: labath
Subscribers: amccarth, dexonsmith, mgorny, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D63166
llvm-svn: 364210
Tim Renouf [Mon, 24 Jun 2019 17:35:20 +0000 (17:35 +0000)]
[AMDGPU] Allow any value in unused src0 field in v_nop
Summary:
The LLVM disassembler assumes that the unused src0 operand of v_nop is
zero. Other tools can put another value in that field, which is still
valid. This commit fixes the LLVM disassembler to recognize such an
encoding as v_nop, in the same way as we already do for s_getpc.
Differential Revision: https://reviews.llvm.org/D63724
Change-Id: Iaf0363eae26ff92fc4ebc716216476adbff37a6f
llvm-svn: 364208
Craig Topper [Mon, 24 Jun 2019 17:28:41 +0000 (17:28 +0000)]
[X86] Don't a vzext_movl in LowerBuildVectorv16i8/LowerBuildVectorv8i16 if there are no zeroes in the vector we're building.
In LowerBuildVectorv16i8 we took care to use an any_extend if the first pair is in the lower 16-bits of the vector and no elements are 0. So bits [31:16] will be undefined. But we still emitted a vzext_movl to ensure that bits [127:32] are 0. If we don't need any zeroes we should be consistent and make all of 127:16 undefined.
In LowerBuildVectorv8i16 we can just delete the vzext_movl code because we only use the scalar_to_vector when there are no zeroes. So the vzext_movl is always unnecessary.
Found while investigating whether (vzext_movl (scalar_to_vector (loadi32)) patterns are necessary. At least one of the cases where they were necessary was where the loadi32 matched 32-bit aligned 16-bit extload. Seemed weird that we required vzext_movl for that case.
Differential Revision: https://reviews.llvm.org/D63700
llvm-svn: 364207
Craig Topper [Mon, 24 Jun 2019 17:28:26 +0000 (17:28 +0000)]
[X86] Cleanups and safety checks around the isFNEG
This patch does a few things to start cleaning up the isFNEG function.
-Remove the Op0/Op1 peekThroughBitcast calls that seem unnecessary. getTargetConstantBitsFromNode has its own peekThroughBitcast inside. And we have a separate peekThroughBitcast on the return value.
-Add a check of the scalar size after the first peekThroughBitcast to ensure we haven't changed the element size and just did something like f32->i32 or f64->i64.
-Remove an unnecessary check that Op1's type is floating point after the peekThroughBitcast. We're just going to look for a bit pattern from a constant. We don't care about its type.
-Add VT checks on several places that consume the return value of isFNEG. Due to the peekThroughBitcasts inside, the type of the return value isn't guaranteed. So its not safe to use it to build other nodes without ensuring the type matches the type being used to build the node. We might be able to replace these checks with bitcasts instead, but I don't have a test case so a bail out check seemed better for now.
Differential Revision: https://reviews.llvm.org/D63683
llvm-svn: 364206
Simon Pilgrim [Mon, 24 Jun 2019 17:18:20 +0000 (17:18 +0000)]
[AArch64] Regenerate vcvt tests. NFCI.
Prep work for an upcoming patch
llvm-svn: 364205
Simon Pilgrim [Mon, 24 Jun 2019 16:58:19 +0000 (16:58 +0000)]
[AArch64] Regenerate 2velem tests. NFCI.
Prep work for an upcoming patch
llvm-svn: 364204
Simon Pilgrim [Mon, 24 Jun 2019 16:57:12 +0000 (16:57 +0000)]
[AArch64] Regenerate merge-store tests. NFCI.
Prep work for an upcoming patch
llvm-svn: 364203
Leonard Chan [Mon, 24 Jun 2019 16:49:18 +0000 (16:49 +0000)]
[clang][NewPM] Add RUNS for tests that produce slightly different IR under new PM
For CodeGenOpenCL/convergent.cl, the new PM produced a slightly different for
loop, but this still checks for no loop unrolling as intended. This is
committed separately from D63174.
llvm-svn: 364202
Leonard Chan [Mon, 24 Jun 2019 16:44:27 +0000 (16:44 +0000)]
[clang][NewPM] Remove exception handling before loading pgo sample profile data
This patch ensures that SimplifyCFGPass comes before SampleProfileLoaderPass
on PGO runs in the new PM and fixes clang/test/CodeGen/pgo-sample.c.
Differential Revision: https://reviews.llvm.org/D63626
llvm-svn: 364201
Simon Pilgrim [Mon, 24 Jun 2019 16:25:30 +0000 (16:25 +0000)]
[X86] Regenerate fast fadd reduction tests. NFCI
Fix whitespace.
llvm-svn: 364200
Matt Arsenault [Mon, 24 Jun 2019 16:24:03 +0000 (16:24 +0000)]
AMDGPU/GlobalISel: Fix selecting G_IMPLICIT_DEF for s1
Try to fail for scc, since I don't think that should ever be produced.
llvm-svn: 364199
Ayke van Laethem [Mon, 24 Jun 2019 16:23:17 +0000 (16:23 +0000)]
[bindings/go] Add debug information accessors
Add debug information accessors, as provided in the following patches:
https://reviews.llvm.org/D46627 (DILocation)
https://reviews.llvm.org/D52693 metadata kind
https://reviews.llvm.org/D60481 get/set debug location on a Value
https://reviews.llvm.org/D60489 (DIScope)
The API as proposed in this patch is similar to the current Value API,
with a single root type and methods that are only valid for certain
subclasses. I have considered just implementing generic Line() calls
(that are valid on all DINodes that have a line) but the implementation
of that got a bit awkward without support from the C API. I've also
considered creating generic getters like a Metadata.DebugLoc() that
returns a DebugLoc, but there is a mismatch between the Go DI nodes in
the LLVM API and the actual DINode class hierarchy, so that's also hard
to get right (without being confusing or breaking the API).
Differential Revision: https://reviews.llvm.org/D63056
llvm-svn: 364198
Csaba Dabis [Mon, 24 Jun 2019 16:19:39 +0000 (16:19 +0000)]
[analyzer] print() JSONify: ProgramPoint revision
Summary: Now we also print out the filename with its path.
Reviewers: NoQ
Reviewed By: NoQ
Subscribers: xazax.hun, baloghadamsoftware, szepet, a.sidorin,
mikhail.ramalho, Szelethus, donat.nagy, dkrupp, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D63438
llvm-svn: 364197
Matt Arsenault [Mon, 24 Jun 2019 16:16:19 +0000 (16:16 +0000)]
Hexagon: Rename another copy of Register class
For some reason clang is happy with the conflict, but MSVC is not.
llvm-svn: 364196
Matt Arsenault [Mon, 24 Jun 2019 16:16:16 +0000 (16:16 +0000)]
ARC: Fix -Wimplicit-fallthrough
llvm-svn: 364195
Matt Arsenault [Mon, 24 Jun 2019 16:16:12 +0000 (16:16 +0000)]
GlobalISel: Remove unsigned variant of SrcOp
Force using Register.
One downside is the generated register enums require explicit
conversion.
llvm-svn: 364194
Csaba Dabis [Mon, 24 Jun 2019 16:06:44 +0000 (16:06 +0000)]
[analyzer] Fix JSON dumps for ExplodedNodes
Summary:
- Now we could see the `has_report` property in `trim-egraph` mode.
- This patch also removes the trailing comma after each node.
Reviewers: NoQ
Reviewed By: NoQ
Subscribers: xazax.hun, baloghadamsoftware, szepet, a.sidorin,
mikhail.ramalho, Szelethus, donat.nagy, dkrupp, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D63436
llvm-svn: 364193
Matt Arsenault [Mon, 24 Jun 2019 15:50:29 +0000 (15:50 +0000)]
CodeGen: Introduce a class for registers
Avoids using a plain unsigned for registers throughoug codegen.
Doesn't attempt to change every register use, just something a little
more than the set needed to build after changing the return type of
MachineOperand::getReg().
llvm-svn: 364191
Bjorn Pettersson [Mon, 24 Jun 2019 15:50:18 +0000 (15:50 +0000)]
[AMDGPU] Remove unused variable AllSGPRSpilledToVGPRs. NFC
Summary:
Removing the unused variable AllSGPRSpilledToVGPRs in
SIFrameLowering::processFunctionBeforeFrameFinalized
to avoid
error: variable 'AllSGPRSpilledToVGPRs' set but not used
[-Werror=unused-but-set-variable]
Reviewers: arsenm, nhaehnle
Reviewed By: nhaehnle
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D63721
llvm-svn: 364190
Alexey Bataev [Mon, 24 Jun 2019 15:30:20 +0000 (15:30 +0000)]
[OPENMP]Relax the test checks to pacify 32bit buildbots, NFC.
llvm-svn: 364189
Matt Arsenault [Mon, 24 Jun 2019 15:27:29 +0000 (15:27 +0000)]
Hexagon: Rename Register class
This avoids a naming conflict in a future patch.
llvm-svn: 364188
Sanjay Patel [Mon, 24 Jun 2019 15:20:49 +0000 (15:20 +0000)]
[InstCombine] reduce funnel-shift i16 X, X, 8 to bswap X
Prefer the more exact intrinsic to remove a use of the input value
and possibly make further transforms easier (we will still need
to match patterns with funnel-shift of wider types as pieces of
bswap, especially if we want to canonicalize to funnel-shift with
constant shift amount). Discussed in D46760.
llvm-svn: 364187
Matt Arsenault [Mon, 24 Jun 2019 14:53:58 +0000 (14:53 +0000)]
AMDGPU/GlobalISel: Fix RegBankSelect for s1 sext/zext/anyext
This needs different handling if the source is known to be a valid
condition or not. Handle turning it into shifts or a select during
regbankselect.
llvm-svn: 364186
Matt Arsenault [Mon, 24 Jun 2019 14:53:56 +0000 (14:53 +0000)]
AMDGPU: Fold frame index into MUBUF
This matters for byval uses outside of the entry block, which appear
as copies.
Previously, the only folding done was during selection, which could
not see the underlying frame index. For any uses outside the entry
block, the frame index was materialized in the entry block relative to
the global scratch wave offset.
This may produce worse code in cases where the offset ends up not
fitting in the MUBUF offset field. A better heuristic would be helpfu
for extreme frames.
llvm-svn: 364185
Sanjay Patel [Mon, 24 Jun 2019 14:47:02 +0000 (14:47 +0000)]
[InstCombine] add tests for funnel-shift to bswap; NFC
llvm-svn: 364184
Konstantin Pyzhov [Mon, 24 Jun 2019 14:40:20 +0000 (14:40 +0000)]
[CUDA][HIP] Don't set comdat attribute for CUDA device stub functions.\nDifferential Revision: https://reviews.llvm.org/D63277
llvm-svn: 364183
Matt Arsenault [Mon, 24 Jun 2019 14:34:40 +0000 (14:34 +0000)]
AMDGPU: Cleanup checking when spills need emergency slots
Address fixme, which should no longer be a problem since r363757.
llvm-svn: 364182
Simon Pilgrim [Mon, 24 Jun 2019 13:13:36 +0000 (13:13 +0000)]
[InstCombine] SliceUpIllegalIntegerPHI - bail on out of range shifts
trunc(lshr) handling - if the shift is out of range (undefined) then bail like we do for non-constant shifts.
Fixes OSS Fuzz #15217
llvm-svn: 364181
Sam McCall [Mon, 24 Jun 2019 13:01:28 +0000 (13:01 +0000)]
[clangd] Improve SelectionTree string representation
llvm-svn: 364180
Simon Pilgrim [Mon, 24 Jun 2019 12:47:17 +0000 (12:47 +0000)]
[DAGCombine] visitMUL - allow shift by zero in MulByConstant.
This can occur under certain circumstances when undefs are created later on in the constant multipliers (e.g. in this case due to SimplifyDemandedVectorElts). Its better to let the shift by zero to occur and perform any cleanup afterward.
Fixes OSS Fuzz #15429
llvm-svn: 364179
Bjorn Pettersson [Mon, 24 Jun 2019 12:07:17 +0000 (12:07 +0000)]
[ConstantFolding] Use hasVectorInstrinsicScalarOpd. NFC
Summary:
Use the hasVectorInstrinsicScalarOpd helper function
in ConstantFoldVectorCall.
Reviewers: rengolin, RKSimon, dblaikie
Reviewed By: rengolin, RKSimon
Subscribers: tschuett, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D63705
llvm-svn: 364178
Bjorn Pettersson [Mon, 24 Jun 2019 12:07:11 +0000 (12:07 +0000)]
[Scalarizer] Add scalarizer support for smul.fix.sat
Summary:
Handle smul.fix.sat in the scalarizer. This is done by
adding smul.fix.sat to the set of "isTriviallyVectorizable"
intrinsics.
The addition of smul.fix.sat in isTriviallyVectorizable and
hasVectorInstrinsicScalarOpd can also be seen as a preparation
to be able to use hasVectorInstrinsicScalarOpd in ConstantFolding.
Reviewers: rengolin, RKSimon, dblaikie
Reviewed By: rengolin
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D63704
llvm-svn: 364177
James Henderson [Mon, 24 Jun 2019 10:50:49 +0000 (10:50 +0000)]
[docs][llvm-nm] Add missing options to documentation
There were several options missing from the documentation. This patch
adds them as well as improving some wording and separating the Mach-O
only options into a separate section.
Fixes https://bugs.llvm.org/show_bug.cgi?id=42234.
Reviewed by: MaskRay
Differential Revision: https://reviews.llvm.org/D63655
llvm-svn: 364176
Fangrui Song [Mon, 24 Jun 2019 10:23:47 +0000 (10:23 +0000)]
[sancov] Avoid unnecessary unique_ptr
llvm-svn: 364175
Sven van Haastregt [Mon, 24 Jun 2019 10:06:40 +0000 (10:06 +0000)]
[OpenCL] Restore ATOMIC_VAR_INIT
We accidentally lost the ATOMIC_VAR_INIT and ATOMIC_FLAG_INIT macros
in r363794.
Also put the `memory_order` typedef back inside a `>= CL2.0` guard.
llvm-svn: 364174
Sven van Haastregt [Mon, 24 Jun 2019 10:06:34 +0000 (10:06 +0000)]
[OpenCL] Remove more duplicates from opencl-c.h
Identified the duplicate declarations using
sort lib/Headers/opencl-c.h | uniq -c | grep ' 2'
llvm-svn: 364173
Simon Tatham [Mon, 24 Jun 2019 10:00:39 +0000 (10:00 +0000)]
[ARM] Add MVE interleaving load/store family.
This adds the family of loads and stores with names like VLD20.8 and
VST42.32, which load and store parts of multiple q-registers in such a
way that executing both VLD20 and VLD21, or all four of VLD40..VLD43,
will distribute 2 or 4 vectors' worth of memory data across the lanes
of the same number of registers but in a transposed order.
In addition to the Tablegen descriptions of the instructions
themselves, this patch also adds encode and decode support for the
QQPR and QQQQPR register classes (representing the range of loaded or
stored vector registers), and tweaks to the parsing system for lists
of vector registers to make it return the right format in this case
(since, unlike NEON, MVE regards q-registers as primitive, and not
just an alias for two d-registers).
llvm-svn: 364172
James Henderson [Mon, 24 Jun 2019 09:53:02 +0000 (09:53 +0000)]
[docs][llvm-nm] Improve symbol code documentation
The existing symbol code documentation was very incomplete. This patch
adds the missing codes, and defines them based on the current code
behaviour.
Fixes https://bugs.llvm.org/show_bug.cgi?id=42231.
Reviewed by: rupprecht, mtrent, MaskRay
Differential Revision: https://reviews.llvm.org/D63327
llvm-svn: 364171
Michal Gorny [Mon, 24 Jun 2019 09:40:33 +0000 (09:40 +0000)]
[libcxx] [test] Read files as bytestrings to fix py3 encoding issues
Use binary mode to read test files in libcxx LibcxxTestFormat class.
This ensures that tests are read correctly independently of encoding,
and therefore fixes UnicodeDecodeError when file is opened in Python 3
that defaults to pure ASCII encoding.
Technically this could be also fixed via conditionally appending
encoding argument when opening the file in Python 3. However, since
the code in question only searches for fixed ASCII substrings reading
it in binary mode is simpler and more universal.
Differential Revision: https://reviews.llvm.org/D63346
llvm-svn: 364170
Pavel Labath [Mon, 24 Jun 2019 09:11:24 +0000 (09:11 +0000)]
[Support] Fix error handling in DataExtractor::get[US]LEB128
Summary:
These functions are documented as not modifying the offset argument if
the extraction fails (just like other DataExtractor functions). However,
while reviewing D63591 we discovered that this is not the case -- if the
function reaches the end of the data buffer, it will just return the
value parsed until that point and set offset to point to the end of the
buffer.
This fixes the functions to act as advertised, and adds a regression
test.
Reviewers: dblaikie, probinson, bkramer
Subscribers: kristina, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D63645
llvm-svn: 364169
Sjoerd Meijer [Mon, 24 Jun 2019 08:44:29 +0000 (08:44 +0000)]
Follow up of rL363913. NFC.
Minor reshuffle in AArch64 targetparser unittest, solving a potential problem
with querying iterators too early.
llvm-svn: 364168
George Rimar [Mon, 24 Jun 2019 08:29:54 +0000 (08:29 +0000)]
[llvm-readobj/llvm-readelf] - Eliminate the elf-groups.x86_64 precompiled binary from the inputs.
We do not need the elf-groups.x86_64. In one of the tests, it was
used for no solid reason, and for the second test case we can use
YAML input with SHT_GROUP sections.
The patch performs a cleanup of one of the test cases, removes another
one completely (since during the review was found out it actually
duplicates one of the existent tests) and removes the precompiled binary.
Differential revision: https://reviews.llvm.org/D63647
llvm-svn: 364167
Richard Smith [Mon, 24 Jun 2019 05:53:11 +0000 (05:53 +0000)]
PR42362: Fix auto deduction of template parameter packs from
type-dependent argument packs.
We need to strip off the PackExpansionExpr to get the real (dependent)
type rather than an opaque DependentTy.
llvm-svn: 364165
Fangrui Song [Mon, 24 Jun 2019 05:37:20 +0000 (05:37 +0000)]
[ELF][PPC][X86] Use [-2**(n-1), 2**n) to check overflows for R_PPC_ADDR16, R_PPC64_ADDR{16,32}, R_X86_64_{8,16}
Similar to R_AARCH64_ABS32, R_PPC64_ADDR32 can represent either a signed
value or unsigned value, thus we should use `[-2**(n-1), 2**n)` instead of
`[-2**(n-1), 2**(n-1))` to check overflows.
The issue manifests as a bogus linker error when linking the powerpc64le Linux kernel.
The new behavior is compatible with ld.bfd's complain_overflow_bitfield.
The upper bound of the error message is not correct. Fix it as well.
The changes to R_PPC_ADDR16, R_PPC64_ADDR16, R_X86_64_8 and R_X86_64_16 are similar.
Reviewed By: ruiu
Differential Revision: https://reviews.llvm.org/D63690
llvm-svn: 364164
Craig Topper [Sun, 23 Jun 2019 23:51:21 +0000 (23:51 +0000)]
[X86] Turn v16i16->v16i8 truncate+store into a any_extend+truncstore if we avx512f, but not avx512bw.
Ideally we'd be able to represent this truncate as a any_extend to
v16i32 and a truncate, but SelectionDAG doens't know how to not
fold those together.
We have isel patterns to use a vpmovzxwd+vpdmovdb for the truncate,
but we aren't able to simultaneously fold the load and the store
from the isel pattern. By pulling the truncate into the store we
can successfully hide it from the DAG combiner. Then we can isel
pattern match the truncstore and load+any_extend separately.
llvm-svn: 364163
Petr Hosek [Sun, 23 Jun 2019 23:12:10 +0000 (23:12 +0000)]
[GN] Generation failure caused by trailing space in file name
When I executed gn.py gen out/gn I got the following error:
ERROR at //compiler-rt/lib/builtins/BUILD.gn:162:7: Only source, header, and object files belong in the sources of a static_library. //compiler-rt/lib/builtins/emutls.c is not one of the valid types.
"emutls.c ",
^----------
See //compiler-rt/lib/BUILD.gn:3:5: which caused the file to be included.
"//compiler-rt/lib/builtins",
^---------------------------
It turns out to be that the latest gn doesn't accept ill-format file name. And the emutls.c above has a trailing space.
Remove the trailing space should work.
Patch By: myhsu
Differential Revision: https://reviews.llvm.org/D63449
llvm-svn: 364162
Eric Fiselier [Sun, 23 Jun 2019 20:47:21 +0000 (20:47 +0000)]
Use C++11 implementation of unique_ptr in C++03.
llvm-svn: 364161
Eric Fiselier [Sun, 23 Jun 2019 20:28:29 +0000 (20:28 +0000)]
Apply new meta-programming traits throughout the library.
The new meta-programming primitives are lower cost than the old versions. This patch removes those old versions and switches libc++ to use the new ones.
llvm-svn: 364160
Sanjoy Das [Sun, 23 Jun 2019 19:22:13 +0000 (19:22 +0000)]
Fix typo in comment; NFC
llvm-svn: 364159
Craig Topper [Sun, 23 Jun 2019 19:17:50 +0000 (19:17 +0000)]
[X86] Fix isel pattern that was looking for a bitcasted load. Remove what appears to be a copy/paste mistake.
DAG combine should ensure bitcasts of loads don't exist.
Also remove 3 patterns that are identical to the block above them.
llvm-svn: 364158
Richard Smith [Sun, 23 Jun 2019 17:42:18 +0000 (17:42 +0000)]
Fix test for 32-bit targets.
llvm-svn: 364157
Philip Reames [Sun, 23 Jun 2019 17:13:53 +0000 (17:13 +0000)]
[Tests] Autogen and improve test readability
llvm-svn: 364156