platform/upstream/llvm.git
3 years ago[InstCombine] replace zombie unreachable values with 'undef' before erasing
Sanjay Patel [Sun, 20 Sep 2020 16:21:01 +0000 (12:21 -0400)]
[InstCombine] replace zombie unreachable values with 'undef' before erasing

The test (currently crashing) is reduced from the example provided
in the post-commit discussion in D87149.

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

3 years ago[Diagnostics] Fixed -Wsizeof-array-div false positive when divisor is sizeof referenc...
Dávid Bolvanský [Sun, 20 Sep 2020 15:42:39 +0000 (17:42 +0200)]
[Diagnostics] Fixed -Wsizeof-array-div false positive when divisor is sizeof reference type (PR47495)

3 years ago[X86][SSE] Fold EXTEND_VECTOR_INREG(EXTEND_VECTOR_INREG(X)) -> EXTEND_VECTOR_INREG(X)
Simon Pilgrim [Sun, 20 Sep 2020 15:33:02 +0000 (16:33 +0100)]
[X86][SSE] Fold EXTEND_VECTOR_INREG(EXTEND_VECTOR_INREG(X)) -> EXTEND_VECTOR_INREG(X)

It should be possible to make this generic, but we're not great at checking legality of *_EXTEND_VECTOR_INREG ops so I'm conservatively putting this inside X86ISelLowering.cpp

3 years ago[X86][SSE] Enable ZERO_EXTEND_VECTOR_INREG shuffle combining on SSE41 targets.
Simon Pilgrim [Sun, 20 Sep 2020 15:05:10 +0000 (16:05 +0100)]
[X86][SSE] Enable ZERO_EXTEND_VECTOR_INREG shuffle combining on SSE41 targets.

Allows ZERO_EXTEND_VECTOR_INREG to be shuffle combined on all targets where it is legal.

3 years ago[X86] Rename getExtendInVec to getEXTEND_VECTOR_INREG. NFCI.
Simon Pilgrim [Sun, 20 Sep 2020 14:19:39 +0000 (15:19 +0100)]
[X86] Rename getExtendInVec to getEXTEND_VECTOR_INREG. NFCI.

Make it easier to find the method by naming it after the ops it actually handles. We already do this for lowering/combining.

3 years agoDWARFYAML::emitDebugSections - fix use after std::move warnings. NFCI.
Simon Pilgrim [Sun, 20 Sep 2020 13:42:36 +0000 (14:42 +0100)]
DWARFYAML::emitDebugSections - fix use after std::move warnings. NFCI.

We were using Err after it had been moved into cantFail - avoid this by calling cantFail with Error::success() directly.

3 years ago[X86] combineX86ShufflesRecursively - fix use after move warning. NFCI.
Simon Pilgrim [Sun, 20 Sep 2020 13:06:50 +0000 (14:06 +0100)]
[X86] combineX86ShufflesRecursively - fix use after move warning. NFCI.

After moving WidenedMask is in an undefined state, so reduce scope of the variable so its reinitialized every iteration - we should still retain any memory allocation savings.

3 years agoJSONCompilationDatabase.cpp - cleanup key parsing error checks. NFCI.
Simon Pilgrim [Sun, 20 Sep 2020 12:55:04 +0000 (13:55 +0100)]
JSONCompilationDatabase.cpp - cleanup key parsing error checks. NFCI.

Merge the key + sequence/value checks with the key handling code.

Reduces the number of key string comparisons and avoids a number of clang static analyzer null dereference warnings.

3 years ago [MemLoc] Support lllvm.memcpy.inline in MemoryLocation::getForArgument
Dávid Bolvanský [Sun, 20 Sep 2020 11:59:07 +0000 (13:59 +0200)]
 [MemLoc] Support lllvm.memcpy.inline in MemoryLocation::getForArgument

Reviewed By: fhahn

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

3 years ago[X86] Rename combineExtInVec to combineEXTEND_VECTOR_INREG. NFCI.
Simon Pilgrim [Sun, 20 Sep 2020 10:33:28 +0000 (11:33 +0100)]
[X86] Rename combineExtInVec to combineEXTEND_VECTOR_INREG. NFCI.

Make it easier to find the method by naming it after the ops it actually handles. We already do this for lowering.

3 years ago[tools][remarks-shlib] Don't build libRemarks.so without PIC
Rainer Orth [Sun, 20 Sep 2020 10:40:21 +0000 (12:40 +0200)]
[tools][remarks-shlib] Don't build libRemarks.so without PIC

A build on `sparcv9-sun-solaris2.11` with `-DLLVM_ENABLE_PIC=Off` failed
linking `libRemarks.so`:

  [27/2297] Linking CXX shared library lib/libRemarks.so.12git
  FAILED: lib/libRemarks.so.12git
  [...]
  ld: fatal: relocation error: R_SPARC_H44: file lib/libLLVMRemarks.a(Remark.cpp.o): symbol _ZTVN4llvm18raw_string_ostreamE: invalid shared object relocation type: ABS44 code model unsupported
  [...]

On Solaris/sparcv9 as on many other targets you cannot link non-PIC objects
into a shared object.

The following patch avoids this by not building the library with PIC.  It
allowed the build to complete and `ninja check-all` showed no errors.

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

3 years ago[FunctionAttrs] Inline setDoesNotRecurse() and delete it. NFC
Fangrui Song [Sun, 20 Sep 2020 05:24:51 +0000 (22:24 -0700)]
[FunctionAttrs] Inline setDoesNotRecurse() and delete it. NFC

It always returns true, which may lead to confusion. Inline it because it is
trivial and only called twice.

3 years ago[FunctionAttrs] Remove redundant check. NFC
Fangrui Song [Sun, 20 Sep 2020 03:46:13 +0000 (20:46 -0700)]
[FunctionAttrs] Remove redundant check. NFC

3 years agoFix some clang-tidy bugprone-argument-comment issues
Fangrui Song [Sun, 20 Sep 2020 03:41:25 +0000 (20:41 -0700)]
Fix some clang-tidy bugprone-argument-comment issues

3 years ago[ORC][examples] Add an OrcV2 example for IR optimization via IRTransformLayer.
Lang Hames [Sun, 20 Sep 2020 01:56:49 +0000 (18:56 -0700)]
[ORC][examples] Add an OrcV2 example for IR optimization via IRTransformLayer.

Shows how to write a custom IR transform to apply a legacy::PassManager
pipeline.

3 years ago[Driver] Add disabled-by-default -Wuse-ld-path for the deprecation warning for -fuse...
Fangrui Song [Sat, 19 Sep 2020 22:49:44 +0000 (15:49 -0700)]
[Driver] Add disabled-by-default -Wuse-ld-path for the deprecation warning for -fuse-ld=/abs/path

The warning is currently not under a -W option, so it cannot be suppressed.
This is annoying for the widespread build system Bazel when specifying the path to gold
https://github.com/bazelbuild/bazel/commit/cdd0c3cdba270115940e8ca5ec8104cbcd694671

I have notified them about using --ld-path= forwards
https://github.com/bazelbuild/bazel/pull/8580#issuecomment-694321543
but we have to give some transitional period.

Reviewed By: dblaikie

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

3 years ago[Local] Clean up enforceKnownAlignment() (NFC)
Nikita Popov [Sat, 19 Sep 2020 20:26:53 +0000 (22:26 +0200)]
[Local] Clean up enforceKnownAlignment() (NFC)

I want to export this function, and the current API was a bit
weird: It took an additional Alignment argument that didn't really
have anything to do with what the function does. Drop it, and
perform a max at the callsite.

Also rename it to tryEnforceAlignment().

3 years agoalign __TEXT,__unwind_info to 8 byte boundary
Greg McGary [Sat, 19 Sep 2020 19:28:33 +0000 (12:28 -0700)]
align __TEXT,__unwind_info to 8 byte boundary

3 years ago[scudo/standalone] Fix undefined behavior in checksum test
Roland McGrath [Sat, 19 Sep 2020 18:44:39 +0000 (11:44 -0700)]
[scudo/standalone] Fix undefined behavior in checksum test

1U has type unsigned int, and << of 32 or more is undefined behavior.
Use the proper type in the lhs of the shift.

Reviewed By: cryptoad

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

3 years ago[InstCombine] Regenerate test checks (NFC)
Nikita Popov [Sat, 19 Sep 2020 18:54:20 +0000 (20:54 +0200)]
[InstCombine] Regenerate test checks (NFC)

3 years ago[NFC][PhaseOrdering] Add test showing SROA not being performed after loop unrolling
Roman Lebedev [Sat, 19 Sep 2020 18:13:35 +0000 (21:13 +0300)]
[NFC][PhaseOrdering] Add test showing SROA not being performed after loop unrolling

3 years ago[BasicAA] Regenerate test checks
Dávid Bolvanský [Sat, 19 Sep 2020 17:35:55 +0000 (19:35 +0200)]
[BasicAA] Regenerate test checks

3 years ago[SCEVExpander] Support expanding nonintegral pointers with constant base.
Florian Hahn [Sat, 19 Sep 2020 15:08:19 +0000 (16:08 +0100)]
[SCEVExpander] Support expanding nonintegral pointers with constant base.

Currently SCEVExpander creates inttoptr for non-integral pointers if the
base is a null constant for example. This results in invalid IR.

This patch changes InsertNoopCastOfTo to emit a GEP & bitcast to convert
to a non-integral pointer. First, a GEP of i8* null is generated and the
integral value is used as index. The GEP is then bitcasted to the target
type.

This was exposed by D71539.

Reviewed By: efriedma

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

3 years ago[MemLoc] Support bcmp in MemoryLocation::getForArgument
Dávid Bolvanský [Sat, 19 Sep 2020 15:11:06 +0000 (17:11 +0200)]
[MemLoc] Support bcmp in MemoryLocation::getForArgument

Reviewed By: fhahn

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

3 years ago[InstCombine] auto-generate test checks; NFC
Sanjay Patel [Sat, 19 Sep 2020 15:06:47 +0000 (11:06 -0400)]
[InstCombine] auto-generate test checks; NFC

3 years ago[InstCombine] regenerate test checks; NFC
Sanjay Patel [Sat, 19 Sep 2020 14:43:18 +0000 (10:43 -0400)]
[InstCombine] regenerate test checks; NFC

3 years ago[ConstantFolding] add undef handling for fmin/fmax intrinsics
Sanjay Patel [Fri, 18 Sep 2020 20:37:17 +0000 (16:37 -0400)]
[ConstantFolding] add undef handling for fmin/fmax intrinsics

The output here may not be optimal (yet), but it should be
consistent for commuted operands (it was not before) and
correct. We can do better by checking FMF and NaN if needed.

Code in InstSimplify generally assumes that we have already
folded code like this, so it was not handling 2 constant
inputs by commuting consistently.

3 years agoFixes complexity of map insert_or_assign with a hint.
Mark de Wever [Sat, 19 Sep 2020 13:39:09 +0000 (15:39 +0200)]
Fixes complexity of map insert_or_assign with a hint.

Mitsuru Kariya reported the map operations insert_or_assign with a hint
violates the complexity requirement. The function no longer uses a lower_bound,
which caused the wrong complexity.

Fixes PR38722: [C++17] std::map::insert_or_assign w/ hint violate complexity requirements

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

3 years agoRevert "[HIP] Fix -gsplit-dwarf option"
Yaxun (Sam) Liu [Sat, 19 Sep 2020 14:15:27 +0000 (10:15 -0400)]
Revert "[HIP] Fix -gsplit-dwarf option"

This reverts commit e50465ecefc964e5700df26fc7e02a673eed085a
due to regression in lldb tests.

3 years ago[HIP] Fix -gsplit-dwarf option
Yaxun (Sam) Liu [Mon, 14 Sep 2020 18:21:30 +0000 (14:21 -0400)]
[HIP] Fix -gsplit-dwarf option

when -gsplit option is used with clang driver, clang driver will create
a filename with .dwo option based on the input file name and pass
it to clang -cc1. This file is used for storing the debug info. Since
HIP generate separate object files for different GPU arch's,
this file should be different for different GPU arch. This patch
adds _ and GPU arch to the stem of the dwo file.

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

3 years agoChange name of Record::TheInit to CorrespondingDefInit to make code clearer.
Paul C. Anagnostopoulos [Fri, 18 Sep 2020 17:54:38 +0000 (13:54 -0400)]
Change name of Record::TheInit to CorrespondingDefInit to make code clearer.

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

3 years agolld/mach-o: Make tool scripts from 2124ca1d5cb py2.7-compatible
Nico Weber [Sat, 19 Sep 2020 13:17:02 +0000 (09:17 -0400)]
lld/mach-o: Make tool scripts from 2124ca1d5cb py2.7-compatible

3 years ago[gn build] Port 2124ca1d5cb
Nico Weber [Sat, 19 Sep 2020 12:34:58 +0000 (08:34 -0400)]
[gn build] Port 2124ca1d5cb

3 years ago[gn build] (manually) merge 2124ca1d5
Nico Weber [Sat, 19 Sep 2020 12:29:55 +0000 (08:29 -0400)]
[gn build] (manually) merge 2124ca1d5

3 years agoRevert "Revert "[gn build] (manually) port 9b6765e784b3" anf follow-ups"
Nico Weber [Sat, 19 Sep 2020 12:28:38 +0000 (08:28 -0400)]
Revert "Revert "[gn build] (manually) port 9b6765e784b3" anf follow-ups"

This reverts commit 90fffdd0f705bfb480810cef087305567dc4f6cf.
The original change relanded.

3 years agoInstCombiner.h - remove unnecessary KnownBits forward declaration. NFCI.
Simon Pilgrim [Sat, 19 Sep 2020 11:52:09 +0000 (12:52 +0100)]
InstCombiner.h - remove unnecessary KnownBits forward declaration. NFCI.

We already include KnownBits.h

3 years agoRevert "Temporarily Revert "[clangd] Add Random Forest runtime for code completion.""
Utkarsh Saxena [Sat, 19 Sep 2020 08:07:34 +0000 (10:07 +0200)]
Revert "Temporarily Revert "[clangd] Add Random Forest runtime for code completion.""

We intend to replace heuristics based code completion ranking with a Decision Forest Model.

This patch introduces a format for representing the model and an inference runtime that is code-generated at build time.
- Forest.json contains all the trees as an array of trees.
- Features.json describes the features to be used.
- Codegen file takes the above two files and generates CompletionModel containing Feature struct and corresponding Evaluate function.
   The Evaluate function maps a feature to a real number describing the relevance of this candidate.
- The codegen is part of build system and these files are generated at build time.
- Proposes a way to test the generated runtime using a test model.
  - Replicates the model structure in unittests.
  - unittest tests both the test model (for correct tree traversal) and the real model (for sanity).

This reverts commit 549e55b3d5634870aa9d42135f51ad46a6a0e347.

3 years agoAdd -Wno-error=unknown flag to clang-format.
Joachim Meyer [Tue, 18 Aug 2020 12:33:34 +0000 (14:33 +0200)]
Add -Wno-error=unknown flag to clang-format.

Currently newer clang-format options cannot be included in .clang-format files, if not all users can be forced to use an updated version.
This patch tries to solve this by adding an option to clang-format, enabling to ignore unknown (newer) options.

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

3 years ago[NFC] Test commit
Joachim Meyer [Sat, 19 Sep 2020 08:12:41 +0000 (10:12 +0200)]
[NFC] Test commit

3 years ago[X86] Return from SimplifyDemandedBitsForTargetNode after calculating known bits...
Craig Topper [Sat, 19 Sep 2020 06:37:50 +0000 (23:37 -0700)]
[X86] Return from SimplifyDemandedBitsForTargetNode after calculating known bits for VSHLI/VSRAI/VSRLI.

We were breaking out of the switch which falls into the default
implementation of SimplifyDemandedBitsForTargetNode which is a
wrapper around computeKnownBits. So we end up doing the recursion
and known bits calculation all over again. Instead we should return
with the known bits we calculated in the switch.

3 years ago[AArch64][GlobalISel] Add legalization and selection support for <4 x s16> G_SHL.
Amara Emerson [Sat, 19 Sep 2020 06:31:30 +0000 (23:31 -0700)]
[AArch64][GlobalISel] Add legalization and selection support for <4 x s16> G_SHL.

3 years ago[ASAN] Properly deal with musttail calls in ASAN
Xun Li [Sat, 19 Sep 2020 06:10:22 +0000 (23:10 -0700)]
[ASAN] Properly deal with musttail calls in ASAN

When address sanitizing a function, stack unpinsoning code is inserted before each ret instruction. However if the ret instruciton is preceded by a musttail call, such transformation broke the musttail call contract and generates invalid IR.
This patch fixes the issue by moving the insertion point prior to the musttail call if there is one.

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

3 years ago[IRSim] Adding ilist for IRInstructionData.
Andrew Litteken [Tue, 15 Sep 2020 21:16:48 +0000 (16:16 -0500)]
[IRSim] Adding ilist for IRInstructionData.

The IRInstructionData structs are a different representation of the
program.  This list treats the program as if it was "flattened" and
the only parent is this list.  This lets us easily create ranges of
instructions.

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

3 years ago[lld-macho] create __TEXT,__unwind_info from __LD,__compact_unwind
Greg McGary [Thu, 20 Aug 2020 20:05:13 +0000 (13:05 -0700)]
[lld-macho] create __TEXT,__unwind_info from __LD,__compact_unwind

Digest the input `__LD,__compact_unwind` and produce the output `__TEXT,__unwind_info`. This is the initial commit with the major functionality.

Successor commits will add handling for ...
* `__TEXT,__eh_frame`
* personalities & LSDA
* `-r` pass-through

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

3 years ago[X86] Fix copy paste mistake in @ccnp flag.
Craig Topper [Sat, 19 Sep 2020 01:00:06 +0000 (18:00 -0700)]
[X86] Fix copy paste mistake in @ccnp flag.

We were treating @ccp and @ccnp the same.

3 years ago[X86] Invert the compares in inline-asm-flag-output.ll so that the setcc instruction...
Craig Topper [Sat, 19 Sep 2020 04:05:50 +0000 (21:05 -0700)]
[X86] Invert the compares in inline-asm-flag-output.ll so that the setcc instruction condition matches the test name. NFC

Also add nounwind to the tests to remove cfi directives.

3 years agoDebugInfo: Cleanup RLE dumping, using a length-constrained DataExtractor rather than...
David Blaikie [Sat, 19 Sep 2020 02:29:37 +0000 (19:29 -0700)]
DebugInfo: Cleanup RLE dumping, using a length-constrained DataExtractor rather than carrying the end offset separately

3 years ago[gn build] (manually) port 5495b691646
Nico Weber [Sat, 19 Sep 2020 01:27:42 +0000 (21:27 -0400)]
[gn build] (manually) port 5495b691646

3 years ago[llvm-objcopy][MachO] Clean up the interface of Object
Alexander Shaposhnikov [Sat, 19 Sep 2020 01:22:48 +0000 (18:22 -0700)]
[llvm-objcopy][MachO] Clean up the interface of Object

Remove the method addLoadCommand which was used only in a single place.
NFC.

Test plan: make check-all

3 years agoRevert "[gn build] (manually) port 9b6765e784b3" anf follow-ups
Nico Weber [Sat, 19 Sep 2020 01:11:56 +0000 (21:11 -0400)]
Revert "[gn build] (manually) port 9b6765e784b3" anf follow-ups

9b6765e784b3 was reverted in 549e55b3d5634.

This reverts commit 442801a7b9b5460114498c48c12b8af40e495188.
This reverts commit 929d91a55616d4fcf4754044b063644807b87fbe.
This reverts commit 7c2d83347f4ea146af1aca72fe289294aaf212be.

3 years ago[llvm-objcopy][MachO] Add llvm-bitcode-strip driver
Alexander Shaposhnikov [Sat, 19 Sep 2020 01:11:22 +0000 (18:11 -0700)]
[llvm-objcopy][MachO] Add llvm-bitcode-strip driver

This diff adds llvm-bitcode-strip driver to llvm-objcopy.
In the future this will enable us to build a replacement for the tool bitcode_strip.

Test plan: make check-all

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

3 years agoTemporarily Revert "RegAllocFast: Rewrite and improve"
Eric Christopher [Sat, 19 Sep 2020 01:00:02 +0000 (18:00 -0700)]
Temporarily Revert "RegAllocFast: Rewrite and improve"
as it's breaking a few tests in the lldb test suite.

Bot: http://lab.llvm.org:8011/builders/lldb-arm-ubuntu/builds/4226/steps/test/logs/stdio

This reverts commit c8757ff3aa7dd7a25a6343f6ef74a70c7be04325.

3 years ago[llvm-install-name-tool] Validate -id value early
Alexander Shaposhnikov [Sat, 19 Sep 2020 00:50:08 +0000 (17:50 -0700)]
[llvm-install-name-tool] Validate -id value early

The code which validates the value of -id is moved into the function parseInstallNameToolOptions.

Test plan: make check-all

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

3 years ago[LiveDebugValues] Add `#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)` to suppress...
Fangrui Song [Sat, 19 Sep 2020 00:23:46 +0000 (17:23 -0700)]
[LiveDebugValues] Add `#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)` to suppress -Wunused-function

3 years ago[NFC][LSan] Add REQUIRES: linux
Vitaly Buka [Sat, 19 Sep 2020 00:22:35 +0000 (17:22 -0700)]
[NFC][LSan] Add REQUIRES: linux

Additional registers scaning is only implemented for x86 linux.

3 years ago[AArch64][GlobalISel] Add tests for pre-existing selection support for <4 x s16>...
Amara Emerson [Fri, 18 Sep 2020 23:46:02 +0000 (16:46 -0700)]
[AArch64][GlobalISel] Add tests for pre-existing selection support for <4 x s16> arithmetic/bitwise ops.

3 years ago[AArch64][GlobalISel] Legalize arithmetic ops for <4 x s16>
Amara Emerson [Fri, 18 Sep 2020 23:45:12 +0000 (16:45 -0700)]
[AArch64][GlobalISel] Legalize arithmetic ops for <4 x s16>

3 years ago[NFC][StackSafety] Replace auto with type
Vitaly Buka [Sat, 19 Sep 2020 00:08:21 +0000 (17:08 -0700)]
[NFC][StackSafety] Replace auto with type

Fixes static analyzer is warning.

3 years ago[NFC][Asan] Fix test broken by RegAllocFast
Vitaly Buka [Fri, 18 Sep 2020 23:46:20 +0000 (16:46 -0700)]
[NFC][Asan] Fix test broken by RegAllocFast

The test worked only because by coincidence register with pointer was
clobbered.
After D52010 value is still preserved.

3 years ago[SCEV] Fix an unused variable in -DLLVM_ENABLE_ASSERTIONS=off build
Fangrui Song [Fri, 18 Sep 2020 23:16:14 +0000 (16:16 -0700)]
[SCEV] Fix an unused variable in -DLLVM_ENABLE_ASSERTIONS=off build

3 years ago[GlobalISel] Add lowering support for G_ABS and use for AArch64.
Amara Emerson [Fri, 18 Sep 2020 22:13:12 +0000 (15:13 -0700)]
[GlobalISel] Add lowering support for G_ABS and use for AArch64.

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

3 years ago[PowerPC] Implement Move to VSR Mask builtins in LLVM/Clang
Amy Kwan [Fri, 18 Sep 2020 22:38:08 +0000 (17:38 -0500)]
[PowerPC] Implement Move to VSR Mask builtins in LLVM/Clang

This patch implements the vec_gen[b|h|w|d|q]m function prototypes in altivec.h
in order to utilize the move to VSR with mask instructions introduced in Power10.

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

3 years ago[lld][WebAssembly] Fix -Wunused-variable after D87663
Fangrui Song [Fri, 18 Sep 2020 23:10:39 +0000 (16:10 -0700)]
[lld][WebAssembly] Fix -Wunused-variable after D87663

3 years ago[NFC][sanitizer] Don't use ::testing::internal
Vitaly Buka [Fri, 18 Sep 2020 22:24:46 +0000 (15:24 -0700)]
[NFC][sanitizer] Don't use ::testing::internal

3 years ago[clang] Remove profile available check for fsplit-machine-functions.
Snehasish Kumar [Fri, 18 Sep 2020 21:08:21 +0000 (14:08 -0700)]
[clang] Remove profile available check for fsplit-machine-functions.

Enforcing a profile available check in the driver does not work with
incremental LTO builds where the LTO backend invocation does not include
the profile flags. At this point the profiles have already been consumed
and the IR contains profile metadata. Instead we always pass through the
-fsplit-machine-functions flag on user request. The pass itself contains
a check to return early if no profile information is available.

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

3 years ago[clang][module] Improve incomplete-umbrella warning
Zixu Wang [Tue, 16 Jun 2020 23:39:50 +0000 (16:39 -0700)]
[clang][module] Improve incomplete-umbrella warning

Change the warning message for -Wincomplete-umbrella to report the location of the umbrella header;

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

3 years ago[instcombine][x86] Converted pdep/pext with shifted mask to simple arithmetic
Philip Reames [Fri, 18 Sep 2020 21:53:29 +0000 (14:53 -0700)]
[instcombine][x86] Converted pdep/pext with shifted mask to simple arithmetic

If the mask of a pdep or pext instruction is a shift masked (i.e. one contiguous block of ones) we need at most one and and one shift to represent the operation without the intrinsic. One all platforms I know of, this is faster than the pdep/pext.

The cost modelling for multiple contiguous blocks might be worth exploring in a follow up, but it's not relevant for my current use case. It would almost certainly be a win on AMDs where these are really really slow though.

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

3 years ago[test][InstrProf] Fix always_inline.ll under NPM
Arthur Eubanks [Fri, 18 Sep 2020 18:26:58 +0000 (11:26 -0700)]
[test][InstrProf] Fix always_inline.ll under NPM

NPM's inliner does not clean up dead functions.

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

3 years agoTemporarily Revert "[clangd] Add Random Forest runtime for code completion."
Eric Christopher [Fri, 18 Sep 2020 21:47:43 +0000 (14:47 -0700)]
Temporarily Revert "[clangd] Add Random Forest runtime for code completion."
as a header doesn't appear to have made it into the commit.

This reverts commit 9b6765e784b39c88cb8cdb85ab083e6c95a997ed and followup

3 years ago[spirv] Move device info from resource limit into target env
Lei Zhang [Fri, 18 Sep 2020 21:39:53 +0000 (17:39 -0400)]
[spirv] Move device info from resource limit into target env

Vendor/device information are not resource limits. Moving to
target environment directly for better organization.

Reviewed By: mravishankar

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

3 years ago[COFF] Move per-global .drective emission from AsmPrinter to TLOFCOFF
Reid Kleckner [Fri, 18 Sep 2020 20:43:13 +0000 (13:43 -0700)]
[COFF] Move per-global .drective emission from AsmPrinter to TLOFCOFF

This changes the order of output sections and the output assembly, but
is otherwise NFC.

It simplifies the TLOF interface by removing two COFF-only methods.

3 years ago[llvm-cov] Allow commas in filenames passed to `-object` flag
Vedant Kumar [Fri, 18 Sep 2020 20:43:49 +0000 (13:43 -0700)]
[llvm-cov] Allow commas in filenames passed to `-object` flag

Currently, -object takes a comma separated list of objects as an
argument, which prevents it working with path names that contain a
comma. Drop comma-separated support, which requires to set pass the
-object flag multiple times to set multiple objects.

Patch by Andrew Gallagher!

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

3 years ago[msan][asan] Add runtime flag intercept_strcmp
Vitaly Buka [Fri, 18 Sep 2020 10:00:50 +0000 (03:00 -0700)]
[msan][asan] Add runtime flag intercept_strcmp

Can be used to disable interceptor to workaround issues of
non-instrumented code.

Reviewed By: morehouse, eugenis

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

3 years ago[OpenMP] Initial Support for OpenMP Webpage Documentation
Joseph Huber [Wed, 16 Sep 2020 21:15:56 +0000 (17:15 -0400)]
[OpenMP] Initial Support for OpenMP Webpage Documentation

Summary:
Adding support for generated html documentation for OpenMP. Changing
Cmake files to build the documentation and adding the base templates for
future documentation to be added.

Reviewers: jdoerfert

Subscribers: aaron.ballman arphaman guansong mgorny openmp-commits sstefan1 yaxunl

Tags: #OpenMP

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

3 years agoCompletionModelCodegen: Remove unused import
Nico Weber [Fri, 18 Sep 2020 20:24:54 +0000 (16:24 -0400)]
CompletionModelCodegen: Remove unused import

The unused import is 3.4+, so it also breaks py2.7 compat.
But this is easy to fix :)

3 years agoclang: Make changes in 7c8bb409f31e py2.7-compatible
Nico Weber [Fri, 18 Sep 2020 20:15:24 +0000 (16:15 -0400)]
clang: Make changes in 7c8bb409f31e py2.7-compatible

3 years ago[InstSimplify] add tests for constant folding fmin/fmax with undef op; NFC
Sanjay Patel [Fri, 18 Sep 2020 14:36:24 +0000 (10:36 -0400)]
[InstSimplify] add tests for constant folding fmin/fmax with undef op; NFC

3 years ago[gn build] add file i forgot to add in 929d91a55616
Nico Weber [Fri, 18 Sep 2020 20:01:00 +0000 (16:01 -0400)]
[gn build] add file i forgot to add in 929d91a55616

3 years ago[gn build] (manually) port 9b6765e784b3 more
Nico Weber [Fri, 18 Sep 2020 19:56:15 +0000 (15:56 -0400)]
[gn build] (manually) port 9b6765e784b3 more

3 years agoTemporarily Revert "[SLP] Allow reordering of vectorization trees with reused instruc...
Eric Christopher [Fri, 18 Sep 2020 19:33:12 +0000 (12:33 -0700)]
Temporarily Revert "[SLP] Allow reordering of vectorization trees with reused instructions."
as it's infinite looping on occasion.

This reverts commit 455ca0ebb69210046928fedffe292420a30f89ad.

3 years ago[clang-format] Recognize "hxx" as a C++ header in clang-format-diff.py
Miklos Vajna [Fri, 18 Sep 2020 19:42:38 +0000 (21:42 +0200)]
[clang-format] Recognize "hxx" as a C++ header in clang-format-diff.py

And shift "proto" to the next line to avoid a too long line.

Reviewed By: MyDeveloperDay

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

3 years ago[gn build] Do not sync filenames containing variable references
Nico Weber [Fri, 18 Sep 2020 19:34:21 +0000 (15:34 -0400)]
[gn build] Do not sync filenames containing variable references

3 years agoPre-commit test for CSEing masked loads/stores
Krzysztof Parzyszek [Fri, 18 Sep 2020 19:28:11 +0000 (14:28 -0500)]
Pre-commit test for CSEing masked loads/stores

3 years ago[gn build] (manually) port 9b6765e784b3
Nico Weber [Fri, 18 Sep 2020 19:26:52 +0000 (15:26 -0400)]
[gn build] (manually) port 9b6765e784b3

3 years agoclangd: Make ompletionModelCodegen.py tpy2.7 compatible
Nico Weber [Fri, 18 Sep 2020 19:25:53 +0000 (15:25 -0400)]
clangd:  Make ompletionModelCodegen.py tpy2.7 compatible

LLVM still supports Python 2.7, so unbreak bots that still run that.
In a separate commit so that this is easy to revert once we drop
support :)

3 years agoFirst pass on MLIR python context lifetime management.
Stella Laurenzo [Fri, 18 Sep 2020 07:21:09 +0000 (00:21 -0700)]
First pass on MLIR python context lifetime management.

* Per thread https://llvm.discourse.group/t/revisiting-ownership-and-lifetime-in-the-python-bindings/1769
* Reworks contexts so it is always possible to get back to a py::object that holds the reference count for an arbitrary MlirContext.
* Retrofits some of the base classes to automatically take a reference to the context, elimintating keep_alives.
* More needs to be done, as discussed, when moving on to the operations/blocks/regions.

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

3 years agoscudo: Add an API for disabling memory initialization per-thread.
Peter Collingbourne [Thu, 10 Sep 2020 02:15:26 +0000 (19:15 -0700)]
scudo: Add an API for disabling memory initialization per-thread.

Here "memory initialization" refers to zero- or pattern-init on
non-MTE hardware, or (where possible to avoid) memory tagging on MTE
hardware. With shared TSD the per-thread memory initialization state
is stored in bit 0 of the TLS slot, similar to PointerIntPair in LLVM.

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

3 years ago[X86][AVX] lowerBuildVectorAsBroadcast - improve BROADCASTM lowering on non-VLX targets
Simon Pilgrim [Fri, 18 Sep 2020 18:51:45 +0000 (19:51 +0100)]
[X86][AVX] lowerBuildVectorAsBroadcast - improve BROADCASTM lowering on non-VLX targets

Broadcast to a ZMM type then extract the low subvector.

3 years ago[test][TSan] Fix tests under NPM
Arthur Eubanks [Fri, 18 Sep 2020 18:32:58 +0000 (11:32 -0700)]
[test][TSan] Fix tests under NPM

Under NPM, the TSan passes are split into a module and function pass. A
couple tests were testing for inserted module constructors, which is
only part of the module pass.

3 years ago[InstCombine][SVE] Skip scalable type for InstCombiner::getFlippedStrictnessPredicate...
Huihui Zhang [Fri, 18 Sep 2020 18:26:28 +0000 (11:26 -0700)]
[InstCombine][SVE] Skip scalable type for InstCombiner::getFlippedStrictnessPredicateAndConstant.

We cannot iterate on scalable vector, the number of elements is unknown at compile-time.

Reviewed By: efriedma

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

3 years agoLinewrap & remove some dead typedefs from previous commit
David Blaikie [Fri, 18 Sep 2020 18:22:37 +0000 (11:22 -0700)]
Linewrap & remove some dead typedefs from previous commit

Cleanup for 51a505340dfdfdfd9ab32c7267a74db3cdeefa56

3 years agoDebugInfo: Simplify line table parsing to take all the units together, rather than...
David Blaikie [Fri, 18 Sep 2020 18:17:56 +0000 (11:17 -0700)]
DebugInfo: Simplify line table parsing to take all the units together, rather than CUs and TUs separately

3 years agoPR47468: Fix findPHICopyInsertPoint, so that copies aren't incorrectly inserted after...
James Y Knight [Thu, 17 Sep 2020 22:10:19 +0000 (18:10 -0400)]
PR47468: Fix findPHICopyInsertPoint, so that copies aren't incorrectly inserted after an INLINEASM_BR.

findPHICopyInsertPoint special cases placement in a block with a
callbr or invoke in it. In that case, we must ensure that the copy is
placed before the INLINEASM_BR or call instruction, if the register is
defined prior to that instruction, because it may jump out of the
block.

Previously, the code placed it immediately after the last def _or
use_. This is wrong, if the use is the instruction which may jump.  We
could correctly place it immediately after the last def (ignoring
uses), but that is non-optimal for register pressure.

Instead, place the copy after the last def, or before the
call/inlineasm_br, whichever is later.

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

3 years ago[X86][AVX] Add missing non AVX512VL broadcastm test coverage
Simon Pilgrim [Fri, 18 Sep 2020 18:11:09 +0000 (19:11 +0100)]
[X86][AVX] Add missing non AVX512VL broadcastm test coverage

3 years agoCodeGen: Move split block utility to MachineBasicBlock
Matt Arsenault [Fri, 11 Sep 2020 15:42:44 +0000 (11:42 -0400)]
CodeGen: Move split block utility to MachineBasicBlock

AMDGPU needs this in several places, so consolidate them here.

3 years agoRegAllocFast: Rewrite and improve
Matt Arsenault [Mon, 14 Sep 2020 16:48:12 +0000 (12:48 -0400)]
RegAllocFast: Rewrite and improve

This rewrites big parts of the fast register allocator. The basic
strategy of doing block-local allocation hasn't changed but I tweaked
several details:

Track register state on register units instead of physical
registers. This simplifies and speeds up handling of register aliases.
Process basic blocks in reverse order: Definitions are known to end
register livetimes when walking backwards (contrary when walking
forward then uses may or may not be a kill so we need heuristics).

Check register mask operands (calls) instead of conservatively
assuming everything is clobbered.  Enhance heuristics to detect
killing uses: In case of a small number of defs/uses check if they are
all in the same basic block and if so the last one is a killing use.
Enhance heuristic for copy-coalescing through hinting: We check the
first k defs of a register for COPYs rather than relying on there just
being a single definition.  When testing this on the full llvm
test-suite including SPEC externals I measured:

average 5.1% reduction in code size for X86, 4.9% reduction in code on
aarch64. (ranging between 0% and 20% depending on the test) 0.5%
faster compiletime (some analysis suggests the pass is slightly slower
than before, but we more than make up for it because later passes are
faster with the reduced instruction count)

Also adds a few testcases that were broken without this patch, in
particular bug 47278.

Patch mostly by Matthias Braun

3 years agoReapply "RegAllocFast: Record internal state based on register units"
Matt Arsenault [Tue, 15 Sep 2020 13:16:14 +0000 (09:16 -0400)]
Reapply "RegAllocFast: Record internal state based on register units"

The regressions this caused should be fixed when
https://reviews.llvm.org/D52010 is applied.

This reverts commit a21387c65470417c58021f8d3194a4510bb64f46.

3 years ago[CodeGen] emit CG profile for COFF object file
Zequan Wu [Thu, 17 Sep 2020 02:05:51 +0000 (19:05 -0700)]
[CodeGen] emit CG profile for COFF object file

I forgot to add emission of CG profile for COFF object file, when adding the support (https://reviews.llvm.org/D81775)

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

3 years ago[test][HWAsan] Fix kernel-inline.ll under NPM
Arthur Eubanks [Fri, 18 Sep 2020 17:55:28 +0000 (10:55 -0700)]
[test][HWAsan] Fix kernel-inline.ll under NPM

3 years agoDebugInfo: Tidy up initializing multi-section contributions in DWARFContext
David Blaikie [Fri, 18 Sep 2020 17:54:02 +0000 (10:54 -0700)]
DebugInfo: Tidy up initializing multi-section contributions in DWARFContext