Commit Graph

319889 Commits

Author SHA1 Message Date
Csaba Dabis c55170c031 [analyzer] JsonSupport: Escape escapes
Summary: -

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/D63462

llvm-svn: 364270
2019-06-25 03:08:32 +00:00
Artem Dergachev 14f4de9bb9 [analyzer] exploded-graph-rewriter: Fix escaping for bitwise-or.
'|' is a special character in graphviz, so it needs to be properly
escaped and unescaped.

llvm-svn: 364269
2019-06-25 02:16:56 +00:00
Artem Dergachev beb85ad66d [analyzer] exploded-graph-rewriter: Add support for range constraints.
Diff support included.

A cheap solution is implemented that treats range constraints as
"some sort of key-value map", so it's going to be trivial
to add support for other such maps later, such as dynamic type info.

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

llvm-svn: 364268
2019-06-25 02:16:53 +00:00
Artem Dergachev b9c94f946f [analyzer] NFC: exploded-graph-rewriter: Extract some code into functions.
Differential Revision: https://reviews.llvm.org/D63684

llvm-svn: 364267
2019-06-25 02:16:50 +00:00
Artem Dergachev c48be7fc1c [analyzer] Add more timers for performance profiling.
The -analyzer-stats flag now allows you to find out how much time was spent
on AST-based analysis and on path-sensitive analysis and, separately,
on bug visitors, as they're occasionally a performance problem on their own.

The total timer wasn't useful because there's anyway a total time printed out.
Remove it.

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

llvm-svn: 364266
2019-06-25 02:16:47 +00:00
Richard Smith 7939ba08ab [cxx2a] P1236R1: the validity of a left shift does not depend on the
value of the LHS operand.

llvm-svn: 364265
2019-06-25 01:45:26 +00:00
Craig Topper 079924b0b7 Revert r363802, r363850, and r363856 "[TargetLowering] SimplifyDemandedBits..."
This reverts the following patches.
"[TargetLowering] SimplifyDemandedBits SIGN_EXTEND_VECTOR_INREG -> ANY/ZERO_EXTEND_VECTOR_INREG"
"[TargetLowering] SimplifyDemandedBits ZERO_EXTEND_VECTOR_INREG -> ANY_EXTEND_VECTOR_INREG"
"[TargetLowering] SimplifyDemandedBits - add ANY_EXTEND_VECTOR_INREG support"

We can end up with an any_extend_vector_inreg with a 256 bit result type
and a 128 bit result type. This is allowed by the ISD opcode, but the
generic operation legalizer is only able to expand cases where the
total vector width is the same.

The X86 backend creates these mismatched cases for zext_vec_inreg/sext_vec_inreg.
The SimplifyDemandedBits changes are allowing those nodes to become
aext_vec_inreg. For the zext/sext cases, the X86 backend has Custom
handling and never lets them get to the generic legalizer. We need to do the same
for aext_vec_inreg.

llvm-svn: 364264
2019-06-25 01:32:42 +00:00
Seiya Nuta 81eb828405 [llvm-objcopy][NFCI] Fix build failure with GCC
Here is unreachable since the switch statement above is exhaustive.

llvm-svn: 364263
2019-06-25 01:08:21 +00:00
Matt Arsenault 25bc27965a AMDGPU/GlobalISel: Fix regbankselect for amdgcn.class
llvm-svn: 364262
2019-06-25 01:07:22 +00:00
Vitaly Buka 5b9d0205aa [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
2019-06-25 01:01:46 +00:00
Adrian Prantl c8e8b274f1 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
2019-06-25 00:55:27 +00:00
Csaba Dabis 49885b1245 [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
2019-06-25 00:44:33 +00:00
Huihui Zhang 2cc3b3856e [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
2019-06-25 00:14:02 +00:00
Huihui Zhang 4626613ffe [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
2019-06-25 00:09:10 +00:00
Seiya Nuta 545f001d1b [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
2019-06-25 00:02:04 +00:00
David Blaikie f895e1bded 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
2019-06-24 23:45:18 +00:00
Seiya Nuta 323b89f101 [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
2019-06-24 23:39:01 +00:00
Matt Arsenault 5495f78165 AMDGPU: Fix missing declaration for mbcnt builtins
llvm-svn: 364251
2019-06-24 23:34:06 +00:00
Tim Shen e75b1efa39 Revert "[NVPTX][NFC] Fix documentation for shfl instructions." The
original documentation is correct as it matches the C++ builtins.

llvm-svn: 364250
2019-06-24 23:29:20 +00:00
Douglas Yung 1433b1b6ec [NFC] Fix tests added in r364225 which failed on Windows due to incorrect path separators.
llvm-svn: 364249
2019-06-24 23:16:32 +00:00
Tim Shen 41c7d53003 [NVPTX][NFC] Fix documentation for shfl instructions.
llvm-svn: 364248
2019-06-24 23:16:32 +00:00
Vitaly Buka 8a35afab1d [NFC] Add missing consts into memoryaccess_def_iterator
llvm-svn: 364247
2019-06-24 22:42:53 +00:00
Sanjay Patel 2675b0c8ab [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
2019-06-24 22:35:26 +00:00
Douglas Yung 8950d0a1f0 Fix test cl-response-file.c to work on all platforms including Windows/Solaris.
Differential Revision: https://reviews.llvm.org/D63678

llvm-svn: 364245
2019-06-24 22:26:08 +00:00
Matt Arsenault 2100caf7f6 AMDGPU/GlobalISel: Add tests for regbankselect of v2s16 and/or/xor
llvm-svn: 364244
2019-06-24 22:21:02 +00:00
Jason Molenda 868a394bb6 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
2019-06-24 22:08:43 +00:00
Richard Smith 4bd4acc969 Fix test failures due to modified wording in Clang diagnostics.
llvm-svn: 364241
2019-06-24 22:01:03 +00:00
Jason Molenda b5e86e0b51 Add windows abi plugin, breakpointprecondition.
llvm-svn: 364240
2019-06-24 21:48:13 +00:00
Richard Smith 66e6e37447 Fix test failures when using a custom ABI namespace.
llvm-svn: 364239
2019-06-24 21:46:05 +00:00
Vasileios Porpodas 3081f78776 [SLP] NFC: Fixed typo in comment
llvm-svn: 364237
2019-06-24 21:40:48 +00:00
Ilya Biryukov 5e69f27ef7 [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
2019-06-24 21:39:51 +00:00
Matt Arsenault 8025842599 InstCombine: Preserve nuw when reassociating nuw ops [3/3]
Alive says this is OK.

llvm-svn: 364235
2019-06-24 21:37:03 +00:00
Matt Arsenault 5d82ecd5d9 InstCombine: Preserve nuw when reassociating nuw ops [2/3]
Alive says this is OK.

llvm-svn: 364234
2019-06-24 21:37:02 +00:00
Matt Arsenault 5a89ba7343 InstCombine: Preserve nuw when reassociating nuw ops [1/3]
Alive says this is OK.

llvm-svn: 364233
2019-06-24 21:36:59 +00:00
Cameron McInally 1e5116cbb3 [NFC][Reassociate] Add unary FNeg tests to fast-ReassociateVector.ll
llvm-svn: 364232
2019-06-24 21:36:09 +00:00
Sajjad Mirza 6694b2b36b (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
2019-06-24 21:32:50 +00:00
David Blaikie 8242f35d50 NFC: DataExtractor: use decodeULEB128 to implement getULEB128
llvm-svn: 364230
2019-06-24 20:43:36 +00:00
Alex Langford 11cfa92a19 [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
2019-06-24 20:33:09 +00:00
Nikita Popov f1ffc4305d [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
2019-06-24 20:13:13 +00:00
Sanjay Patel 2aa800052a [InstCombine] add tests for more variants of isPowerOf2; NFC
llvm-svn: 364227
2019-06-24 20:11:40 +00:00
Aaron Ballman a612e34c14 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
2019-06-24 20:07:11 +00:00
Peter Collingbourne 9c8282a9b3 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
2019-06-24 20:03:23 +00:00
Huihui Zhang 94b4316096 [InstCombine] Regenerate test pr17827. NFCI.
Prep work for upcoming patch D63505.

llvm-svn: 364224
2019-06-24 19:49:42 +00:00
Alex Langford 73901961ee [ABI] Remove unused variables in ABIWindows_x86_64
llvm-svn: 364223
2019-06-24 19:43:22 +00:00
Julie Hockett b1f01e27ec [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
2019-06-24 19:31:02 +00:00
Roland Froese ea08248b2b [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
2019-06-24 19:27:07 +00:00
Philip Reames b2f09391cf [Tests] Add cases where we're failing to discharge provably loop exits (tests for D63733)
llvm-svn: 364220
2019-06-24 19:26:17 +00:00
Cameron McInally fe3f15cf90 [SLP] Support unary FNeg vectorization
Differential Revision: https://reviews.llvm.org/D63609

llvm-svn: 364219
2019-06-24 19:24:23 +00:00
Nico Weber 4412d83959 Remove flag for no longer supported MSVC version
llvm-svn: 364218
2019-06-24 18:47:53 +00:00
Alex Langford 09ede9d65f [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
2019-06-24 18:21:05 +00:00