platform/upstream/llvm.git
6 years agoBy popular demand, switch in64_t on NetBSD/AArch64 and NetBSD/PowerPC64
Joerg Sonnenberger [Tue, 17 Jul 2018 12:33:19 +0000 (12:33 +0000)]
By popular demand, switch in64_t on NetBSD/AArch64 and NetBSD/PowerPC64
to long for consistency with other 64bit platforms.

llvm-svn: 337271

6 years ago[NFC][testcases] add testcases for folding srem whose operands are negatived.
Chen Zheng [Tue, 17 Jul 2018 12:31:54 +0000 (12:31 +0000)]
[NFC][testcases] add testcases for folding srem whose operands are negatived.

Finish same optimization for add instruction in D49216 and sdiv instruction in
D49382. This patch is for srem instruction.

llvm-svn: 337270

6 years agoDon't assert that a size_t fits into 64bit.
Joerg Sonnenberger [Tue, 17 Jul 2018 12:30:34 +0000 (12:30 +0000)]
Don't assert that a size_t fits into 64bit.

Avoids tautological compare warnings on 32bit platforms.

llvm-svn: 337269

6 years ago[ELF] - Add test for checking unknown -color-diagnostics arguments.
George Rimar [Tue, 17 Jul 2018 12:14:48 +0000 (12:14 +0000)]
[ELF] - Add test for checking unknown -color-diagnostics arguments.

This covers a following line with the test:
https://github.com/llvm-mirror/lld/blob/master/ELF/DriverUtils.cpp#L73

llvm-svn: 337268

6 years ago[ASTImporter] Fix import of unnamed structs
Gabor Marton [Tue, 17 Jul 2018 12:06:36 +0000 (12:06 +0000)]
[ASTImporter] Fix import of unnamed structs

Summary:
D48773 simplified ASTImporter nicely, but it introduced a new error: Unnamed
structs are not imported correctly, if they appear in a recursive context.
This patch provides a fix for structural equivalency.

Reviewers: a.sidorin, a_sidorin, balazske, gerazo

Subscribers: rnkovacs, dkrupp, cfe-commits

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

llvm-svn: 337267

6 years ago[ELF] - Add a test for --no-warn-symbol-ordering.
George Rimar [Tue, 17 Jul 2018 12:04:23 +0000 (12:04 +0000)]
[ELF] - Add a test for --no-warn-symbol-ordering.

Mentioned flag was never tested together with
--call-graph-ordering-file. And the following line
was uncovered:

https://github.com/llvm-mirror/lld/blob/master/ELF/Symbols.cpp#L248

llvm-svn: 337266

6 years ago[ELF] - Simplify Symbol::getSize(). NFC.
George Rimar [Tue, 17 Jul 2018 11:35:28 +0000 (11:35 +0000)]
[ELF] - Simplify Symbol::getSize(). NFC.

There are following symbols currently available:
DefinedKind, SharedKind, UndefinedKind, LazyArchiveKind, LazyObjectKind.

Our code calls getSize() only for first two and there
seems to be no reason to return 0 for the rest.

llvm-svn: 337265

6 years ago[LLVM-C] Fix name mangling on AggressiveInstCombine
whitequark [Tue, 17 Jul 2018 11:13:58 +0000 (11:13 +0000)]
[LLVM-C] Fix name mangling on AggressiveInstCombine

Similarly to rL336736, at least one more C API function does not
properly get declared as extern "C" due to a missing header, causing
name mangling and linking errors.

This patch fixes calls to LLVMAddAggressiveInstCombinerPass().

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

Reviewed By: whitequark

llvm-svn: 337264

6 years ago[LLVM-C] Add target triple normalization to the C API.
whitequark [Tue, 17 Jul 2018 10:57:39 +0000 (10:57 +0000)]
[LLVM-C] Add target triple normalization to the C API.

rL333307 was introduced to remove automatic target triple
normalization when calling sys::getDefaultTargetTriple(), arguing
that users of the latter already called Triple::normalize()
if necessary. However, users of the C API currently have no way of
doing target triple normalization.

This patch introduces an LLVMNormalizeTargetTriple function to
the C API which wraps Triple::normalize() and can be used on
the result of LLVMGetDefaultTargetTriple to achieve the same effect.

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

Reviewed By: whitequark

llvm-svn: 337263

6 years ago[llvm-objcopy] Run not with any python, but the python configured in lit.
Benjamin Kramer [Tue, 17 Jul 2018 10:30:56 +0000 (10:30 +0000)]
[llvm-objcopy] Run not with any python, but the python configured in lit.

llvm-svn: 337262

6 years agoMove pretty stack trace printer into driver.
Jonas Devlieghere [Tue, 17 Jul 2018 10:04:19 +0000 (10:04 +0000)]
Move pretty stack trace printer into driver.

We used to have a pretty stack trace printer in SystemInitializerCommon.
This was disabled on Apple because we didn't want the library to be
setting signal handlers, as this was causing issues when loaded into
Xcode. However, I think it's useful to have this for the LLDB driver, so
I moved it up to use the PrettyStackTraceProgram in the driver's main.

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

llvm-svn: 337261

6 years ago[ASTImporter] Import described template (if any) of function.
Balazs Keri [Tue, 17 Jul 2018 09:52:41 +0000 (09:52 +0000)]
[ASTImporter] Import described template (if any) of function.

Summary:
When a function is imported, check if it has a described template.
The name lookup is corrected to find the templated entity in this case.
The described template of the function is imported too.

Reviewers: a.sidorin, a_sidorin

Reviewed By: a_sidorin

Subscribers: a_sidorin, martong, cfe-commits

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

llvm-svn: 337260

6 years ago[AArch64][SVE] Asm: Support for predicated FP operations.
Sander de Smalen [Tue, 17 Jul 2018 09:48:57 +0000 (09:48 +0000)]
[AArch64][SVE] Asm: Support for predicated FP operations.

This patch adds support for the following floating point
instructions:
  FABD   (absolute difference)
  FADD   (addition)
  FSUB   (subtract)
  FSUBR  (subtract reverse form)
  FDIV   (divide)
  FDIVR  (divide reverse form)
  FMAX   (maximum)
  FMAXNM (maximum number)
  FMIN   (minimum)
  FMINNM (minimum number)
  FSCALE (adjust exponent)
  FMULX  (multiply extended)

All operations are predicated and binary form, e.g.

  fadd z0.h, p0/m, z0.h, z1.h
        ^___________^ (tied)

Supporting 16, 32 and 64-bit FP elements.

llvm-svn: 337259

6 years ago[DAGCombiner] Call SimplifyDemandedVectorElts from EXTRACT_VECTOR_ELT
Simon Pilgrim [Tue, 17 Jul 2018 09:45:35 +0000 (09:45 +0000)]
[DAGCombiner] Call SimplifyDemandedVectorElts from EXTRACT_VECTOR_ELT

If we are only extracting vector elements via EXTRACT_VECTOR_ELT(s) we may be able to use SimplifyDemandedVectorElts to avoid unnecessary vector ops.

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

llvm-svn: 337258

6 years agoFix MSVC "result of 32-bit shift implicitly converted to 64 bits" warning. NFCI.
Simon Pilgrim [Tue, 17 Jul 2018 09:39:55 +0000 (09:39 +0000)]
Fix MSVC "result of 32-bit shift implicitly converted to 64 bits" warning. NFCI.

llvm-svn: 337257

6 years ago[ELF] - Check we able to report function symbols that encloses a location in error...
George Rimar [Tue, 17 Jul 2018 09:37:53 +0000 (09:37 +0000)]
[ELF] - Check we able to report function symbols that encloses a location in error messages.

InputSectionBase::getLocation() have the following block of the code which
is uncovered by our test cases:
https://github.com/llvm-mirror/lld/blob/master/ELF/InputSection.cpp#L238

Patch adds a test to trigger this branch.

llvm-svn: 337256

6 years agoTemporarily revert r337226 "Restructure checking for, and warning on, lifetime extens...
Florian Hahn [Tue, 17 Jul 2018 09:23:31 +0000 (09:23 +0000)]
Temporarily revert r337226 "Restructure checking for, and warning on, lifetime extension."

This change breaks on ARM because pointers to clang::InitializedEntity are only
4 byte aligned and do not have 3 bits to store values. A possible solution
would be to change the fields in clang::InitializedEntity to enforce a bigger
alignment requirement.

The error message is

llvm/include/llvm/ADT/PointerIntPair.h:132:3: error: static_assert failed "PointerIntPair with integer size too large for pointer"
  static_assert(IntBits <= PtrTraits::NumLowBitsAvailable,
include/llvm/ADT/PointerIntPair.h:73:13: note: in instantiation of template class 'llvm::PointerIntPairInfo<const clang::InitializedEntity *, 3, llvm::PointerLikeTypeTraits<const clang::InitializedEntity *> >' requested here
    Value = Info::updateInt(Info::updatePointer(0, PtrVal),
llvm/include/llvm/ADT/PointerIntPair.h:51:5: note: in instantiation of member function 'llvm::PointerIntPair<const clang::InitializedEntity *, 3, (anonymous namespace)::LifetimeKind, llvm::PointerLikeTypeTraits<const clang::InitializedEntity *>, llvm::PointerIntPairInfo<const clang::InitializedEntity *, 3, llvm::PointerLikeTypeTraits<const clang::InitializedEntity *> > >::setPointerAndInt' requested here
    setPointerAndInt(PtrVal, IntVal);
    ^
llvm/tools/clang/lib/Sema/SemaInit.cpp:6237:12: note: in instantiation of member function 'llvm::PointerIntPair<const clang::InitializedEntity *, 3, (anonymous namespace)::LifetimeKind, llvm::PointerLikeTypeTraits<const clang::InitializedEntity *>, llvm::PointerIntPairInfo<const clang::InitializedEntity *, 3, llvm::PointerLikeTypeTraits<const clang::InitializedEntity *> > >::PointerIntPair' requested here
    return {Entity, LK_Extended};

Full log here:
http://lab.llvm.org:8011/builders/clang-cmake-armv7-global-isel/builds/1330
http://lab.llvm.org:8011/builders/clang-cmake-armv7-full/builds/1394

llvm-svn: 337255

6 years ago[ELF] - Fix BB. 'Filecheck' -> 'FileCheck'.
George Rimar [Tue, 17 Jul 2018 09:10:16 +0000 (09:10 +0000)]
[ELF] - Fix BB. 'Filecheck' -> 'FileCheck'.

llvm-svn: 337254

6 years ago[AArch64][SVE] Asm: Support for SPLICE instruction.
Sander de Smalen [Tue, 17 Jul 2018 08:52:45 +0000 (08:52 +0000)]
[AArch64][SVE] Asm: Support for SPLICE instruction.

The SPLICE instruction splices two vectors into one vector using a
predicate. It copies the active elements from the first vector, and
then fills the remaining elements with the low-numbered elements from
the second vector.

The instruction has the following form, e.g.

  splice z0.b, p0, z0.b, z1.b

for 8-bit elements. It also supports 16, 32 and
64-bit elements.

llvm-svn: 337253

6 years ago[ELF] - Check we are able to report zlib decompressor errors.
George Rimar [Tue, 17 Jul 2018 08:42:42 +0000 (08:42 +0000)]
[ELF] - Check we are able to report zlib decompressor errors.

This test case adds a check for the following line of the code:
https://github.com/llvm-mirror/lld/blob/master/ELF/InputSection.cpp#L194

llvm-svn: 337252

6 years ago[AArch64][SVE] Asm: Support for EXT instruction.
Sander de Smalen [Tue, 17 Jul 2018 08:39:48 +0000 (08:39 +0000)]
[AArch64][SVE] Asm: Support for EXT instruction.

This patch adds an instruction that allows extracting
a vector from a pair of vectors, given an immediate index
that describes the element position to extract from.

The instruction has the following assembly:
  ext z0.b, z0.b, z1.b, #imm

where #imm is an immediate between 0 and 255.

llvm-svn: 337251

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