platform/upstream/llvm.git
6 years ago[ELF] - Check we are able to report errors when DW_AT_decl_file is invalid.
George Rimar [Tue, 17 Jul 2018 08:04:27 +0000 (08:04 +0000)]
[ELF] - Check we are able to report errors when DW_AT_decl_file is invalid.

We did not try to support this intentionally but have
an error handling and reporting logic that can take care
of that and hence needs a test.

llvm-svn: 337250

6 years agoHarden/relax clang/test/CodeGen/opt-record-MIR.c test
Roman Lebedev [Tue, 17 Jul 2018 07:12:08 +0000 (07:12 +0000)]
Harden/relax clang/test/CodeGen/opt-record-MIR.c test

Summary:
If the build path is short, `Line` field can end up fitting on the same line as `File`,
but the `{{.*}}` would consume it. Keeping in mind rL293149, i think we can fix it,
while keeping it working when there are and there are not any quotations.
At least this fixes this test for me.

Reviewers: anemet, aaron.ballman, hfinkel

Reviewed By: anemet

Subscribers: cfe-commits, llvm-commits

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

llvm-svn: 337249

6 years ago[DependenceInfo] Use isl++ to replace foreach_set with for loop
Tobias Grosser [Tue, 17 Jul 2018 07:08:06 +0000 (07:08 +0000)]
[DependenceInfo] Use isl++ to replace foreach_set with for loop

llvm-svn: 337248

6 years ago[IslNodeBuilder] Use isl++ to replace foreach_set with for loop
Tobias Grosser [Tue, 17 Jul 2018 07:08:01 +0000 (07:08 +0000)]
[IslNodeBuilder] Use isl++ to replace foreach_set with for loop

llvm-svn: 337247

6 years ago[ScopInfo] Replace isl foreach calls with for loops
Tobias Grosser [Tue, 17 Jul 2018 06:41:20 +0000 (06:41 +0000)]
[ScopInfo] Replace isl foreach calls with for loops

llvm-svn: 337246

6 years ago[ZoneAlgo] Replace isl foreach calls with for loops
Tobias Grosser [Tue, 17 Jul 2018 06:33:41 +0000 (06:33 +0000)]
[ZoneAlgo] Replace isl foreach calls with for loops

llvm-svn: 337245

6 years ago[FlattenSchedule] Replace isl foreach calls with for loops
Tobias Grosser [Tue, 17 Jul 2018 06:33:37 +0000 (06:33 +0000)]
[FlattenSchedule] Replace isl foreach calls with for loops

llvm-svn: 337244

6 years ago[MaximalStaticExpansion] Replace isl foreach calls with for loops
Tobias Grosser [Tue, 17 Jul 2018 06:33:34 +0000 (06:33 +0000)]
[MaximalStaticExpansion] Replace isl foreach calls with for loops

llvm-svn: 337243

6 years ago[ForwardOpTree] Replace isl foreach calls with for loops
Tobias Grosser [Tue, 17 Jul 2018 06:33:31 +0000 (06:33 +0000)]
[ForwardOpTree] Replace isl foreach calls with for loops

llvm-svn: 337242

6 years ago[Simplify] Replace isl foreach calls with for loops
Tobias Grosser [Tue, 17 Jul 2018 06:33:26 +0000 (06:33 +0000)]
[Simplify] Replace isl foreach calls with for loops

llvm-svn: 337241

6 years ago[X86] Properly qualify some MOVSS/MOVSD patterns with OptSize.
Craig Topper [Tue, 17 Jul 2018 06:24:16 +0000 (06:24 +0000)]
[X86] Properly qualify some MOVSS/MOVSD patterns with OptSize.

These are integer versions of patterns that I already fixed for floating point.

llvm-svn: 337240

6 years ago[FlattenAlgo] Replace more isl foreach calls with for loops
Tobias Grosser [Tue, 17 Jul 2018 06:16:58 +0000 (06:16 +0000)]
[FlattenAlgo] Replace more isl foreach calls with for loops

This time we replace for loops where the return isl::stat::error has
been used to carry status information.

There are still two uses of foreach remaining as we do not have a
corresponding for implementation for pw_aff functions.

llvm-svn: 337239

6 years ago[FlattenAlgo] Replace some isl foreach calls with for loops
Tobias Grosser [Tue, 17 Jul 2018 06:11:53 +0000 (06:11 +0000)]
[FlattenAlgo] Replace some isl foreach calls with for loops

Replace foreach calls which only return 'ok' with for loops.

llvm-svn: 337238

6 years ago[unittest/DeLICM] Replace isl foreach calls with for loops
Tobias Grosser [Tue, 17 Jul 2018 06:08:04 +0000 (06:08 +0000)]
[unittest/DeLICM] Replace isl foreach calls with for loops

llvm-svn: 337237

6 years ago[Sparc] Do not depend on icc for ta 1
Daniel Cederman [Tue, 17 Jul 2018 05:49:33 +0000 (05:49 +0000)]
[Sparc] Do not depend on icc for ta 1

The ta instruction will always trap, regardless of the value
of the integer condition codes. TRAPri is marked as using icc,
so we cannot use a pattern for TRAPri to implement ta 1, as
verify-machineinstrs can complain that icc is not defined.
Instead we implement ta 1 the same way as ta 5.

llvm-svn: 337236

6 years agoAddress "always inline function is not always inlinable" warning with GCC.
Eric Fiselier [Tue, 17 Jul 2018 05:48:48 +0000 (05:48 +0000)]
Address "always inline function is not always inlinable" warning with GCC.

When an always_inline function is used prior to the functions definition,
the compiler may not be able to inline it as requested by the attribute.
GCC flags the `basic_string(CharT const*)` function as one such example.

This patch supresses the warning, and the problem, by moving the
definition of the string constructor to the inline declaration.
This ensures the body is available when it is first ODR used.

llvm-svn: 337235

6 years ago[X86] Add full set of patterns for turning ceil/floor/trunc/rint/nearbyint into rndsc...
Craig Topper [Tue, 17 Jul 2018 05:48:48 +0000 (05:48 +0000)]
[X86] Add full set of patterns for turning ceil/floor/trunc/rint/nearbyint into rndscale with loads, broadcast, and masking.

This amounts to pretty ridiculous number of patterns. Ideally we'd canonicalize the X86ISD::VRNDSCALE earlier to reuse those patterns. I briefly looked into doing that, but some strict FP operations could still get converted to rint and nearbyint during isel. It's probably still worthwhile to look into. This patch is meant as a starting point to work from.

llvm-svn: 337234

6 years ago[X86] Add test cases for selecting floor/ceil/trunc/rint/nearbyint to rndscale with...
Craig Topper [Tue, 17 Jul 2018 05:48:46 +0000 (05:48 +0000)]
[X86] Add test cases for selecting floor/ceil/trunc/rint/nearbyint to rndscale with masking, loading, and broadcasting.

llvm-svn: 337233

6 years ago[Driver] Add -fno-digraphs
Jacob Bandes-Storch [Tue, 17 Jul 2018 04:56:22 +0000 (04:56 +0000)]
[Driver] Add -fno-digraphs

Summary: Add a flag `-fno-digraphs` to disable digraphs in the lexer, similar to `-fno-operator-names` which disables alternative names for C++ operators.

Reviewers: rsmith

Reviewed By: rsmith

Subscribers: rsmith, cfe-commits

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

llvm-svn: 337232

6 years ago[analyzer] Fix size_t in tests.
Artem Dergachev [Tue, 17 Jul 2018 01:39:25 +0000 (01:39 +0000)]
[analyzer] Fix size_t in tests.

Should fix a buildbot. No functional change intended.

llvm-svn: 337231

6 years ago[testcases] move testcases to right place - NFC
Chen Zheng [Tue, 17 Jul 2018 01:04:41 +0000 (01:04 +0000)]
[testcases] move testcases to right place - NFC

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

llvm-svn: 337230

6 years ago[CFG] [analyzer] Allow elidable copies to have more than one arguments.
Artem Dergachev [Tue, 17 Jul 2018 00:57:57 +0000 (00:57 +0000)]
[CFG] [analyzer] Allow elidable copies to have more than one arguments.

Copy-constructors and move-constructors may have default arguments. It is
incorrect to assert that they only have one argument, i.e. the reference to the
object being copied or moved. Remove the assertion.

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

llvm-svn: 337229

6 years ago[analyzer] pr37802: Fix symbolic-pointer-to-boolean casts during load.
Artem Dergachev [Tue, 17 Jul 2018 00:42:35 +0000 (00:42 +0000)]
[analyzer] pr37802: Fix symbolic-pointer-to-boolean casts during load.

The canonical representation of pointer &SymRegion{$x} casted to boolean is
"$x != 0", not "$x". Assertion added in r337227 catches that.

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

llvm-svn: 337228

6 years ago[analyzer] Assert that nonloc::SymbolVal always wraps a non-Loc-type symbol.
Artem Dergachev [Tue, 17 Jul 2018 00:22:27 +0000 (00:22 +0000)]
[analyzer] Assert that nonloc::SymbolVal always wraps a non-Loc-type symbol.

In the current SVal hierarchy there are multiple ways of representing certain
values but few are actually used and expected to be seen by the code.

In particular, a value of a symbolic pointer is always represented by a
loc::MemRegionVal that wraps a SymbolicRegion that wraps the pointer symbol
and never by a nonloc::SymbolVal that wraps that symbol directly.

Assert the aforementioned fact. Fix one minor violation of it.

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

llvm-svn: 337227

6 years agoRestructure checking for, and warning on, lifetime extension.
Richard Smith [Tue, 17 Jul 2018 00:11:41 +0000 (00:11 +0000)]
Restructure checking for, and warning on, lifetime extension.

This change implements C++ DR1696, which makes initialization of a
reference member of a class from a temporary object ill-formed. The
standard wording here is imprecise, but we interpret it as meaning that
any time a mem-initializer would result in lifetime extension, the
program is ill-formed.

llvm-svn: 337226

6 years ago[llvm-mca][docs] Add notes about cycle and resource callbacks. NFC.
Matt Davis [Mon, 16 Jul 2018 23:50:53 +0000 (23:50 +0000)]
[llvm-mca][docs] Add notes about cycle and resource callbacks. NFC.

llvm-svn: 337225

6 years ago[libFuzzer] Avoid STL in MSan test.
Matt Morehouse [Mon, 16 Jul 2018 23:22:54 +0000 (23:22 +0000)]
[libFuzzer] Avoid STL in MSan test.

Summary:
STL can cause MSan false positives if lib[std]c++ isn't instrumented
with MSan.

Reviewers: kcc

Reviewed By: kcc

Subscribers: Dor1s, llvm-commits

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

llvm-svn: 337224

6 years ago[X86] Add a missing FMA3 scalar intrinsic pattern.
Craig Topper [Mon, 16 Jul 2018 23:10:58 +0000 (23:10 +0000)]
[X86] Add a missing FMA3 scalar intrinsic pattern.

This allows us to use 231 form to fold an insertelement on the add input to the fma. There is technically no software intrinsic that can use this until AVX512F, but it can be manually built up from other intrinsics.

llvm-svn: 337223

6 years ago[WebAssembly] Remove ELF file support.
Sam Clegg [Mon, 16 Jul 2018 23:09:29 +0000 (23:09 +0000)]
[WebAssembly] Remove ELF file support.

This support was partial and temporary.  Now that we have
wasm object file support its no longer needed.

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

llvm-svn: 337222

6 years ago[Intrinsics] define funnel shift IR intrinsics + DAG builder support
Sanjay Patel [Mon, 16 Jul 2018 22:59:31 +0000 (22:59 +0000)]
[Intrinsics] define funnel shift IR intrinsics + DAG builder support

As discussed here:
http://lists.llvm.org/pipermail/llvm-dev/2018-May/123292.html
http://lists.llvm.org/pipermail/llvm-dev/2018-July/124400.html

We want to add rotate intrinsics because the IR expansion of that pattern is 4+ instructions,
and we can lose pieces of the pattern before it gets to the backend. Generalizing the operation
by allowing 2 different input values (plus the 3rd shift/rotate amount) gives us a "funnel shift"
operation which may also be a single hardware instruction.

Initially, I thought we needed to define new DAG nodes for these ops, and I spent time working
on that (much larger patch), but then I concluded that we don't need it. At least as a first
step, we have all of the backend support necessary to match these ops...because it was required.
And shepherding these through the IR optimizer is the primary concern, so the IR intrinsics are
likely all that we'll ever need.

There was also a question about converting the intrinsics to the existing ROTL/ROTR DAG nodes
(along with improving the oversized shift documentation). Again, I don't think that's strictly
necessary (as the test results here prove). That can be an efficiency improvement as a small
follow-up patch.

So all we're left with is documentation, definition of the IR intrinsics, and DAG builder support.

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

llvm-svn: 337221

6 years ago[NFC][llvm-objcopy] Make helper functions static
Puyan Lotfi [Mon, 16 Jul 2018 22:17:05 +0000 (22:17 +0000)]
[NFC][llvm-objcopy] Make helper functions static

Anywhere in tools/llvm-objcopy where functions or classes are not referenced
outside of a given file, we change things to make the function or class static
or put inside an anonymous namespace.

llvm-svn: 337220

6 years ago[llvm-mca][docs] Initial description of mca internals. NFC
Matt Davis [Mon, 16 Jul 2018 21:42:58 +0000 (21:42 +0000)]
[llvm-mca][docs] Initial description of mca internals. NFC

This patch introduces a brief description of the components of MCA.  The main
focus is on Views.   This is a work in progress, and more descriptions will be
introduced later.  I want to flesh-out the Views section more and provide a
detailed description of eventing in MCA.  Eventually a brief code example of a
View should accompany the description.

Also, we should consider moving the MCA internals guide elsewhere at some point.

llvm-svn: 337219

6 years agoAdd missing includes.
Zachary Turner [Mon, 16 Jul 2018 21:34:25 +0000 (21:34 +0000)]
Add missing includes.

llvm-svn: 337218

6 years ago[LLVMDemangle] Move some utility classes to header files.
Zachary Turner [Mon, 16 Jul 2018 21:24:03 +0000 (21:24 +0000)]
[LLVMDemangle] Move some utility classes to header files.

In a followup I'm looking to add a Microsoft demangler.  Doing
so needs a lot of the same utility classes and feature test
macros which are already implemented in ItaniumDemangle.cpp.
So move all of these things into header files so that they
can be re-used by a new demangler.

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

llvm-svn: 337217

6 years ago[analyzer] Make checkEndFunction() give access to the return statement.
Reka Kovacs [Mon, 16 Jul 2018 20:47:45 +0000 (20:47 +0000)]
[analyzer] Make checkEndFunction() give access to the return statement.

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

llvm-svn: 337215

6 years ago[ASTMatchers] Quickfix for tests.
George Karpenkov [Mon, 16 Jul 2018 20:42:37 +0000 (20:42 +0000)]
[ASTMatchers] Quickfix for tests.

llvm-svn: 337214

6 years ago[analyzer] Bugfix for an overly eager suppression for null pointer return from macros.
George Karpenkov [Mon, 16 Jul 2018 20:33:25 +0000 (20:33 +0000)]
[analyzer] Bugfix for an overly eager suppression for null pointer return from macros.

Only suppress those cases where the null which came from the macro is
relevant to the bug, and was not overwritten in between.

rdar://41497323

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

llvm-svn: 337213

6 years ago[analyzer] Fix GCDAntipatternChecker to only fire when the semaphore is initialized...
George Karpenkov [Mon, 16 Jul 2018 20:32:57 +0000 (20:32 +0000)]
[analyzer] Fix GCDAntipatternChecker to only fire when the semaphore is initialized to zero

Initializing a semaphore with a different constant most likely signals a different intent

rdar://41802552

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

llvm-svn: 337212

6 years ago[analyzer] Provide a symmetric method for generating a PathDiagnosticLocation from...
George Karpenkov [Mon, 16 Jul 2018 20:32:32 +0000 (20:32 +0000)]
[analyzer] Provide a symmetric method for generating a PathDiagnosticLocation from Decl

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

llvm-svn: 337211

6 years agoremove temporal file directory before testing in thinlto-debug-fission.ll
Yunlian Jiang [Mon, 16 Jul 2018 20:28:48 +0000 (20:28 +0000)]
remove temporal  file directory before testing in thinlto-debug-fission.ll

Summary:
This removes the %T/dwo directory before calling ld.lld in ELF/lto/thinlto-debug-fission.ll so that
files aren't left over from previous runs.

Reviewers: espindola, pcc

Reviewed By: pcc

Subscribers: inglorion, emaste, arichardson, eraman, steven_wu, dexonsmith, llvm-commits

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

llvm-svn: 337210

6 years ago[ASTMatchers] Introduce Objective-C matchers `hasReceiver` and `isInstanceMessage...
George Karpenkov [Mon, 16 Jul 2018 20:22:12 +0000 (20:22 +0000)]
[ASTMatchers] Introduce Objective-C matchers `hasReceiver` and `isInstanceMessage` for ObjCMessageExpr

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

llvm-svn: 337209

6 years ago[NFC][InstCombine] Fine-tune 'check for [no] signed truncation' tests
Roman Lebedev [Mon, 16 Jul 2018 20:10:46 +0000 (20:10 +0000)]
[NFC][InstCombine] Fine-tune 'check for [no] signed truncation' tests

We are using i8 for these tests, and shifting by 4,
which is exactly the half of i8.

But as it is seen from the proofs https://rise4fun.com/Alive/mgu
KeptBits = bitwidth(%x) - MaskedBits,
so with using shifts by 4, we are not really testing that
we actually properly handle the other cases with shifts not by half...

llvm-svn: 337208

6 years ago[OPENMP] Fix checks for declare target link entries.
Alexey Bataev [Mon, 16 Jul 2018 20:05:25 +0000 (20:05 +0000)]
[OPENMP] Fix checks for declare target link entries.

If the declare target link entries are created but not used, the
compiler will produce an error message. Patch improves handling of such
situations + improves checks for possibly lost declare target variables.

llvm-svn: 337207

6 years agoRevert r337194 (https://reviews.llvm.org/D48891) due to compilation errors.
Max Moroz [Mon, 16 Jul 2018 20:05:18 +0000 (20:05 +0000)]
Revert r337194 (https://reviews.llvm.org/D48891) due to compilation errors.

llvm-svn: 337206

6 years agoFix PR38160 - init_priority attribute not supported by GCC on Apple.
Eric Fiselier [Mon, 16 Jul 2018 20:01:59 +0000 (20:01 +0000)]
Fix PR38160 - init_priority attribute not supported by GCC on Apple.

This patch guards the use of __attribute__((init_priority(101)))
within memory_resource.cpp when building with compilers that don't
support it. Specifically GCC on Apple platforms, and MSVC.

llvm-svn: 337205

6 years ago[llvm-objcopy] Add support for large indexes
Jake Ehrlich [Mon, 16 Jul 2018 19:48:52 +0000 (19:48 +0000)]
[llvm-objcopy] Add support for large indexes

This patch is an update of an older patch that never landed
(see here: https://reviews.llvm.org/D42516)

Recently various users have run into this issue and it just 100%
has to be solved at this point. The main difference in this patch
is that I use gunzip instead of unzip which should hopefully allow
tests to pass. Please review this as if it is a new patch however.
I found some issues along the way and made some minor modifications.

The binary used in this patch for testing (a zip file to make it small)
can be found here:
https://drive.google.com/file/d/1UjsnTO9edLttZibbr-2T1bJl92KEQFAO/view?usp=sharing

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

llvm-svn: 337204

6 years ago[cmake][libFuzzer] fixup r337193 to ensure msan/dfsan are not added
Alex Lorenz [Mon, 16 Jul 2018 19:41:49 +0000 (19:41 +0000)]
[cmake][libFuzzer] fixup r337193 to ensure msan/dfsan are not added
to test deps for libfuzzer when they're not supported by the platform

llvm-svn: 337203

6 years ago[CMake] Give lldb tools functional install targets when building LLDB.framework
Alex Langford [Mon, 16 Jul 2018 19:19:56 +0000 (19:19 +0000)]
[CMake] Give lldb tools functional install targets when building LLDB.framework

Summary:
This change makes the install targets for lldb tools functional when
building for the framework.

I am currently working on the install rules for lldb-framework and this will
let me make `install-lldb-framework` rely on `install-lldb-argdumper` for
instance. This is especially important for `install-lldb-framework-stripped`. It
is much better for `install-lldb-framework-stripped` to rely on
`install-lldb-argdumper-stripped` than to copy and strip lldb-argdumper
manually.

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

llvm-svn: 337202

6 years ago[ScopInfo] Replace isl foreach calls with for loops
Tobias Grosser [Mon, 16 Jul 2018 19:04:16 +0000 (19:04 +0000)]
[ScopInfo] Replace isl foreach calls with for loops

After Philip added support for range-based for loops to our C++
bindings, we now convert another bunch of foreach calls to range-for loops.
This improves general readability of the code.

llvm-svn: 337201

6 years ago[CodeGen] Fix inconsistent declaration parameter name
Fangrui Song [Mon, 16 Jul 2018 18:51:40 +0000 (18:51 +0000)]
[CodeGen] Fix inconsistent declaration parameter name

llvm-svn: 337200

6 years ago[CMake] Use cxx-headers as a depedency for C++ headers
Petr Hosek [Mon, 16 Jul 2018 18:48:20 +0000 (18:48 +0000)]
[CMake] Use cxx-headers as a depedency for C++ headers

We no longer pass CLANG_DEFAULT_CXX_STDLIB to the runtimes build
as it was causing issues so we can no longer use this variable. We
instead use cxx-headers as a dependency whenever this is available
since both XRay and libFuzzer are built as static libraries so this
is sufficient.

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

llvm-svn: 337199

6 years ago[AMDGPU] [AMDGPU] Support a fdot2 pattern.
Farhana Aleen [Mon, 16 Jul 2018 18:19:59 +0000 (18:19 +0000)]
[AMDGPU] [AMDGPU] Support a fdot2 pattern.

Summary: Optimize fma((float)S0.x, (float)S1.x fma((float)S0.y, (float)S1.y, z))
                   -> fdot2((v2f16)S0, (v2f16)S1, (float)z)

Author: FarhanaAleen

Reviewed By: rampitec, b-sumner

Subscribers: AMDGPU

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

llvm-svn: 337198

6 years ago[OPENMP] Fix syntactic errors in error messages.
Alexey Bataev [Mon, 16 Jul 2018 18:12:18 +0000 (18:12 +0000)]
[OPENMP] Fix syntactic errors in error messages.

Fixed spelling of the offloading error messages.

llvm-svn: 337196

6 years agoSupport option -plugin-opt=dwo_dir=
Yunlian Jiang [Mon, 16 Jul 2018 17:55:48 +0000 (17:55 +0000)]
Support option -plugin-opt=dwo_dir=

Summary:
This adds support to option -plugin-opt=dwo_dir=${DIR}. This option is used to specify the directory to store the .dwo files when LTO and debug fission is used
at the same time.

Reviewers: ruiu, espindola, pcc

Reviewed By: pcc

Subscribers: eraman, dexonsmith, mehdi_amini, emaste, arichardson, steven_wu, llvm-commits

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

llvm-svn: 337195

6 years ago[libFuzzer] Mutation tracking and logging implemented.
Max Moroz [Mon, 16 Jul 2018 17:50:46 +0000 (17:50 +0000)]
[libFuzzer] Mutation tracking and logging implemented.

Summary:
Code now exists to track number of mutations that are used in fuzzing in total
and ones that produce new coverage. The stats are currently being dumped to the
command line.

Patch by Kodé Williams (@kodewilliams).

Reviewers: metzman, Dor1s, morehouse, kcc

Reviewed By: Dor1s, morehouse, kcc

Subscribers: delcypher, kubamracek, kcc, morehouse, llvm-commits, #sanitizers, mgorny

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

llvm-svn: 337194

6 years ago[libFuzzer] Add msan and dfsan to test deps.
Matt Morehouse [Mon, 16 Jul 2018 17:37:15 +0000 (17:37 +0000)]
[libFuzzer] Add msan and dfsan to test deps.

Required now that we have tests using MSan and DFSan.

llvm-svn: 337193

6 years ago[llvm] Change 2 instances of std::sort to llvm::sort
Mandeep Singh Grang [Mon, 16 Jul 2018 17:26:37 +0000 (17:26 +0000)]
[llvm] Change 2 instances of std::sort to llvm::sort

llvm-svn: 337192

6 years ago[OPENMP, NVPTX] Globalize only captured variables.
Alexey Bataev [Mon, 16 Jul 2018 16:49:20 +0000 (16:49 +0000)]
[OPENMP, NVPTX] Globalize only captured variables.

Sometimes we can try to globalize non-variable declarations, which may
lead to compiler crash.

llvm-svn: 337191

6 years ago[InstCombine] Fold 'check for [no] signed truncation' pattern
Roman Lebedev [Mon, 16 Jul 2018 16:45:42 +0000 (16:45 +0000)]
[InstCombine] Fold 'check for [no] signed truncation' pattern

Summary:
[[ https://bugs.llvm.org/show_bug.cgi?id=38149 | PR38149 ]]

As discussed in https://reviews.llvm.org/D49179#1158957 and later,
the IR for 'check for [no] signed truncation' pattern can be improved:
https://rise4fun.com/Alive/gBf
^ that pattern will be produced by Implicit Integer Truncation sanitizer,
https://reviews.llvm.org/D48958 https://bugs.llvm.org/show_bug.cgi?id=21530
in signed case, therefore it is probably a good idea to improve it.

Proofs for this transform: https://rise4fun.com/Alive/mgu
This transform is surprisingly frustrating.
This does not deal with non-splat shift amounts, or with undef shift amounts.
I've outlined what i think the solution should be:
```
  // Potential handling of non-splats: for each element:
  //  * if both are undef, replace with constant 0.
  //    Because (1<<0) is OK and is 1, and ((1<<0)>>1) is also OK and is 0.
  //  * if both are not undef, and are different, bailout.
  //  * else, only one is undef, then pick the non-undef one.
```

The DAGCombine will reverse this transform, see
https://reviews.llvm.org/D49266

Reviewers: spatel, craig.topper

Reviewed By: spatel

Subscribers: JDevlieghere, rkruppe, llvm-commits

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

llvm-svn: 337190

6 years agoFix some crashes and deadlocks in FormatAnsiTerminalCodes
Raphael Isemann [Mon, 16 Jul 2018 16:38:30 +0000 (16:38 +0000)]
Fix some crashes and deadlocks in FormatAnsiTerminalCodes

Summary:
This patch fixes a few problems with the FormatAnsiTerminalCodes function:

* It does an infinite loop on an unknown color value.
* It crashes when the color value is at the end of the string.
* It deletes the first character behind the color token.

Also added a few tests that reproduce those problems (and test some other corner cases).

Reviewers: davide, labath

Reviewed By: labath

Subscribers: labath, lldb-commits, mgorny

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

llvm-svn: 337189

6 years agoFix typo in find-basic-function test
Pavel Labath [Mon, 16 Jul 2018 16:18:52 +0000 (16:18 +0000)]
Fix typo in find-basic-function test

Wrong FileCheck header meant that we were not matching what we should.

This allows us to get rid of the -allow-deprecated-dag-overlap flag in
the test.

llvm-svn: 337188

6 years ago[libFuzzer] Implement stat::stability_rate based on the percentage of unstable edges.
Max Moroz [Mon, 16 Jul 2018 16:01:31 +0000 (16:01 +0000)]
[libFuzzer] Implement stat::stability_rate based on the percentage of unstable edges.

Summary:
Created a -print_unstable_stats flag.
When -print_unstable_stats=1, we run it 2 more times on interesting inputs poisoning unstable edges in an array.
On program termination, we run PrintUnstableStats() which will print a line with a stability percentage like AFL does.

Patch by Kyungtak Woo (@kevinwkt).

Reviewers: metzman, Dor1s, kcc, morehouse

Reviewed By: metzman, Dor1s, morehouse

Subscribers: delcypher, llvm-commits, #sanitizers, kcc, morehouse, Dor1s

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

llvm-svn: 337187

6 years ago[RegAlloc] Skip global splitting if the live range is huge and its spill is
Wei Mi [Mon, 16 Jul 2018 15:42:20 +0000 (15:42 +0000)]
[RegAlloc] Skip global splitting if the live range is huge and its spill is
trivially rematerializable.

We run into a case where machineLICM hoists a large number of live ranges
outside of a big loop because it thinks those live ranges are trivially
rematerializable. In regalloc, global splitting is tried out first for those
live ranges before they are spilled and rematerialized. Because the global
splitting algorithm is quadratic, increasing a lot of global splitting
candidates causes huge compile time increase (50s to 1400s on my local
machine when compiling a module).

However, we think for live ranges which are very large and are trivially
rematerialiable, it is better to just skip global splitting so as to save
compile time with little chance of sacrificing performance.  We uses the
segment size of live range to indirectly evaluate whether the global
splitting of the live range can introduce high cost, and use an option
as a knob to adjust the size limit threshold.

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

llvm-svn: 337186

6 years agoRestore "[ThinLTO] Ensure we always select the same function copy to import"
Teresa Johnson [Mon, 16 Jul 2018 15:30:36 +0000 (15:30 +0000)]
Restore "[ThinLTO] Ensure we always select the same function copy to import"

This reverts commit r337082, restoring r337051, since the LLVM side
patch has been restored.

llvm-svn: 337185

6 years agoRestore "[ThinLTO] Ensure we always select the same function copy to import"
Teresa Johnson [Mon, 16 Jul 2018 15:30:27 +0000 (15:30 +0000)]
Restore "[ThinLTO] Ensure we always select the same function copy to import"

This reverts commit r337081, therefore restoring r337050 (and fix in
r337059), with test fix for bot failure described after the original
description below.

In order to always import the same copy of a linkonce function,
even when encountering it with different thresholds (a higher one then a
lower one), keep track of the summary we decided to import.
This ensures that the backend only gets a single definition to import
for each GUID, so that it doesn't need to choose one.

Move the largest threshold the GUID was considered for import into the
current module out of the ImportMap (which is part of a larger map
maintained across the whole index), and into a new map just maintained
for the current module we are computing imports for. This saves some
memory since we no longer have the thresholds maintained across the
whole index (and throughout the in-process backends when doing a normal
non-distributed ThinLTO build), at the cost of some additional
information being maintained for each invocation of ComputeImportForModule
(the selected summary pointer for each import).

There is an additional map lookup for each callee being considered for
importing, however, this was able to subsume a map lookup in the
Worklist iteration that invokes computeImportForFunction. We also are
able to avoid calling selectCallee if we already failed to import at the
same or higher threshold.

I compared the run time and peak memory for the SPEC2006 471.omnetpp
benchmark (running in-process ThinLTO backends), as well as for a large
internal benchmark with a distributed ThinLTO build (so just looking at
the thin link time/memory). Across a number of runs with and without
this change there was no significant change in the time and memory.

(I tried a few other variations of the change but they also didn't
improve time or peak memory).

The new commit removes a test that no longer makes sense
(Transforms/FunctionImport/hotness_based_import2.ll), as exposed by the
reverse-iteration bot. The test depends on the order of processing the
summary call edges, and actually depended on the old problematic
behavior of selecting more than one summary for a given GUID when
encountered with different thresholds. There was no guarantee even
before that we would eventually pick the linkonce copy with the hottest
call edges, it just happened to work with the test and the old code, and
there was no guarantee that we would end up importing the selected
version of the copy that had the hottest call edges (since the backend
would effectively import only one of the selected copies).

Reviewers: davidxl

Subscribers: mehdi_amini, inglorion, llvm-commits

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

llvm-svn: 337184

6 years ago[ELF] - Eliminate ObjFile<ELFT>::getLineInfo. NFC.
George Rimar [Mon, 16 Jul 2018 15:29:35 +0000 (15:29 +0000)]
[ELF] - Eliminate ObjFile<ELFT>::getLineInfo. NFC.

Flow is the same, but a bit shorter after this change.

llvm-svn: 337183

6 years ago[ELF] - Cover ObjFile<ELFT>::getLineInfo() with a test.
George Rimar [Mon, 16 Jul 2018 15:27:53 +0000 (15:27 +0000)]
[ELF] - Cover ObjFile<ELFT>::getLineInfo() with a test.

There was no test for the first `return`.

llvm-svn: 337182

6 years ago[cfi-verify] Abort on unsupported targets
Joel Galenson [Mon, 16 Jul 2018 15:26:44 +0000 (15:26 +0000)]
[cfi-verify] Abort on unsupported targets

As suggested in the review for r337007, this makes cfi-verify abort on unsupported targets instead of producing incorrect results.  It also updates the design document to reflect this.

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

llvm-svn: 337181

6 years agoRevert r337175 (https://reviews.llvm.org/D49212) due to unintentional format changes.
Max Moroz [Mon, 16 Jul 2018 15:15:34 +0000 (15:15 +0000)]
Revert r337175 (https://reviews.llvm.org/D49212) due to unintentional format changes.

llvm-svn: 337180

6 years ago[InstrSimplify] add testcases for fold sdiv if two operands are negatived and non...
Chen Zheng [Mon, 16 Jul 2018 15:06:42 +0000 (15:06 +0000)]
[InstrSimplify] add testcases for fold sdiv if two operands are negatived and non-overflow

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

llvm-svn: 337179

6 years agoFix warnings in a static assert added to CFI.
Chandler Carruth [Mon, 16 Jul 2018 15:01:26 +0000 (15:01 +0000)]
Fix warnings in a static assert added to CFI.

llvm-svn: 337178

6 years ago[x86/SLH] Completely rework how we sink post-load hardening past data
Chandler Carruth [Mon, 16 Jul 2018 14:58:32 +0000 (14:58 +0000)]
[x86/SLH] Completely rework how we sink post-load hardening past data
invariant instructions to be both more correct and much more powerful.

While testing, I continued to find issues with sinking post-load
hardening. Unfortunately, it was amazingly hard to create any useful
tests of this because we were mostly sinking across copies and other
loading instructions. The fact that we couldn't sink past normal
arithmetic was really a big oversight.

So first, I've ported roughly the same set of instructions from the data
invariant loads to also have their non-loading varieties understood to
be data invariant. I've also added a few instructions that came up so
often it again made testing complicated: inc, dec, and lea.

With this, I was able to shake out a few nasty bugs in the validity
checking. We need to restrict to hardening single-def instructions with
defined registers that match a particular form: GPRs that don't have
a NOREX constraint directly attached to their register class.

The (tiny!) test case included catches all of the issues I was seeing
(once we can sink the hardening at all) except for the NOREX issue. The
only test I have there is horrible. It is large, inexplicable, and
doesn't even produce an error unless you try to emit encodings. I can
keep looking for a way to test it, but I'm out of ideas really.

Thanks to Ben for giving me at least a sanity-check review. I'll follow
up with Craig to go over this more thoroughly post-commit, but without
it SLH crashes everywhere so landing it for now.

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

llvm-svn: 337177

6 years agoTest commit
Henry Zhu [Mon, 16 Jul 2018 14:54:29 +0000 (14:54 +0000)]
Test commit

llvm-svn: 337176

6 years ago[libFuzzer] Implement stat::stability_rate based on the percentage of unstable edges.
Max Moroz [Mon, 16 Jul 2018 14:54:23 +0000 (14:54 +0000)]
[libFuzzer] Implement stat::stability_rate based on the percentage of unstable edges.

Summary:
Created a -print_unstable_stats flag.
When -print_unstable_stats=1, we run it 2 more times on interesting inputs poisoning unstable edges in an array.
On program termination, we run PrintUnstableStats() which will print a line with a stability percentage like AFL does.

Patch by Kyungtak Woo (@kevinwkt).

Reviewers: metzman, Dor1s, kcc, morehouse

Reviewed By: metzman, Dor1s, morehouse

Subscribers: delcypher, llvm-commits, #sanitizers, kcc, morehouse, Dor1s

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

llvm-svn: 337175

6 years ago[gcov] Add a test showing differences in line counts when building with or without...
Marco Castelluccio [Mon, 16 Jul 2018 14:40:33 +0000 (14:40 +0000)]
[gcov] Add a test showing differences in line counts when building with or without exceptions enabled.

Test for https://bugs.llvm.org/show_bug.cgi?id=38066.

llvm-svn: 337174

6 years agoFix TestDataFormatterUnordered for older libc++ versions
Pavel Labath [Mon, 16 Jul 2018 14:37:58 +0000 (14:37 +0000)]
Fix TestDataFormatterUnordered for older libc++ versions

clang recently started diagnosing "exception specification in
declaration does not match previous declaration" errors. Unfortunately
old libc++ versions had a bug, where they violated this rule, which
means that tests using this library version now fail due to build
errors.

Since it was easy to work around the bug by compiling this test with
-fno-exceptions, I do that here. If supporting old libc++ versions
becomes a burden, we'll have to revisit this.

llvm-svn: 337173

6 years ago[ASTImporter] Changed constant int to unsigned int in test code.
Balazs Keri [Mon, 16 Jul 2018 14:05:18 +0000 (14:05 +0000)]
[ASTImporter] Changed constant int to unsigned int in test code.

llvm-svn: 337172

6 years ago[mips] Eliminate the usage of hasStdEnc in MipsPat.
Simon Atanasyan [Mon, 16 Jul 2018 13:52:41 +0000 (13:52 +0000)]
[mips] Eliminate the usage of hasStdEnc in MipsPat.

Instead, the pattern is tagged with the correct predicate when
it is declared. Some patterns have been duplicated as necessary.

Patch by Simon Dardis.

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

llvm-svn: 337171

6 years ago[cfi] Don't pass a uint16_t to memset. Make sure the 16-bit constant is appropriate...
Filipe Cabecinhas [Mon, 16 Jul 2018 13:41:54 +0000 (13:41 +0000)]
[cfi] Don't pass a uint16_t to memset. Make sure the 16-bit constant is appropriate for us.

Reviewers: eugenis, pcc, kcc

Subscribers: delcypher, #sanitizers, llvm-commits

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

llvm-svn: 337170

6 years ago[analyzer] Fix the Z3 backend always generating unsigned APSInt
Mikhail R. Gadelha [Mon, 16 Jul 2018 13:32:22 +0000 (13:32 +0000)]
[analyzer] Fix the Z3 backend always generating unsigned APSInt

Summary:
In `toAPSInt`, the Z3 backend was not checking the variable `Int`'s type and was always generating unsigned `APSInt`s.

This was found by accident when I removed:
```
    llvm::APSInt ConvertedLHS, ConvertedRHS;
    QualType LTy, RTy;
    std::tie(ConvertedLHS, LTy) = fixAPSInt(*LHS);
    std::tie(ConvertedRHS, RTy) = fixAPSInt(*RHS);
-    doIntTypePromotion<llvm::APSInt, Z3ConstraintManager::castAPSInt>(
-        ConvertedLHS, LTy, ConvertedRHS, RTy);
    return BVF.evalAPSInt(BSE->getOpcode(), ConvertedLHS, ConvertedRHS);
```

And the `BasicValueFactory` started to complain about different `signedness`.

Reviewers: george.karpenkov, NoQ, ddcc

Reviewed By: ddcc

Subscribers: xazax.hun, szepet, a.sidorin

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

llvm-svn: 337169

6 years ago[MIPS GlobalISel] Select instructions to load and store i32 on stack
Petar Jovanovic [Mon, 16 Jul 2018 13:29:32 +0000 (13:29 +0000)]
[MIPS GlobalISel] Select instructions to load and store i32 on stack

Add code for selection of G_LOAD, G_STORE, G_GEP, G_FRAMEINDEX and
G_CONSTANT. Support loads and stores of i32 values.

Patch by Petar Avramovic.

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

llvm-svn: 337168

6 years ago[analyzer] Fix constraint being dropped when analyzing a program without taint tracki...
Mikhail R. Gadelha [Mon, 16 Jul 2018 13:14:46 +0000 (13:14 +0000)]
[analyzer] Fix constraint being dropped when analyzing a program without taint tracking enabled

Summary:
This patch removes the constraint dropping when taint tracking is disabled.

It also voids the crash reported in D28953 by treating a SymSymExpr with non pointer symbols as an opaque expression.

Updated the regressions and verifying the big projects now; I'll update here when they're done.

Based on the discussion on the mailing list and the patches by @ddcc.

Reviewers: george.karpenkov, NoQ, ddcc, baloghadamsoftware

Reviewed By: george.karpenkov

Subscribers: delcypher, llvm-commits, rnkovacs, xazax.hun, szepet, a.sidorin, ddcc

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

llvm-svn: 337167

6 years ago[X86][AArch64][DAGCombine] Unfold 'check for [no] signed truncation' pattern
Roman Lebedev [Mon, 16 Jul 2018 12:44:10 +0000 (12:44 +0000)]
[X86][AArch64][DAGCombine] Unfold 'check for [no] signed truncation' pattern

Summary:

[[ https://bugs.llvm.org/show_bug.cgi?id=38149 | PR38149 ]]

As discussed in https://reviews.llvm.org/D49179#1158957 and later,
the IR for 'check for [no] signed truncation' pattern can be improved:
https://rise4fun.com/Alive/gBf
^ that pattern will be produced by Implicit Integer Truncation sanitizer,
https://reviews.llvm.org/D48958 https://bugs.llvm.org/show_bug.cgi?id=21530
in signed case, therefore it is probably a good idea to improve it.

But the IR-optimal patter does not lower efficiently, so we want to undo it..

This handles the simple pattern.
There is a second pattern with predicate and constants inverted.

NOTE: we do not check uses here. we always do the transform.

Reviewers: spatel, craig.topper, RKSimon, javed.absar

Reviewed By: spatel

Subscribers: kristof.beyls, llvm-commits

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

llvm-svn: 337166

6 years ago[Sparc] Use the correct encoding for ta 3
Daniel Cederman [Mon, 16 Jul 2018 12:28:26 +0000 (12:28 +0000)]
[Sparc] Use the correct encoding for ta 3

Summary: The old encoding generated a "tn %g1 + 3" instruction instead
of the expected "ta 3".

Reviewers: venkatra, jyknight

Reviewed By: jyknight

Subscribers: fedor.sergeev, jrtc27, llvm-commits

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

llvm-svn: 337165

6 years ago[Sparc] Use the names .rem and .urem instead of __modsi3 and __umodsi3
Daniel Cederman [Mon, 16 Jul 2018 12:22:08 +0000 (12:22 +0000)]
[Sparc] Use the names .rem and .urem instead of __modsi3 and __umodsi3

Summary: These are the names used in libgcc.

Reviewers: venkatra, jyknight, ekedaigle

Reviewed By: jyknight

Subscribers: joerg, fedor.sergeev, jrtc27, llvm-commits

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

llvm-svn: 337164

6 years ago[Sparc] Generate ta 1 for the @llvm.debugtrap intrinsic
Daniel Cederman [Mon, 16 Jul 2018 12:16:53 +0000 (12:16 +0000)]
[Sparc] Generate ta 1 for the @llvm.debugtrap intrinsic

Summary: Software trap number one is the trap used for breakpoints
in the Sparc ABI.

Reviewers: jyknight, venkatra

Reviewed By: jyknight

Subscribers: fedor.sergeev, jrtc27, llvm-commits

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

llvm-svn: 337163

6 years ago[ASTImporter] Import implicit methods of existing class.
Balazs Keri [Mon, 16 Jul 2018 12:16:39 +0000 (12:16 +0000)]
[ASTImporter] Import implicit methods of existing class.

Summary:
When an already existing class is encountered during import,
check if it has implicit methods that are missing in the existing one,
and import these.
The to-be-imported code may use the same class in different way than the
existing (before the import) code. This may result in that there are
implicit methods that are not generated for the existing code.

Reviewers: a.sidorin, a_sidorin

Reviewed By: a_sidorin

Subscribers: a_sidorin, martong, cfe-commits

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

llvm-svn: 337162

6 years agoAvoid losing Hi part when expanding VAARG nodes on big endian machines
Daniel Cederman [Mon, 16 Jul 2018 12:14:17 +0000 (12:14 +0000)]
Avoid losing Hi part when expanding VAARG nodes on big endian machines

Summary:
If the high part of the load is not used the offset to the next element
will not be set correctly.

For example, on Sparc V8, the following code will read val2 from offset 4
instead of 8.

```
int val = __builtin_va_arg(va, long long);
int val2 = __builtin_va_arg(va, int);
```

Reviewers: jyknight

Reviewed By: jyknight

Subscribers: fedor.sergeev, jrtc27, llvm-commits

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

llvm-svn: 337161

6 years ago[x86/SLH] Fix a bug where we would try to post-load harden non-GPRs.
Chandler Carruth [Mon, 16 Jul 2018 11:38:48 +0000 (11:38 +0000)]
[x86/SLH] Fix a bug where we would try to post-load harden non-GPRs.

Found cases that hit the assert I added. This patch factors the validity
checking into a nice helper routine and calls it when deciding to harden
post-load, and asserts it when doing so later.

I've added tests for the various ways of loading a floating point type,
as well as loading all vector permutations. Even though many of these go
to identical instructions, it seems good to somewhat comprehensively
test them.

I'm confident there will be more fixes needed here, I'll try to add
tests each time as I get this predicate adjusted.

llvm-svn: 337160

6 years agoMSan: minor fixes, NFC
Alexander Potapenko [Mon, 16 Jul 2018 10:57:19 +0000 (10:57 +0000)]
MSan: minor fixes, NFC

 - remove an extra space after |ID| declaration
 - drop the unused |FirstInsn| parameter in getShadowOriginPtrUserspace()

llvm-svn: 337159

6 years ago[AccelTable] Provide DWARF5AccelTableStaticData for dsymutil.
Jonas Devlieghere [Mon, 16 Jul 2018 10:52:27 +0000 (10:52 +0000)]
[AccelTable] Provide DWARF5AccelTableStaticData for dsymutil.

For dsymutil we want to store offsets in the accelerator table entries
rather than DIE pointers. In addition, we need a way to communicate
which CU a DIE belongs to. This patch provides support for both of these
issues.

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

llvm-svn: 337158

6 years ago[x86/SLH] Extract another small helper function, add better comments and
Chandler Carruth [Mon, 16 Jul 2018 10:46:16 +0000 (10:46 +0000)]
[x86/SLH] Extract another small helper function, add better comments and
use better terminology. NFC.

llvm-svn: 337157

6 years ago[AMDGPU][Waitcnt] Re-apply fix "comparison of integers of different signs" build...
Mark Searles [Mon, 16 Jul 2018 10:21:36 +0000 (10:21 +0000)]
[AMDGPU][Waitcnt] Re-apply fix "comparison of integers of different signs" build error"

Re-apply "[AMDGPU][Waitcnt] fix "comparison of integers of different signs" build error""
fe0a456510131f268e388c4a18a92f575c0db183 ), which was inadvertantly reverted via
2b2ee080f0164485562593b1b87291a48cea4a9a .

llvm-svn: 337156

6 years ago[MSan] factor userspace-specific declarations into createUserspaceApi(). NFC
Alexander Potapenko [Mon, 16 Jul 2018 10:03:30 +0000 (10:03 +0000)]
[MSan] factor userspace-specific declarations into createUserspaceApi(). NFC

This patch introduces createUserspaceApi() that creates function/global
declarations for symbols used by MSan in the userspace.
This is a step towards the upcoming KMSAN implementation patch.

Reviewed at https://reviews.llvm.org/D49292

llvm-svn: 337155

6 years agorun post-RA hazard recognizer pass late
Mark Searles [Mon, 16 Jul 2018 10:02:41 +0000 (10:02 +0000)]
run post-RA hazard recognizer pass late

Memory legalizer, waitcnt, and shrink  passes can perturb the instructions,
which means that the post-RA hazard recognizer pass should run after them.
Otherwise, one of those passes may invalidate the work done by the hazard
recognizer. Note that this has adverse side-effect that any consecutive
S_NOP 0's, emitted by the hazard recognizer, will not be shrunk into a
single S_NOP <N>. This should be addressed in a follow-on patch.

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

llvm-svn: 337154

6 years agoRevert "[AMDGPU][Waitcnt] fix "comparison of integers of different signs" build error"
Mark Searles [Mon, 16 Jul 2018 10:02:40 +0000 (10:02 +0000)]
Revert "[AMDGPU][Waitcnt] fix "comparison of integers of different signs" build error"

This reverts commit fe0a456510131f268e388c4a18a92f575c0db183.

llvm-svn: 337153

6 years ago[Sema] Reword warning for constant captures that are not required
Benjamin Kramer [Mon, 16 Jul 2018 09:52:02 +0000 (09:52 +0000)]
[Sema] Reword warning for constant captures that are not required

This is one of the darker corners of C++, make it clear that this is
about constants and rephrase it a bit.

Before: lambda capture 'i' is not required to be captured for this use
After:  lambda capture of constant 'i' is not required for this use
llvm-svn: 337152

6 years ago[Analyzer] Mark `SymbolData` parts of iterator position as live in program state...
Adam Balogh [Mon, 16 Jul 2018 09:27:27 +0000 (09:27 +0000)]
[Analyzer] Mark `SymbolData` parts of iterator position as live in program state maps

Marking a symbolic expression as live is non-recursive. In our checkers we
either use conjured symbols or conjured symbols plus/minus integers to
represent abstract position of iterators, so in this latter case we also
must mark the `SymbolData` part of these symbolic expressions as live to
prevent them from getting reaped.

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

llvm-svn: 337151

6 years agoAdd a test with __gcov_flush called before terminating the program.
Marco Castelluccio [Mon, 16 Jul 2018 09:13:46 +0000 (09:13 +0000)]
Add a test with __gcov_flush called before terminating the program.

Test for https://bugs.llvm.org/show_bug.cgi?id=38067.

llvm-svn: 337150

6 years ago[MemorySSAUpdater] Remove deleted trivial Phis from active workset
Alexandros Lamprineas [Mon, 16 Jul 2018 07:51:27 +0000 (07:51 +0000)]
[MemorySSAUpdater] Remove deleted trivial Phis from active workset

Bug fix for PR37808. The regression test is a reduced version of the
original reproducer attached to the bug report. As stated in the report,
the problem was that InsertedPHIs was keeping dangling pointers to
deleted Memory-Phis. MemoryPhis are created eagerly and sometimes get
zapped shortly afterwards. I've used WeakVH instead of an expensive
removal operation from the active workset.

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

llvm-svn: 337149