platform/upstream/llvm.git
5 years ago[SelectionDAG] Legalize vaargs that require vector splitting
Simon Pilgrim [Tue, 18 Jun 2019 12:24:02 +0000 (12:24 +0000)]
[SelectionDAG] Legalize vaargs that require vector splitting

This adds vector splitting for vaarg instructions during type legalization

Committed on behalf of @luke (Luke Lau)

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

llvm-svn: 363671

5 years agoAMDGPU: Fold readlane from copy of SGPR or imm
Matt Arsenault [Tue, 18 Jun 2019 12:23:46 +0000 (12:23 +0000)]
AMDGPU: Fold readlane from copy of SGPR or imm

These may be inserted to assert uniformity somewhere.

llvm-svn: 363670

5 years agoAMDGPU: Remove unnecessary check for virtual register
Matt Arsenault [Tue, 18 Jun 2019 12:23:45 +0000 (12:23 +0000)]
AMDGPU: Remove unnecessary check for virtual register

The copy was found by searching the uses of a virtual register, so
it's already known to be virtual.

llvm-svn: 363669

5 years agoAMDGPU: Fix iterator crash in AMDGPUPromoteAlloca
Matt Arsenault [Tue, 18 Jun 2019 12:23:44 +0000 (12:23 +0000)]
AMDGPU: Fix iterator crash in AMDGPUPromoteAlloca

The lifetime intrinsic was erased, which was the next iterator.

llvm-svn: 363668

5 years agoAMDGPU/GlobalISel: RegBankSelect for amdgcn.div.scale
Matt Arsenault [Tue, 18 Jun 2019 12:23:42 +0000 (12:23 +0000)]
AMDGPU/GlobalISel: RegBankSelect for amdgcn.div.scale

llvm-svn: 363667

5 years ago[ARM] Some Thumb2ITBlock clean ups. NFC
Sjoerd Meijer [Tue, 18 Jun 2019 12:13:11 +0000 (12:13 +0000)]
[ARM] Some Thumb2ITBlock clean ups. NFC

Some more refactoring, like registering the IT Block pass, less cryptic
variable names, and some simplification of loops.

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

llvm-svn: 363666

5 years ago[SystemZ] Fix AHIMuxK pseudo expansion.
Jonas Paulsson [Tue, 18 Jun 2019 12:10:02 +0000 (12:10 +0000)]
[SystemZ]  Fix AHIMuxK pseudo expansion.

Do not emit a copy if the source and destination registers are the same.

Review: Ulrich Weigand
llvm-svn: 363665

5 years ago[clangd] Add a capability to enable completions with fixes.
Sam McCall [Tue, 18 Jun 2019 11:57:26 +0000 (11:57 +0000)]
[clangd] Add a capability to enable completions with fixes.

Reviewers: ilya-biryukov

Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits

Tags: #clang

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

llvm-svn: 363664

5 years ago[clangd] Parse files without extensions if we don't have a compile command.
Haojian Wu [Tue, 18 Jun 2019 11:54:17 +0000 (11:54 +0000)]
[clangd] Parse files without extensions if we don't have a compile command.

Summary: This would enable clangd for C++ standard library files.

Reviewers: sammccall

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits

Tags: #clang

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

llvm-svn: 363663

5 years ago[clangd] Detect C++ language based on well-known file path in vscode extension
Haojian Wu [Tue, 18 Jun 2019 11:53:14 +0000 (11:53 +0000)]
[clangd] Detect C++ language based on well-known file path in vscode extension

Summary:
Matching the "C++" pattern on the first line of the file doesn't cover
all cases, MSVC C++ headers doesn't have such pattern. This patch
introduce a new heuristic to detect language based on the file path.

MSVC C++ standard headers are in the directory like
"c:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.15.26726\include"

Reviewers: sammccall

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits

Tags: #clang

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

llvm-svn: 363662

5 years ago[AMDGPU] Speed up live-in virtual register set computaion in GCNScheduleDAGMILive.
Valery Pykhtin [Tue, 18 Jun 2019 11:43:17 +0000 (11:43 +0000)]
[AMDGPU] Speed up live-in virtual register set computaion in GCNScheduleDAGMILive.

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

llvm-svn: 363661

5 years ago[SVE][IR] Scalable Vector IR Type with pr42210 fix
Graham Hunter [Tue, 18 Jun 2019 10:11:56 +0000 (10:11 +0000)]
[SVE][IR] Scalable Vector IR Type with pr42210 fix

Recommit of D32530 with a few small changes:
  - Stopped recursively walking through aggregates in
    the verifier, so that we don't impose too much
    overhead on large modules under LTO (see PR42210).
  - Changed tests to match; the errors are slightly
    different since they only report the array or
    struct that actually contains a scalable vector,
    rather than all aggregates which contain one in
    a nested member.
  - Corrected an older comment

Reviewers: thakis, rengolin, sdesmalen

Reviewed By: sdesmalen

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

llvm-svn: 363658

5 years ago[X86] Regenerate promote.ll. NFC.
Simon Pilgrim [Tue, 18 Jun 2019 10:10:53 +0000 (10:10 +0000)]
[X86] Regenerate promote.ll. NFC.

llvm-svn: 363657

5 years ago[NFC] Improve triple match of scripts that update tests
Diogo N. Sampaio [Tue, 18 Jun 2019 10:04:36 +0000 (10:04 +0000)]
[NFC] Improve triple match of scripts that update tests

Summary:
The prior behavior of the triple matcher would stop
in the first matched triple. It was not possible to
create specific matches for sub-sets of a triple
(e.g aarch64-apple-darwin would never be used after
aarch64 was matched).

This patch:
1) Allows that specialized triples take priority,
considering that the string lenght of the triple
indentifies how specialized a triple is. If two
triples of same lenght match, the one matched first
prevails, preserving the old behavior.

2) Remove 20 duplicated triples of arm, thumb,
aarch64 options with same arguments, matching
the common prefix (aarch64, arm, thumb) of them.

3) Creates three new function matching regexes and
five triple options for arm64-apple-ios,
(arm|thumb)-apple-ios and thumb(v5)?-macho

Reviewers: lebedev.ri, RKSimon, MaskRay, gbedwell

Reviewed By: MaskRay

Subscribers: javed.absar, kristof.beyls, llvm-commits, carwil

Tags: #llvm

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

llvm-svn: 363656

5 years ago[X86] Replace any_extend* vector extensions with zero_extend* equivalents
Simon Pilgrim [Tue, 18 Jun 2019 09:50:13 +0000 (09:50 +0000)]
[X86] Replace any_extend* vector extensions with zero_extend* equivalents

First step toward addressing the vector-reduce-mul-widen.ll regression in D63281 - we should replace ANY_EXTEND/ANY_EXTEND_VECTOR_INREG in X86ISelDAGToDAG to avoid having to add duplicate patterns when treating any extensions as legal.

In future patches this will also allow us to keep any extension nodes around a lot longer in the DAG, which should mean that we can keep better track of undef elements that otherwise become zeros that we think we have to keep......

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

llvm-svn: 363655

5 years ago[DebugInfo][Docs] Document that prologue/epilogue variable location changes are ignored
Jeremy Morse [Tue, 18 Jun 2019 08:52:38 +0000 (08:52 +0000)]
[DebugInfo][Docs] Document that prologue/epilogue variable location changes are ignored

This patch documents that LLVM does not describe all changes in variable
locations during the prologue and the epilogue. The debugger doesn't /
shouldn't step through that portion of the function anyway, and describing
every location through such stages would bloat location lists.

Perform some minor cleanup at the same time,
 * Fix an enumerated list
 * Document that dbg.declare intrinsics have their variable location recorded
   in a MachineFunction table, not with DBG_VALUE meta-insts
 * Adds frame-indexes to the list of things that can be operands to
   DBG_VALUEs.

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

llvm-svn: 363654

5 years agoFix windows build for r363357
Pavel Labath [Tue, 18 Jun 2019 07:02:53 +0000 (07:02 +0000)]
Fix windows build for r363357

MSVC has trouble referencing the protected Compare class from from the
friend Entry operator<. Just delete that operator, as it's used only
once.

llvm-svn: 363653

5 years ago[SimplifyCFG] NFC, prof branch_weighs handling is simplified
Yevgeny Rouban [Tue, 18 Jun 2019 06:50:52 +0000 (06:50 +0000)]
[SimplifyCFG] NFC, prof branch_weighs handling is simplified

Using the new SwitchInstProfUpdateWrapper this patch
simplifies 3 places of prof branch_weights handling.

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

llvm-svn: 363652

5 years agoFix compiler warning by removing unused variable
Mikael Holmen [Tue, 18 Jun 2019 06:41:56 +0000 (06:41 +0000)]
Fix compiler warning by removing unused variable

llvm-svn: 363651

5 years ago[llvm-objdump] Tidy up AMDGCNPrettyPrinter
Fangrui Song [Tue, 18 Jun 2019 06:35:18 +0000 (06:35 +0000)]
[llvm-objdump] Tidy up AMDGCNPrettyPrinter

llvm-svn: 363650

5 years agoRevert D60974 "[clang-ifs] Clang Interface Stubs, first version."
Fangrui Song [Tue, 18 Jun 2019 05:52:39 +0000 (05:52 +0000)]
Revert D60974 "[clang-ifs] Clang Interface Stubs, first version."

This reverts commit rC363626.

clangIndex depends on clangFrontend. r363626 adds a dependency from
clangFrontend to clangIndex, which creates a circular dependency.

This is disallowed by -DBUILD_SHARED_LIBS=on builds:

    CMake Error: The inter-target dependency graph contains the following strongly connected component (cycle):
      "clangFrontend" of type SHARED_LIBRARY
        depends on "clangIndex" (weak)
      "clangIndex" of type SHARED_LIBRARY
        depends on "clangFrontend" (weak)
    At least one of these targets is not a STATIC_LIBRARY.  Cyclic dependencies are allowed only among static libraries.

Note, the dependency on clangIndex cannot be removed because
libclangFrontend.so is linked with -Wl,-z,defs: a shared object must
have its full direct dependencies specified on the linker command line.

In -DBUILD_SHARED_LIBS=off builds, this appears to work when linking
`bin/clang-9`. However, it can cause trouble to downstream clang library
users. The llvm build system links libraries this way:

    clang main_program_object_file ... lib/libclangIndex.a ...  lib/libclangFrontend.a -o exe

libclangIndex.a etc are not wrapped in --start-group.

If the downstream application depends on libclangFrontend.a but not any
other clang libraries that depend on libclangIndex.a, this can cause undefined
reference errors when the linker is ld.bfd or gold.

The proper fix is to not include clangIndex files in clangFrontend.

llvm-svn: 363649

5 years ago[NFC] Undoing r363646 to fix bots.
Puyan Lotfi [Tue, 18 Jun 2019 05:15:59 +0000 (05:15 +0000)]
[NFC] Undoing r363646 to fix bots.

-DBUILD_SHARED_LIBS=ON is still having problem caused by layering issues with
D60974. Locally there weren't problems building with shared libs on or off but
the bots appear to be acting up.

llvm-svn: 363648

5 years ago[X86] Add i128 ctpop and i32/i64/i128 optsize test cases to popcnt.ll
Craig Topper [Tue, 18 Jun 2019 04:52:49 +0000 (04:52 +0000)]
[X86] Add i128 ctpop and i32/i64/i128 optsize test cases to popcnt.ll

Test cases for PR41151 and D59909.

llvm-svn: 363647

5 years ago[NFC] Fixing -DBUILD_SHARED_LIBS=ON problem caused by layering issue in D60974
Puyan Lotfi [Tue, 18 Jun 2019 04:40:03 +0000 (04:40 +0000)]
[NFC] Fixing -DBUILD_SHARED_LIBS=ON problem caused by layering issue in  D60974

llvm-svn: 363646

5 years ago[X86] Move code that shrinks immediates for ((x << C1) op C2) into a helper function...
Craig Topper [Tue, 18 Jun 2019 04:23:58 +0000 (04:23 +0000)]
[X86] Move code that shrinks immediates for ((x << C1) op C2) into a helper function. NFCI

Preliminary step for D59909

llvm-svn: 363645

5 years ago[X86] Remove MOVDI2SSrm/MOV64toSDrm/MOVSS2DImr/MOVSDto64mr CodeGenOnly instructions.
Craig Topper [Tue, 18 Jun 2019 03:23:15 +0000 (03:23 +0000)]
[X86] Remove MOVDI2SSrm/MOV64toSDrm/MOVSS2DImr/MOVSDto64mr CodeGenOnly instructions.

The isel patterns for these use a bitcast and load/store, but
DAG combine should have canonicalized those away.

For the purposes of the memory folding table these opcodes can be
replaced by the MOVSSrm_alt/MOVSDrm_alt and MOVSSmr/MOVSDmr opcodes.

llvm-svn: 363644

5 years ago[X86] Introduce new MOVSSrm/MOVSDrm opcodes that use VR128 register class.
Craig Topper [Tue, 18 Jun 2019 03:23:11 +0000 (03:23 +0000)]
[X86] Introduce new MOVSSrm/MOVSDrm opcodes that use VR128 register class.

Rename the old versions that use FR32/FR64 to MOVSSrm_alt/MOVSDrm_alt.

Use the new versions in patterns that previously used a COPY_TO_REGCLASS
to VR128. These patterns expect the upper bits to be zero. The
current set up appears to work, but I'm not sure we should be
enforcing upper bits being zero through a COPY_TO_REGCLASS.

I wanted to flip the arrangement and use a COPY_TO_REGCLASS to
FR32/FR64 for the patterns that need an f32/f64 result, but that
complicated fastisel and globalisel.

I've been doing some experiments with reducing some isel patterns
and ended up in a situation where I had a
(SUBREG_TO_REG (COPY_TO_RECLASS (VMOVSSrm), VR128)) and our
post-isel peephole was unable to avoid using an instruction for
the SUBREG_TO_REG due to the COPY_TO_REGCLASS. Having a VR128
instruction removes the COPY_TO_REGCLASS that was breaking this.

llvm-svn: 363643

5 years agoGlobalISel: Remove redundant pass initialization
Tom Stellard [Tue, 18 Jun 2019 02:05:06 +0000 (02:05 +0000)]
GlobalISel: Remove redundant pass initialization

Summary:
All the GlobalISel passes are initialized when the target calls
initializeGlobalISel(), so we don't need to call the initializers
from the pass constructors.

Reviewers: qcolombet, t.p.northover, paquette, dsanders, aemerson, aditya_nandakumar

Reviewed By: aemerson

Subscribers: rovka, kristof.beyls, hiraditya, volkan, Petar.Avramovic, llvm-commits

Tags: #llvm

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

llvm-svn: 363642

5 years agoDisable recently added Darwin symbolization tests for iOS.
Dan Liew [Tue, 18 Jun 2019 01:38:03 +0000 (01:38 +0000)]
Disable recently added Darwin symbolization tests for iOS.

These tests won't necessarily work because the reported modules paths
from the device don't match what's on the host and so offline
symbolization fails.

llvm-svn: 363641

5 years ago[NFC] Split `Darwin/asan-symbolize-partial-report-with-module-map.cc`.
Dan Liew [Tue, 18 Jun 2019 01:38:02 +0000 (01:38 +0000)]
[NFC] Split `Darwin/asan-symbolize-partial-report-with-module-map.cc`.

Split `Darwin/asan-symbolize-partial-report-with-module-map.cc` into two
separate test cases due to them testing slightly different things.

llvm-svn: 363640

5 years ago[asan_symbolize] Teach `asan_symbolize.py` to symbolicate partially symbolicated...
Dan Liew [Tue, 18 Jun 2019 01:21:16 +0000 (01:21 +0000)]
[asan_symbolize] Teach `asan_symbolize.py` to symbolicate partially symbolicated ASan reports.

Summary:
The use case here is to be able symbolicate ASan reports that might be
partially symbolicated, in particular where the function name is known but no source
location is available. This can be caused by missing debug info. Previously we
would only try to symbolicate completely unsymbolicated reports.

The code currently contains an unfortunate quirk to handle a darwin
specific bug (rdar://problem/49784442) in the way partially symbolicated
reports are emitted when the source location is missing.

rdar://problem/49476995

Reviewers: kubamracek, yln, samsonov, dvyukov, vitalybuka

Subscribers: aprantl, #sanitizers, llvm-commits

Tags: #llvm, #sanitizers

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

llvm-svn: 363639

5 years ago[llvm-strip] Error when using stdin twice
Alex Brachet [Tue, 18 Jun 2019 00:39:10 +0000 (00:39 +0000)]
[llvm-strip] Error when using stdin twice

Summary: Implements bug [[ https://bugs.llvm.org/show_bug.cgi?id=42204 | 42204 ]]. llvm-strip now warns when the same input file is used more than once, and errors when stdin is used more than once.

Reviewers: jhenderson, rupprecht, espindola, alexshap

Reviewed By: jhenderson, rupprecht

Subscribers: emaste, arichardson, jakehehrlich, MaskRay, llvm-commits

Tags: #llvm

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

llvm-svn: 363638

5 years agoGlobalISel: Use the original flags when lowering fneg to fsub
Matt Arsenault [Mon, 17 Jun 2019 23:48:43 +0000 (23:48 +0000)]
GlobalISel: Use the original flags when lowering fneg to fsub

This was ignoring the flag on fneg, and using the source instruction's
flags. Also fixes tests missing from r358702.

Note the expansion itself isn't correct without nnan, but that should
be fixed separately.

llvm-svn: 363637

5 years agohwasan: Use bits [3..11) of the ring buffer entry address as the base stack tag.
Peter Collingbourne [Mon, 17 Jun 2019 23:39:51 +0000 (23:39 +0000)]
hwasan: Use bits [3..11) of the ring buffer entry address as the base stack tag.

This saves roughly 32 bytes of instructions per function with stack objects
and causes us to preserve enough information that we can recover the original
tags of all stack variables.

Now that stack tags are deterministic, we no longer need to pass
-hwasan-generate-tags-with-calls during check-hwasan. This also means that
the new stack tag generation mechanism is exercised by check-hwasan.

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

llvm-svn: 363636

5 years agohwasan: Add a tag_offset DWARF attribute to instrumented stack variables.
Peter Collingbourne [Mon, 17 Jun 2019 23:39:41 +0000 (23:39 +0000)]
hwasan: Add a tag_offset DWARF attribute to instrumented stack variables.

The goal is to improve hwasan's error reporting for stack use-after-return by
recording enough information to allow the specific variable that was accessed
to be identified based on the pointer's tag. Currently we record the PC and
lower bits of SP for each stack frame we create (which will eventually be
enough to derive the base tag used by the stack frame) but that's not enough
to determine the specific tag for each variable, which is the stack frame's
base tag XOR a value (the "tag offset") that is unique for each variable in
a function.

In IR, the tag offset is most naturally represented as part of a location
expression on the llvm.dbg.declare instruction. However, the presence of the
tag offset in the variable's actual location expression is likely to confuse
debuggers which won't know about tag offsets, and moreover the tag offset
is not required for a debugger to determine the location of the variable on
the stack, so at the DWARF level it is represented as an attribute so that
it will be ignored by debuggers that don't know about it.

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

llvm-svn: 363635

5 years agogn build: Merge r363626.
Peter Collingbourne [Mon, 17 Jun 2019 23:39:31 +0000 (23:39 +0000)]
gn build: Merge r363626.

llvm-svn: 363634

5 years ago[CMake] Fix the value of `config.target_cflags` for non-macOS Apple platforms. Attemp...
Dan Liew [Mon, 17 Jun 2019 23:37:46 +0000 (23:37 +0000)]
[CMake] Fix the value of `config.target_cflags` for non-macOS Apple platforms. Attempt #2.

Summary:
The main problem here is that `-*-version_min=` was not being passed to
the compiler when building test cases. This can cause problems when
testing on devices running older OSs because Clang would previously
assume the minimum deployment target is the the latest OS in the SDK
which could be much newer than what the device is running.

Previously the generated value looked like this:

`-arch arm64 -isysroot
<path_to_xcode>/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.1.sdk`

With this change it now looks like:

`-arch arm64 -stdlib=libc++ -miphoneos-version-min=8.0 -isysroot
<path_to_xcode>/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.1.sdk`

This mirrors the setting of `config.target_cflags` on macOS.

This change is made for ASan, LibFuzzer, TSan, and UBSan.

To implement this a new `get_test_cflags_for_apple_platform()` function
has been added that when given an Apple platform name and architecture
returns a string containing the C compiler flags to use when building
tests. This also calls a new helper function `is_valid_apple_platform()`
that validates Apple platform names.

This is the second attempt at landing the patch. The first attempt (r359305)
had to be reverted (r359327) due to a buildbot failure. The problem was
that calling `get_test_cflags_for_apple_platform()` can trigger a CMake
error if the provided architecture is not supported by the current
CMake configuration. Previously, this could be triggered by passing
`-DCOMPILER_RT_ENABLE_IOS=OFF` to CMake. The root cause is that we were
generating test configurations for a list of architectures without
checking if the relevant Sanitizer actually supported that architecture.
We now intersect the list of architectures for an Apple platform
with `<SANITIZER>_SUPPORTED_ARCH` (where `<SANITIZER>` is a Sanitizer
name) to iterate through the correct list of architectures.

rdar://problem/50124489

Reviewers: kubamracek, yln, vsk, juliehockett, phosek

Subscribers: mgorny, javed.absar, kristof.beyls, #sanitizers, llvm-commits

Tags: #llvm, #sanitizers

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

llvm-svn: 363633

5 years ago[GlobalISel][Localizer] Rewrite localizer to run in 2 phases, inter & intra block.
Amara Emerson [Mon, 17 Jun 2019 23:20:29 +0000 (23:20 +0000)]
[GlobalISel][Localizer] Rewrite localizer to run in 2 phases, inter & intra block.

Inter-block localization is the same as what currently happens, except now it
only runs on the entry block because that's where the problematic constants with
long live ranges come from.

The second phase is a new intra-block localization phase which attempts to
re-sink the already localized instructions further right before one of the
multiple uses.

One additional change is to also localize G_GLOBAL_VALUE as they're constants
too. However, on some targets like arm64 it takes multiple instructions to
materialize the value, so some additional heuristics with a TTI hook have been
introduced attempt to prevent code size regressions when localizing these.

Overall, these changes improve CTMark code size on arm64 by 1.2%.

Full code size results:

Program                                         baseline       new       diff
------------------------------------------------------------------------------
 test-suite...-typeset/consumer-typeset.test    1249984      1217216     -2.6%
 test-suite...:: CTMark/ClamAV/clamscan.test    1264928      1232152     -2.6%
 test-suite :: CTMark/SPASS/SPASS.test          1394092      1361316     -2.4%
 test-suite...Mark/mafft/pairlocalalign.test    731320       714928      -2.2%
 test-suite :: CTMark/lencod/lencod.test        1340592      1324200     -1.2%
 test-suite :: CTMark/kimwitu++/kc.test         3853512      3820420     -0.9%
 test-suite :: CTMark/Bullet/bullet.test        3406036      3389652     -0.5%
 test-suite...ark/tramp3d-v4/tramp3d-v4.test    8017000      8016992     -0.0%
 test-suite...TMark/7zip/7zip-benchmark.test    2856588      2856588      0.0%
 test-suite...:: CTMark/sqlite3/sqlite3.test    765704       765704       0.0%
 Geomean difference                                                      -1.2%

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

llvm-svn: 363632

5 years agoPropagate fmf in IRTranslate for fneg
Michael Berg [Mon, 17 Jun 2019 23:19:40 +0000 (23:19 +0000)]
Propagate fmf in IRTranslate for fneg

Summary: This case is related to D63405 in that we need to be propagating FMF on negates.

Reviewers: volkan, spatel, arsenm

Reviewed By: arsenm

Subscribers: wdng, javed.absar

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

llvm-svn: 363631

5 years agoUse VR128X instead of FR32X/FR64X for the register class in VMOVSSZmrk/VMOVSDZmrk.
Craig Topper [Mon, 17 Jun 2019 23:08:29 +0000 (23:08 +0000)]
Use VR128X instead of FR32X/FR64X for the register class in VMOVSSZmrk/VMOVSDZmrk.

Removes COPY_TO_REGCLASS from some patterns.

llvm-svn: 363630

5 years ago[X86] Make an assert in LowerSCALAR_TO_VECTOR stricter to make it clear what types...
Craig Topper [Mon, 17 Jun 2019 23:08:09 +0000 (23:08 +0000)]
[X86] Make an assert in LowerSCALAR_TO_VECTOR stricter to make it clear what types are allowed here. NFC

Make it clear that only integer type with i32 or smaller elements shoudl get to this part of the code.

llvm-svn: 363629

5 years ago[Remarks][Driver] Use the specified format in the remarks file extension
Francis Visoiu Mistrih [Mon, 17 Jun 2019 22:49:38 +0000 (22:49 +0000)]
[Remarks][Driver] Use the specified format in the remarks file extension

By default, use `.opt.yaml`, but when a format is specified with
`-fsave-optimization-record=<format>`, use `.opt.<format>`.

llvm-svn: 363627

5 years ago[clang-ifs] Clang Interface Stubs, first version.
Puyan Lotfi [Mon, 17 Jun 2019 22:46:54 +0000 (22:46 +0000)]
[clang-ifs] Clang Interface Stubs, first version.

Clang interface stubs (previously referred to as clang-ifsos) is a new frontend
action in clang that allows the generation of stub files that contain mangled
name info that can be used to produce a stub library. These stub libraries can
be useful for breaking up build dependencies and controlling access to a
library's internal symbols. Generation of these stubs can be invoked by:

clang -fvisibility=<visibility> -emit-interface-stubs \
                                -interface-stub-version=<interface format>

Notice that -fvisibility (along with use of visibility attributes) can be used
to control what symbols get generated. Currently the interface format is
experimental but there are a wide range of possibilities here.

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

llvm-svn: 363626

5 years ago[AMDGPU] Use custom inserter for gfx10 VOP2b
Stanislav Mekhanoshin [Mon, 17 Jun 2019 22:37:37 +0000 (22:37 +0000)]
[AMDGPU] Use custom inserter for gfx10 VOP2b

This is part of the approved D63204 pending parent revision.
This small change is in fact a part of the VOP2b legalization which
does not technically belong to wave32 support, so extracted
separately.

llvm-svn: 363625

5 years ago[GWP-ASan] Disable GWP-ASan on Android for now.
Mitch Phillips [Mon, 17 Jun 2019 22:35:32 +0000 (22:35 +0000)]
[GWP-ASan] Disable GWP-ASan on Android for now.

Summary:
Temporarily disable GWP-ASan for android until the bugs at:
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-android/builds/87
... can be fixed. See comments for the full bug trace.

Reviewers: eugenis

Reviewed By: eugenis

Subscribers: srhines, kubamracek, mgorny, cryptoad, jfb, #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

llvm-svn: 363624

5 years ago[AMDGPU] gfx1010 subvector test. NFC.
Stanislav Mekhanoshin [Mon, 17 Jun 2019 21:55:06 +0000 (21:55 +0000)]
[AMDGPU] gfx1010 subvector test. NFC.

llvm-svn: 363623

5 years agoFix crash when checking a dependently-typed reference that is
Richard Smith [Mon, 17 Jun 2019 21:46:17 +0000 (21:46 +0000)]
Fix crash when checking a dependently-typed reference that is
initialized from a non-value-dependent initializer.

llvm-svn: 363622

5 years ago[test][AArch64] Relax the check line for G_BRJT in legalizer-info-validation.mir
Volkan Keles [Mon, 17 Jun 2019 21:25:25 +0000 (21:25 +0000)]
[test][AArch64] Relax the check line for G_BRJT in legalizer-info-validation.mir

Replace the specific number with a pattern to relax the test.

llvm-svn: 363621

5 years agoRewrite ConstStructBuilder with a mechanism that can cope with splitting and updating...
Richard Smith [Mon, 17 Jun 2019 21:08:30 +0000 (21:08 +0000)]
Rewrite ConstStructBuilder with a mechanism that can cope with splitting and updating constants.

Summary:
This adds a ConstantBuilder class that deals with incrementally building
an aggregate constant, including support for overwriting
previously-emitted parts of the aggregate with new values.

This fixes a bunch of cases where we used to be unable to reduce a
DesignatedInitUpdateExpr down to an IR constant, and also lays some
groundwork for emission of class constants with [[no_unique_address]]
members.

Reviewers: rjmccall

Subscribers: cfe-commits

Tags: #clang

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

llvm-svn: 363620

5 years agoTeach getSCEVAtScope how to handle loop phis w/invariant operands in loops w/taken...
Philip Reames [Mon, 17 Jun 2019 21:06:17 +0000 (21:06 +0000)]
Teach getSCEVAtScope how to handle loop phis w/invariant operands in loops w/taken backedges

This patch really contains two pieces:
    Teach SCEV how to fold a phi in the header of a loop to the value on the backedge when a) the backedge is known to execute at least once, and b) the value is safe to use globally within the scope dominated by the original phi.
    Teach IndVarSimplify's rewriteLoopExitValues to allow loop invariant expressions which already exist (and thus don't need new computation inserted) even in loops where we can't optimize away other uses.

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

llvm-svn: 363619

5 years agoAdd convenience utility for replacing a range within a container with a
Richard Smith [Mon, 17 Jun 2019 21:01:09 +0000 (21:01 +0000)]
Add convenience utility for replacing a range within a container with a
different range, in preparation for use in Clang.

llvm-svn: 363617

5 years ago[globalisel] Fix iterator invalidation in the extload combines
Daniel Sanders [Mon, 17 Jun 2019 20:56:31 +0000 (20:56 +0000)]
[globalisel] Fix iterator invalidation in the extload combines

Summary:
Change the way we deal with iterator invalidation in the extload combines as it
was still possible to neglect to visit a use. Even worse, it happened in the
in-tree test cases and the checks weren't good enough to detect it.

We now take a cheap copy of the use list before iterating over it. This
prevents iterator invalidation from occurring and has the nice side effect
of making the existing schedule-for-erase/schedule-for-insert mechanism
moot.

Reviewers: aditya_nandakumar

Reviewed By: aditya_nandakumar

Subscribers: rovka, kristof.beyls, javed.absar, volkan, Petar.Avramovic, llvm-commits

Tags: #llvm

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

llvm-svn: 363616

5 years agoStop counting pops in tsan/check_analyze.sh.
Evgeniy Stepanov [Mon, 17 Jun 2019 20:47:16 +0000 (20:47 +0000)]
Stop counting pops in tsan/check_analyze.sh.

Summary:
It looks like LLVM has started doing less tail duplication in this code,
or something like that, resulting in a significantly smaller number of
pop instructions (16 -> 12). Removing the check.

Reviewers: vitalybuka, dvyukov

Subscribers: kubamracek, #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

llvm-svn: 363615

5 years ago[AMDGPU] Propagate function attributes thru bitcasts
Stanislav Mekhanoshin [Mon, 17 Jun 2019 20:42:48 +0000 (20:42 +0000)]
[AMDGPU] Propagate function attributes thru bitcasts

AMDGPUPropagateAttributes will not work on function bitcatsts,
so move AMDGPUFixFunctionBitcasts before it.

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

llvm-svn: 363614

5 years agoFix a bug w/inbounds invalidation in LFTR (recommit)
Philip Reames [Mon, 17 Jun 2019 20:32:22 +0000 (20:32 +0000)]
Fix a bug w/inbounds invalidation in LFTR (recommit)

Recommit r363289 with a bug fix for crash identified in pr42279.  Issue was that a loop exit test does not have to be an icmp, leading to a null dereference crash when new logic was exercised for that case.  Test case previously committed in r363601.

Original commit comment follows:

This contains fixes for two cases where we might invalidate inbounds and leave it stale in the IR (a miscompile). Case 1 is when switching to an IV with no dynamically live uses, and case 2 is when doing pre-to-post conversion on the same pointer type IV.

The basic scheme used is to prove that using the given IV (pre or post increment forms) would have to already trigger UB on the path to the test we're modifying. As such, our potential UB triggering use does not change the semantics of the original program.

As was pointed out in the review thread by Nikita, this is defending against a separate issue from the hasConcreteDef case. This is about poison, that's about undef. Unfortunately, the two are different, see Nikita's comment for a fuller explanation, he explains it well.

(Note: I'm going to address Nikita's last style comment in a separate commit just to minimize chance of subtle bugs being introduced due to typos.)

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

llvm-svn: 363613

5 years agoClang :: Sema/wchar.c has long been failing on Solaris:
Rainer Orth [Mon, 17 Jun 2019 20:21:25 +0000 (20:21 +0000)]
Clang :: Sema/wchar.c has long been failing on Solaris:

  error: 'error' diagnostics expected but not seen:
    File /vol/llvm/src/clang/local/test/Sema/wchar.c Line 22: initializing wide char array with non-wide string literal
  error: 'error' diagnostics seen but not expected:
    File /vol/llvm/src/clang/local/test/Sema/wchar.c Line 20: array initializer must be an initializer list
    File /vol/llvm/src/clang/local/test/Sema/wchar.c Line 22: array initializer must be an initializer list

It turns out the definition is wrong, as can be seen in GCC's gcc/config/sol2.h:

  /* wchar_t is called differently in <wchar.h> for 32 and 64-bit
     compilations.  This is called for by SCD 2.4.1, p. 6-83, Figure 6-65
     (32-bit) and p. 6P-10, Figure 6.38 (64-bit).  */

  #undef WCHAR_TYPE
  #define WCHAR_TYPE (TARGET_64BIT ? "int" : "long int")

The following patch implements this, and at the same time corrects the wint_t
definition which is the same:

  /* Same for wint_t.  See SCD 2.4.1, p. 6-83, Figure 6-66 (32-bit).  There's
     no corresponding 64-bit definition, but this is what Solaris 8
     <iso/wchar_iso.h> uses.  */

  #undef WINT_TYPE
  #define WINT_TYPE (TARGET_64BIT ? "int" : "long int")

Clang :: Preprocessor/wchar_t.c and Clang :: Sema/format-strings.c need to
be adjusted to account for that.

Tested on i386-pc-solaris2.11, x86_64-pc-solaris2.11, and x86_64-pc-linux-gnu.

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

llvm-svn: 363612

5 years agollgdb.py: Make sure to clean up the debugger on exit.
Adrian Prantl [Mon, 17 Jun 2019 20:06:34 +0000 (20:06 +0000)]
llgdb.py: Make sure to clean up the debugger on exit.

<rdar://problem/51807962>

llvm-svn: 363611

5 years agogn build: Merge r363483.
Peter Collingbourne [Mon, 17 Jun 2019 20:03:11 +0000 (20:03 +0000)]
gn build: Merge r363483.

llvm-svn: 363610

5 years agogn build: Merge r363584.
Peter Collingbourne [Mon, 17 Jun 2019 19:59:16 +0000 (19:59 +0000)]
gn build: Merge r363584.

llvm-svn: 363609

5 years agoAdd color to the default thread and frame format.
Jonas Devlieghere [Mon, 17 Jun 2019 19:53:11 +0000 (19:53 +0000)]
Add color to the default thread and frame format.

Now that we correctly ignore ASCII escape sequences when colors are
disabled (r362240), I'd like to change the default frame and thread
format to include color in their output, in line with the syntax
highlighting that Raphael added a while ago.

This patch adds highlighting for the stop reason, the file, line and
column number. With colors disabled, this of course is a no-op.

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

llvm-svn: 363608

5 years agoPR42205: DebugInfio: Do not attempt to emit debug info metadata for static member...
David Blaikie [Mon, 17 Jun 2019 19:40:52 +0000 (19:40 +0000)]
PR42205: DebugInfio: Do not attempt to emit debug info metadata for static member variable template partial specializations

Would cause a crash in an attempt to create the type for the still
unresolved 'auto' in the partial specialization (& even without the use
of 'auto', the expression would be value dependent &
crash/assertion-fail there).

llvm-svn: 363606

5 years ago[NFC] Assign a couple of LWG issues to myself
Louis Dionne [Mon, 17 Jun 2019 19:40:09 +0000 (19:40 +0000)]
[NFC] Assign a couple of LWG issues to myself

llvm-svn: 363605

5 years agoAttempt to fix GWP-ASan build failure on sanitizer-android. Add -fPIC.
Mitch Phillips [Mon, 17 Jun 2019 19:39:29 +0000 (19:39 +0000)]
Attempt to fix GWP-ASan build failure on sanitizer-android. Add -fPIC.

llvm-svn: 363604

5 years ago[libc++] Update ABI list for ABI v2
Louis Dionne [Mon, 17 Jun 2019 19:37:26 +0000 (19:37 +0000)]
[libc++] Update ABI list for ABI v2

I forgot to add symbols for filesystem.

llvm-svn: 363603

5 years agoAMDGPU/GFX10: Don't generate s_code_end padding in the asm-printer
Nicolai Haehnle [Mon, 17 Jun 2019 19:28:43 +0000 (19:28 +0000)]
AMDGPU/GFX10: Don't generate s_code_end padding in the asm-printer

Summary:
The purpose of the padding is to guard against stale code being
fetched into the instruction cache by the lowest level prefetching.
We're generating relocatable ELF here, and so the padding should
arguably be added by the linker. This is in fact what Mesa does.

This also fixes multi-part shaders for Mesa.

Change-Id: I6bfede58f20e9f337762ccf39ef9e0e263e69e82

Reviewers: arsenm, rampitec, t-tye

Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, llvm-commits

Tags: #llvm

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

llvm-svn: 363602

5 years agoReduced test case for pr42279 in advance of the relevant re-commit + fix
Philip Reames [Mon, 17 Jun 2019 19:27:45 +0000 (19:27 +0000)]
Reduced test case for pr42279 in advance of the relevant re-commit + fix

llvm-svn: 363601

5 years agoAMDGPU: Explicitly define a triple for some tests
Nicolai Haehnle [Mon, 17 Jun 2019 19:25:57 +0000 (19:25 +0000)]
AMDGPU: Explicitly define a triple for some tests

Summary:
This is related to the changes to the groupstaticsize intrinsic in
D61494 which would otherwise make the related tests in these files
fail or much less useful.

Note that for some reason, SOPK generation is less effective in the
amdhsa OS, which is why I chose PAL. I haven't investigated this
deeper.

Change-Id: I6bb99569338f7a433c28b4c9eb1e3e036b00d166

Reviewers: arsenm

Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, llvm-commits

Tags: #llvm

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

llvm-svn: 363600

5 years ago[test] Add wrap flags after D61934.
Michael Kruse [Mon, 17 Jun 2019 19:17:07 +0000 (19:17 +0000)]
[test] Add wrap flags after D61934.

https://reviews.llvm.org/D61934, committed as r362687, r363540, r363364
and r363147, made some emitted instruction nus/nsw. Add these falgs to
Polly's regression tests.

This should fix
    Polly :: Isl/CodeGen/partial_write_in_region_with_loop.ll
    Polly :: Isl/CodeGen/scev_expansion_in_nonaffine.ll

llvm-svn: 363599

5 years ago[EarlyCSE] Fix hashing of self-compares
Joseph Tremoulet [Mon, 17 Jun 2019 19:11:28 +0000 (19:11 +0000)]
[EarlyCSE] Fix hashing of self-compares

Summary:
Update compare normalization in SimpleValue hashing to break ties (when
the same value is being compared to itself) by switching to the swapped
predicate if it has a lower numerical value.  This brings the hashing in
line with isEqual, which already recognizes the self-compares with
swapped predicates as equal.

Fixes PR 42280.

Reviewers: spatel, efriedma, nikic, fhahn, uabelho

Reviewed By: nikic

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 363598

5 years ago[MemorySSA] Don't use template when the clone is a simplified instruction.
Alina Sbirlea [Mon, 17 Jun 2019 18:58:40 +0000 (18:58 +0000)]
[MemorySSA] Don't use template when the clone is a simplified instruction.

Summary:
LoopRotate doesn't create a faithful clone of an instruction, it may
simplify it beforehand. Hence the clone of an instruction that has a
MemoryDef associated may not be a definition, but a use or not a memory
alternig instruction.
Don't rely on the template when the clone may be simplified.

Reviewers: george.burgess.iv

Subscribers: jlebar, Prazek, llvm-commits

Tags: #llvm

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

llvm-svn: 363597

5 years ago[GlobalISel][AArch64] Fold G_SUB into G_ICMP when it's safe to do so
Jessica Paquette [Mon, 17 Jun 2019 18:40:06 +0000 (18:40 +0000)]
[GlobalISel][AArch64] Fold G_SUB into G_ICMP when it's safe to do so

Basically porting over the behaviour in AArch64ISelLowering to GISel. See
emitComparison for reference.

When we have something like this:

```
  lhs = G_SUB 0, y
  ...
  G_ICMP lhs, rhs
```

We can fold away the G_SUB and produce a cmn instead, given that we produce
the same value in NZCV.

Add a test showing that the transformation works, and also showing that we
don't perform the transformation when it's unsafe.

Also factor out the CSet emission into emitCSetForICMP.

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

llvm-svn: 363596

5 years ago[X86] Add TB_NO_REVERSE to some memory folding table entries where the register form...
Craig Topper [Mon, 17 Jun 2019 18:38:07 +0000 (18:38 +0000)]
[X86] Add TB_NO_REVERSE to some memory folding table entries where the register form requires 64-bit mode, but the memory form does not.

We don't know if its safe to unfold if we're in 32-bit mode.

This is simlar to what was done to some load opcodes in r363523.

I think its pretty unlikely we will try to unfold these anyway so
I don't think this is testable.

llvm-svn: 363595

5 years agoUpdate status of issue 3209
Marshall Clow [Mon, 17 Jun 2019 18:25:52 +0000 (18:25 +0000)]
Update status of issue 3209

llvm-svn: 363594

5 years agoLiveInterval.h: add LiveRange::findIndexesLiveAt function - return a list of SlotInde...
Valery Pykhtin [Mon, 17 Jun 2019 18:23:39 +0000 (18:23 +0000)]
LiveInterval.h: add LiveRange::findIndexesLiveAt function - return a list of SlotIndexes the LiveRange live at.

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

llvm-svn: 363593

5 years ago[X86][SSE] Scalarize under-aligned XMM vector nt-stores (PR42026)
Simon Pilgrim [Mon, 17 Jun 2019 18:20:04 +0000 (18:20 +0000)]
[X86][SSE] Scalarize under-aligned XMM vector nt-stores (PR42026)

If a XMM non-temporal store has less than natural alignment, scalarize the vector - with SSE4A we can stay on the vector and use MOVNTSD(f64), else we must move to GPRs and use MOVNTI(i32/i64).

llvm-svn: 363592

5 years agoAMDGPU: Make getreg intrinsic inaccessiblememonly
Matt Arsenault [Mon, 17 Jun 2019 18:17:25 +0000 (18:17 +0000)]
AMDGPU: Make getreg intrinsic inaccessiblememonly

llvm-svn: 363591

5 years ago[MemorySSA] Add all MemoryPhis before filling their values.
Alina Sbirlea [Mon, 17 Jun 2019 18:16:53 +0000 (18:16 +0000)]
[MemorySSA] Add all MemoryPhis before filling their values.

Summary:
Add all MemoryPhis in IDF before filling in their incomign values.
Otherwise, a new Phi can be added that needs to become the incoming
value of another Phi.
Test fails the verification in verifyPrevDefInPhis.

Reviewers: george.burgess.iv

Subscribers: jlebar, Prazek, zzheng, llvm-commits

Tags: #llvm

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

llvm-svn: 363590

5 years agoAdd tests for LWG 3206. NFC
Marshall Clow [Mon, 17 Jun 2019 18:06:30 +0000 (18:06 +0000)]
Add tests for LWG 3206. NFC

llvm-svn: 363589

5 years ago[AMDGPU] gfx1010 wavefrontsize intrinsic folding
Stanislav Mekhanoshin [Mon, 17 Jun 2019 17:57:50 +0000 (17:57 +0000)]
[AMDGPU] gfx1010 wavefrontsize intrinsic folding

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

llvm-svn: 363588

5 years agoAMDGPU: Fold readlane/readfirstlane calls
Matt Arsenault [Mon, 17 Jun 2019 17:52:35 +0000 (17:52 +0000)]
AMDGPU: Fold readlane/readfirstlane calls

llvm-svn: 363587

5 years ago[AMDGPU] Pass to propagate ABI attributes from kernels to the functions
Stanislav Mekhanoshin [Mon, 17 Jun 2019 17:47:28 +0000 (17:47 +0000)]
[AMDGPU] Pass to propagate ABI attributes from kernels to the functions

The pass works in two modes:

Mode 1: Just set attributes starting from kernels. This can work at
the very beginning of opt and llc pipeline, but cannot clone functions
because it must be a function pass.

Mode 2: Actually clone functions for new attributes. This can only work
after all function passes in the opt pipeline because it has to be a
module pass.

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

llvm-svn: 363586

5 years ago[clang][AST] Remove unnecessary 'const'.
Michael Liao [Mon, 17 Jun 2019 17:47:03 +0000 (17:47 +0000)]
[clang][AST] Remove unnecessary 'const'.

llvm-svn: 363585

5 years ago[GWP-ASan] Integration with Scudo [5].
Mitch Phillips [Mon, 17 Jun 2019 17:45:34 +0000 (17:45 +0000)]
[GWP-ASan] Integration with Scudo [5].

Summary:
See D60593 for further information.

This patch adds GWP-ASan support to the Scudo hardened allocator. It also
implements end-to-end integration tests using Scudo as the backing allocator.
The tests include crash handling for buffer over/underflow as well as
use-after-free detection.

Reviewers: vlad.tsyrklevich, cryptoad

Reviewed By: vlad.tsyrklevich, cryptoad

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

Tags: #sanitizers, #llvm

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

llvm-svn: 363584

5 years agogn build: Merge r363541
Nico Weber [Mon, 17 Jun 2019 17:45:12 +0000 (17:45 +0000)]
gn build: Merge r363541

llvm-svn: 363583

5 years ago[X86][AVX] Split under-aligned vector nt-stores.
Simon Pilgrim [Mon, 17 Jun 2019 17:22:38 +0000 (17:22 +0000)]
[X86][AVX] Split under-aligned vector nt-stores.

If a YMM/ZMM non-temporal store has less than natural alignment, split the vector - either they will be satisfactorily aligned or will continue to be split until they are XMMs - at which point the legalizer will scalarize it.

llvm-svn: 363582

5 years ago[LV] Suppress vectorization in some nontemporal cases
Warren Ristow [Mon, 17 Jun 2019 17:20:08 +0000 (17:20 +0000)]
[LV] Suppress vectorization in some nontemporal cases

When considering a loop containing nontemporal stores or loads for
vectorization, suppress the vectorization if the corresponding
vectorized store or load with the aligment of the original scaler
memory op is not supported with the nontemporal hint on the target.

This adds two new functions:
  bool isLegalNTStore(Type *DataType, unsigned Alignment) const;
  bool isLegalNTLoad(Type *DataType, unsigned Alignment) const;

to TTI, leaving the target independent default implementation as
returning true, but with overriding implementations for X86 that
check the legality based on available Subtarget features.

This fixes https://llvm.org/PR40759

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

llvm-svn: 363581

5 years agoGlobalISel: Ignore callsite attributes when picking intrinsic type
Matt Arsenault [Mon, 17 Jun 2019 17:01:35 +0000 (17:01 +0000)]
GlobalISel: Ignore callsite attributes when picking intrinsic type

A target intrinsic may be defined as possibly reading memory, but the
call site may have additional knowledge that it doesn't read
memory. The intrinsic lowering will expect the pessimistic assumption
of the intrinsic definition, so the chain should still be used.

I fixed the same bug in SelectionDAG in r287593.

llvm-svn: 363580

5 years agoGlobalISel: Verify intrinsics
Matt Arsenault [Mon, 17 Jun 2019 17:01:32 +0000 (17:01 +0000)]
GlobalISel: Verify intrinsics

I keep using the wrong instruction when manually writing tests. This
really needs to check the number of operands, but I don't see an easy
way to do that right now.

llvm-svn: 363579

5 years agoAMDGPU/GlobalISel: Account for multiple defs when finding intrinsic ID
Matt Arsenault [Mon, 17 Jun 2019 17:01:27 +0000 (17:01 +0000)]
AMDGPU/GlobalISel: Account for multiple defs when finding intrinsic ID

llvm-svn: 363578

5 years ago[AMDGPU] gfx1010 wave32 metadata
Stanislav Mekhanoshin [Mon, 17 Jun 2019 16:48:56 +0000 (16:48 +0000)]
[AMDGPU] gfx1010 wave32 metadata

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

llvm-svn: 363577

5 years agoAMDGPU/GlobalISel: Implement select for G_ICMP and G_SELECT
Tom Stellard [Mon, 17 Jun 2019 16:27:43 +0000 (16:27 +0000)]
AMDGPU/GlobalISel: Implement select for G_ICMP and G_SELECT

Reviewers: arsenm

Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, rovka, kristof.beyls, dstuttard, tpr, t-tye, hiraditya, Petar.Avramovic, llvm-commits

Tags: #llvm

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

llvm-svn: 363576

5 years agoUpdate the meeting page with papers/issues that are ready for Cologne
Marshall Clow [Mon, 17 Jun 2019 16:17:56 +0000 (16:17 +0000)]
Update the meeting page with papers/issues that are ready for Cologne

llvm-svn: 363575

5 years agoVarious improvements to Clang MSVC Visualizer
Mike Spertus [Mon, 17 Jun 2019 16:12:45 +0000 (16:12 +0000)]
Various improvements to Clang MSVC Visualizer

This change adds/improves MSVC visualizers for many Clang types, including array types, trailing return types in function, deduction guides, a fix for OpaquePtr, etc. It also replaces all of the view(deref) with the "na" formatter, which is a better built-in natvis technique for doing the same thing.

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

llvm-svn: 363574

5 years ago[Remarks] Extend -fsave-optimization-record to specify the format
Francis Visoiu Mistrih [Mon, 17 Jun 2019 16:06:00 +0000 (16:06 +0000)]
[Remarks] Extend -fsave-optimization-record to specify the format

Use -fsave-optimization-record=<format> to specify a different format
than the default, which is YAML.

For now, only YAML is supported.

llvm-svn: 363573

5 years ago[ScopInliner] Register FunctionAnalysisManagerModuleProxy.
Michael Kruse [Mon, 17 Jun 2019 16:01:40 +0000 (16:01 +0000)]
[ScopInliner] Register FunctionAnalysisManagerModuleProxy.

FunctionAnalysisManagerModuleProxy started to be used by the
AlwaysInlinerPass in r363287 and therefore had to be registered in the
New PassManager.

Should fix the regression tests
    Polly :: ScopInliner/invariant-load-func.ll
    Polly :: ScopInliner/simple-inline-loop.ll

llvm-svn: 363572

5 years ago[X86] combineLoad - begun making the load split code more generic. NFCI.
Simon Pilgrim [Mon, 17 Jun 2019 15:54:36 +0000 (15:54 +0000)]
[X86] combineLoad - begun making the load split code more generic. NFCI.

This is currently only used for ymm->xmm splitting but we shouldn't hardcode the offsets/alignment.

This is necessary for an upcoming patch to split under-aligned non-temporal vector loads.

llvm-svn: 363570

5 years ago[scudo][standalone] Introduce the combined allocator
Kostya Kortchinsky [Mon, 17 Jun 2019 15:23:11 +0000 (15:23 +0000)]
[scudo][standalone] Introduce the combined allocator

Summary:
The Combined allocator hold together all the other components, and
provides a memory allocator interface based on various template
parameters. This will be in turn used by "wrappers" that will provide
the standard C and C++ memory allocation functions, but can be
used as is as well.

This doesn't depart significantly from the current Scudo implementation
except for a few details:
- Quarantine batches are now protected by a header a well;
- an Allocator instance has its own TSD registry, as opposed to a
  static one for everybody;
- a function to iterate over busy chunks has been added, for Android
  purposes;

This also adds the associated tests, and a few default configurations
for several platforms, that will likely be further tuned later on.

Reviewers: morehouse, hctim, eugenis, vitalybuka

Reviewed By: morehouse

Subscribers: srhines, mgorny, delcypher, jfb, #sanitizers, llvm-commits

Tags: #llvm, #sanitizers

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

llvm-svn: 363569

5 years ago[clangd] Perform merge for main file symbols.
Haojian Wu [Mon, 17 Jun 2019 14:49:18 +0000 (14:49 +0000)]
[clangd] Perform merge for main file symbols.

Summary:
Previously, we randomly pick one main file symbol in dynamic index, we
may loose the ideal symbol (with definition location) in the index.

It fixes the issue where sometimes we fail to go to the symbol definition, see:

1. call go-to-decl on Foo in Foo.cpp
2. jump to Foo.h, call go-to-def on Foo in Foo.h

we can't go back to Foo.cpp -- because we open Foo.cpp, Foo.h in clangd, both
files have Foo symbol (one with def&decl, one with decl only), we randomely
choose one.

Reviewers: kadircet

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits

Tags: #clang

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

llvm-svn: 363568

5 years ago[lldb] [test] Extend D55859 symbols.enable-external-lookup=false for more testcases
Jan Kratochvil [Mon, 17 Jun 2019 14:46:17 +0000 (14:46 +0000)]
[lldb] [test] Extend D55859 symbols.enable-external-lookup=false for more testcases

D55859 <https://reviews.llvm.org/D55859> has no effect for some of the
testcases so this patch extends it even for (all?) other testcases known to me.
LLDB was failing when LLDB prints errors reading system debug infos
(`*-debuginfo.rpm`, DWZ-optimized) which should never happen as LLDB testcases
should not be affected by system debug infos.

`lldb/packages/Python/lldbsuite/test/api/multithreaded/driver.cpp.template` is
using only SB API which does not expose `ModuleList` so I had to call
`HandleCommand()` there.

`lldb-test.cpp` could also use `HandleCommand` and then there would be no need
for `ModuleListProperties::SetEnableExternalLookup()` but I think it is cleaner
with API and not on based on text commands.

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

llvm-svn: 363567

5 years agoPHINode: introduce setIncomingValueForBlock() function, and use it.
Whitney Tsang [Mon, 17 Jun 2019 14:38:56 +0000 (14:38 +0000)]
PHINode: introduce setIncomingValueForBlock() function, and use it.

Summary:
There is PHINode::getBasicBlockIndex() and PHINode::setIncomingValue()
but no function to replace incoming value for a specified BasicBlock*
predecessor.
Clearly, there are a lot of places that could use that functionality.

Reviewer: craig.topper, lebedev.ri, Meinersbur, kbarton, fhahn
Reviewed By: Meinersbur, fhahn
Subscribers: fhahn, hiraditya, zzheng, jsji, llvm-commits
Tag: LLVM
Differential Revision: https://reviews.llvm.org/D63338

llvm-svn: 363566