Carl Ritson [Fri, 17 Jul 2020 02:12:12 +0000 (11:12 +0900)]
[AMDGPU] Translate s_and/s_andn2 to s_mov in vcc optimisation
When SCC is dead, but VCC is required then replace s_and / s_andn2
with s_mov into VCC when mask value is 0 or -1.
Reviewed By: rampitec
Differential Revision: https://reviews.llvm.org/D83850
Vitaly Buka [Fri, 17 Jul 2020 02:47:36 +0000 (19:47 -0700)]
[profile] Disable new failing test from D83967
Vitaly Buka [Fri, 17 Jul 2020 02:33:50 +0000 (19:33 -0700)]
[sanitizer] Fix symbolizer build broken by D82702
Richard Smith [Fri, 17 Jul 2020 01:06:06 +0000 (18:06 -0700)]
Revert "[libFuzzer] Link libFuzzer's own interceptors when other compiler runtimes are not linked."
This causes binaries linked with this runtime to crash on startup if
dlsym uses any of the intercepted functions. (For example, that happens
when using tcmalloc as the allocator: dlsym attempts to allocate memory
with malloc, and tcmalloc uses strncmp within its implementation.)
Also revert dependent commit "[libFuzzer] Disable implicit builtin knowledge about memcmp-like functions when -fsanitize=fuzzer-no-link is given."
This reverts commit
f78d9fceea736d431e9e3cbca291e3909e3aa46d and
12d1124c49beec0fb79d36944960e5bf0f236d4c.
LLVM GN Syncbot [Thu, 16 Jul 2020 23:07:46 +0000 (23:07 +0000)]
[gn build] Port
9870f77441c
LLVM GN Syncbot [Thu, 16 Jul 2020 23:07:45 +0000 (23:07 +0000)]
[gn build] Port
0f6220ddd6c
LLVM GN Syncbot [Thu, 16 Jul 2020 23:07:45 +0000 (23:07 +0000)]
[gn build] Port
0e940d55f8a
Nico Weber [Thu, 16 Jul 2020 23:07:28 +0000 (19:07 -0400)]
[gn build] (manually) merge
9870f77441c
Min-Yih Hsu [Fri, 10 Jul 2020 16:40:09 +0000 (09:40 -0700)]
[profile] Move __llvm_profile_raw_version into a separate file
Similar to the reason behind moving __llvm_profile_filename into a
separate file[1]. When users try to use Full LTO with BFD linker to
generate IR level PGO profile, the __llvm_profile_raw_version variable,
which is used for marking instrumentation level, generated by frontend
would somehow conflict with the weak symbol provided by profiling
runtime.
In most of the cases, BFD linkers will pick profiling runtime's weak symbol
as the real definition and thus generate the incorrect instrumentation
level metadata in the final executables.
Moving __llvm_profile_raw_version into a separate file would make
linkers not seeing the weak symbol in the archive unless the frontend
doesn't generate one.
[1] https://reviews.llvm.org/D34797
Differential Revision: https://reviews.llvm.org/D83967
Jon Roelofs [Thu, 16 Jul 2020 23:01:06 +0000 (17:01 -0600)]
[tsan][go] Fix for missing symbols needed by GotsanRuntimeCheck
Lang Hames [Thu, 16 Jul 2020 22:55:29 +0000 (15:55 -0700)]
[ORC] Switch from initializer lists to named arguments to work around MSVC.
MSVC doesn't like some of the initializer list uses in
0e940d55f8a.
Switch to named arguments to work around this.
Dokyung Song [Thu, 16 Jul 2020 21:24:06 +0000 (21:24 +0000)]
[libFuzzer] Disable implicit builtin knowledge about memcmp-like functions when -fsanitize=fuzzer-no-link is given.
Summary: This patch disables implicit builtin knowledge about memcmp-like functions when compiling the program for fuzzing, i.e., when -fsanitize=fuzzer(-no-link) is given. This allows libFuzzer to always intercept memcmp-like functions as it effectively disables optimizing calls to such functions into different forms. This is done by adding a set of flags (-fno-builtin-memcmp and others) in the clang driver. Individual -fno-builtin-* flags previously used in several libFuzzer tests are now removed, as it is now done automatically in the clang driver.
Reviewers: morehouse, hctim
Subscribers: cfe-commits, #sanitizers
Tags: #clang, #sanitizers
Differential Revision: https://reviews.llvm.org/D83987
Jonas Devlieghere [Thu, 16 Jul 2020 22:49:22 +0000 (15:49 -0700)]
[lldb/Test] Skip TestMacABImacOSFramework.py with reproducers
This test is hitting https://bugs.python.org/issue22393 which results in
the lit multiprocessing pool deadlocking and the reproducer job timing
out on GreenDragon.
Lang Hames [Thu, 16 Jul 2020 22:35:51 +0000 (15:35 -0700)]
[ORC] Add more explicit casts to fix a narrowing conversion errors.
Lang Hames [Thu, 16 Jul 2020 22:26:56 +0000 (15:26 -0700)]
[ORC] Add explicit cast to fix a narrowing conversion error.
Nico Weber [Thu, 16 Jul 2020 22:29:48 +0000 (18:29 -0400)]
cmake list formatting fix
Albion Fung [Thu, 16 Jul 2020 17:03:11 +0000 (12:03 -0500)]
[PowerPC][Power10] Add 128-bit Binary Integer Operation instruction definitions and MC Tests
This patch adds the instruction definitions and MC tests for the 128-bit Binary
Integer Operation instructions introduced in Power10.
Differential Revision: https://reviews.llvm.org/D83516
Ryan Prichard [Thu, 16 Jul 2020 22:10:22 +0000 (15:10 -0700)]
[builtins] Omit 80-bit builtins on Android and MSVC
long double is a 64-bit double-precision type on:
- MSVC (32- and 64-bit x86)
- Android (32-bit x86)
long double is a 128-bit quad-precision type on x86_64 Android.
The assembly variants of the 80-bit builtins are correct, but some of
the builtins are implemented in C and require that long double be the
80-bit type passed via an x87 register.
Reviewed By: compnerd
Differential Revision: https://reviews.llvm.org/D82153
Teresa Johnson [Thu, 16 Jul 2020 21:42:00 +0000 (14:42 -0700)]
[compiler-rt][asan][hwasan] Fix Android bots
Fix failure in Android bots from refactoring in
5d2be1a18845c528d3e86f7efcc59872e4a757c3 (https://crbug.com/1106482).
We need to make the UnmapFromTo available outside sanitizer_common for
calls from hwasan and asan linux handling. While here, remove
declaration of GetHighMemEnd which is no longer in sanitizer_common.
Lang Hames [Thu, 16 Jul 2020 19:51:14 +0000 (12:51 -0700)]
[ORC] Add TargetProcessControl and TPCIndirectionUtils APIs.
TargetProcessControl is a new API for communicating with JIT target processes.
It supports memory allocation and access, and inspection of some process
properties, e.g. the target proces triple and page size.
Centralizing these APIs allows utilities written against TargetProcessControl
to remain independent of the communication procotol with the target process
(which may be direct memory access/allocation for in-process JITing, or may
involve some form of IPC or RPC).
An initial set of TargetProcessControl-based utilities for lazy compilation is
provided by the TPCIndirectionUtils class.
An initial implementation of TargetProcessControl for in-process JITing
is provided by the SelfTargetProcessControl class.
An example program showing how the APIs can be used is provided in
llvm/examples/OrcV2Examples/LLJITWithTargetProcessControl.
Adrian McCarthy [Thu, 16 Jul 2020 21:44:24 +0000 (14:44 -0700)]
[lldb] Eliminated unused local variable
I got misled by this remnant from earlier changes.
Jon Roelofs [Thu, 16 Jul 2020 21:10:22 +0000 (15:10 -0600)]
[SimplifyCFG] Fix crash in the EXPENSIVE_CHECKS build
SimplifyCFG was incorrectly reporting to the pass manager that it had not made
changes after folding away a PHI. This is detected in the EXPENSIVE_CHECKS
build when the function's hash changes.
Differential Revision: https://reviews.llvm.org/D83985
Lei Zhang [Thu, 16 Jul 2020 20:05:51 +0000 (16:05 -0400)]
[spirv] Use owning module ref to avoid leaks and fix ASAN tests
Differential Revision: https://reviews.llvm.org/D83982
Wouter van Oortmerssen [Fri, 10 Jul 2020 23:51:01 +0000 (16:51 -0700)]
[WebAssembly] 64-bit (function) pointer fixes.
Accounting for the fact that Wasm function indices are 32-bit, but in wasm64 we want uniform 64-bit pointers.
Includes reloc types for 64-bit table indices.
Differential Revision: https://reviews.llvm.org/D83729
Roman Lebedev [Thu, 16 Jul 2020 20:33:10 +0000 (23:33 +0300)]
[NFC][PhaseOrdering] Add a test demonstrating pitfails of common code hoisting on loop rotation
Depending on the -rotation-max-header-size=?,
hoisting common code early makes loop rotation impossible.
Craig Topper [Thu, 16 Jul 2020 19:52:02 +0000 (12:52 -0700)]
[X86] Move integer hadd/hsub formation into a helper function shared by combineAdd and combineSub.
There was a lot of duplicate code here for checking the VT and
subtarget. Moving it into a helper avoids that.
It also fixes a bug that combineAdd reused Op0/Op1 after a call
to isHorizontalBinOp may have changed it. The new helper function
has its own local version of Op0/Op1 that aren't shared by other
code.
Fixes PR46455.
Reviewed By: spatel, bkramer
Differential Revision: https://reviews.llvm.org/D83971
Dokyung Song [Thu, 16 Jul 2020 20:26:03 +0000 (20:26 +0000)]
[libFuzzer] Link libFuzzer's own interceptors when other compiler runtimes are not linked.
Summary: libFuzzer intercepts certain library functions such as memcmp/strcmp by defining weak hooks. Weak hooks, however, are called only when other runtimes such as ASan is linked. This patch defines libFuzzer's own interceptors, which is linked into the libFuzzer executable when other runtimes are not linked, i.e., when -fsanitize=fuzzer is given, but not others.
Reviewers: kcc, morehouse, hctim
Reviewed By: morehouse, hctim
Subscribers: krytarowski, mgorny, cfe-commits, #sanitizers
Tags: #clang, #sanitizers
Differential Revision: https://reviews.llvm.org/D83494
Denis Antrushin [Thu, 16 Jul 2020 19:54:58 +0000 (22:54 +0300)]
[Statepoint] Fix bug found by sanitaizer.
Statepoint has no static operands, so it cannot be verified
against MCInstrDescr. Revert NumDefs change introduced by
ef658ebd629.
serge-sans-paille [Wed, 15 Jul 2020 07:31:13 +0000 (09:31 +0200)]
Harmonize Python shebang
Differential Revision: https://reviews.llvm.org/D83857
Matt Arsenault [Thu, 16 Jul 2020 00:42:17 +0000 (20:42 -0400)]
Fix incorrect file path in documentation
Matt Arsenault [Thu, 16 Jul 2020 19:44:44 +0000 (15:44 -0400)]
AMDGPU: Add a few more missing test for AGPR tuple copying
Craig Topper [Thu, 16 Jul 2020 18:20:57 +0000 (11:20 -0700)]
[X86] Change the tuning settings for pentium4 to be more modern since its the default 32-bit cpu in clang
Alternative to D83897. I believe the big change here is that I removed slow unaligned memory 16
Down side that it may adversely effect tuning if someone explicitly targets -march=pentium4 and expects pentium4 tuned code. Of course pentium4 is so old our default behavior with the previous settings may not have been the best either.
Reviewed By: echristo, RKSimon
Differential Revision: https://reviews.llvm.org/D83913
Nadav Rotem [Tue, 14 Jul 2020 20:59:36 +0000 (13:59 -0700)]
Remove an unused variable in Clang.
https://reviews.llvm.org/D83788
Louis Dionne [Thu, 16 Jul 2020 19:41:55 +0000 (15:41 -0400)]
[libc++abi] Temporarily disable test on Apple to fix the CI
This test has been failing on some SDKs for a long time because we lack
a proper way of identifying the SDK version in Lit. Until that is possible,
mark the test as unsupported on Apple to restore the CI.
Louis Dionne [Thu, 16 Jul 2020 19:34:15 +0000 (15:34 -0400)]
[libc++] Remove shortcut Lit features for Apple backdeployment
Some time ago, I introduced shortcut features like dylib-has-no-shared_mutex
to encode whether the deployment target supported shared_mutex (say). This
made the test suite annotations cleaner.
However, the problem with building Lit features on top of other Lit
features is that it's easier for them to become stale, especially when
they are generated programmatically. Furthermore, it makes the bar for
defining configurations from scratch higher, since more features have
to be defined. Instead, I think it's better to put the XFAILs in the
tests directly, which allows cleaning them up with a simple grep.
Matt Arsenault [Thu, 16 Jul 2020 19:17:10 +0000 (15:17 -0400)]
AMDGPU: Add missing tests for copyPhysReg AGPR tuples
Mircea Trofin [Wed, 15 Jul 2020 23:02:15 +0000 (16:02 -0700)]
[llvm] Moved InlineSizeEstimatorAnalysis test to .ll
Summary:
Following guidance in
https://llvm.org/docs/TestingGuide.html#testing-analysis
Reviewers: mehdi_amini
Subscribers: mgorny, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D83918
Walter Erquinigo [Thu, 16 Jul 2020 19:18:59 +0000 (12:18 -0700)]
[intel-pt] Fix building due to CMake + python changes
Python is now handled in CMake with different variables, thus
the intel plugin needs a corresponding update.
Test Plan:
Differential Revision: https://phabricator.intern.facebook.com/
D22555992
Louis Dionne [Thu, 16 Jul 2020 19:01:09 +0000 (15:01 -0400)]
[libc++] Improve how we report the testing configuration
LLVM GN Syncbot [Thu, 16 Jul 2020 19:08:09 +0000 (19:08 +0000)]
[gn build] Port
5e8b4be9f85
Jan Korous [Thu, 16 Jul 2020 19:06:02 +0000 (12:06 -0700)]
[AST][NFC] Simplify a regression test
Differential Revision: https://reviews.llvm.org/D83438
Wouter van Oortmerssen [Mon, 6 Jul 2020 20:34:16 +0000 (13:34 -0700)]
[WebAssembly] Triple::wasm64 related cleanup
Differential Revision: https://reviews.llvm.org/D83713
Eric Christopher [Thu, 16 Jul 2020 18:40:43 +0000 (11:40 -0700)]
Temporarily Revert "[AssumeBundles] Use operand bundles to encode alignment assumptions"
due to the performance bugs filed in https://bugs.llvm.org/show_bug.cgi?id=46753.
An SROA change soon may obviate some of these problems.
This reverts commit
8d09f20798ac180b1749276bff364682ce0196ab.
Nadav Rotem [Tue, 14 Jul 2020 20:35:06 +0000 (13:35 -0700)]
[InjectTLIMappings] Use StringRef instead of std::string for FN name.
https://reviews.llvm.org/D83797
Adam Balogh [Tue, 7 Jul 2020 10:03:07 +0000 (12:03 +0200)]
[Analyzer] Hotfix for various crashes in iterator checkers
The patch that introduces handling iterators implemented as pointers may
cause crash in some projects because pointer difference is mistakenly
handled as pointer decrement. (Similair case for iterators implemented
as class instances are already handled correctly.) This patch fixes this
issue.
The second case that causes crash is comparison of an iterator
implemented as pointer and a null-pointer. This patch contains a fix for
this issue as well.
The third case which causes crash is that the checker mistakenly
considers all integers as nonloc::ConcreteInt when handling an increment
or decrement of an iterator implemented as pointers. This patch adds a
fix for this too.
The last case where crashes were detected is when checking for success
of an std::advance() operation. Since the modeling of iterators
implemented as pointers is still incomplete this may result in an
assertion. This patch replaces the assertion with an early exit and
adds a FIXME there.
Differential Revision: https://reviews.llvm.org/D83295
Julian Lettner [Thu, 16 Jul 2020 18:46:45 +0000 (11:46 -0700)]
Revert "[Darwin] Fix OS version checks inside simulators"
This reverts commit
b16dfbead21a458799a0dab96599eb15f5d9b7ea.
Accidental push, reverting and creating a new revision.
Teresa Johnson [Mon, 6 Jul 2020 18:05:12 +0000 (11:05 -0700)]
[compiler-rt][asan][hwasan] Refactor shadow setup into sanitizer_common (NFCI)
Summary:
This refactors some common support related to shadow memory setup from
asan and hwasan into sanitizer_common. This should not only reduce code
duplication but also make these facilities available for new compiler-rt
uses (e.g. heap profiling).
In most cases the separate copies of the code were either identical, or
at least functionally identical. A few notes:
In ProtectGap, the asan version checked the address against an upper
bound (kZeroBaseMaxShadowStart, which is (2^18). I have created a copy
of kZeroBaseMaxShadowStart in hwasan_mapping.h, with the same value, as
it isn't clear why that code should not do the same check. If it
shouldn't, I can remove this and guard this check so that it only
happens for asan.
In asan's InitializeShadowMemory, in the dynamic shadow case it was
setting __asan_shadow_memory_dynamic_address to 0 (which then sets both
macro SHADOW_OFFSET as well as macro kLowShadowBeg to 0) before calling
FindDynamicShadowStart(). AFAICT this is only needed because
FindDynamicShadowStart utilizes kHighShadowEnd to
get the shadow size, and kHighShadowEnd is a macro invoking
MEM_TO_SHADOW(kHighMemEnd) which in turn invokes:
(((kHighMemEnd) >> SHADOW_SCALE) + (SHADOW_OFFSET))
I.e. it computes the shadow space needed by kHighMemEnd (the shift), and
adds the offset. Since we only want the shadow space here, the earlier
setting of SHADOW_OFFSET to 0 via __asan_shadow_memory_dynamic_address
accomplishes this. In the hwasan version, it simply gets the shadow
space via "MemToShadowSize(kHighMemEnd)", where MemToShadowSize just
does the shift. I've simplified the asan handling to do the same
thing, and therefore was able to remove the setting of the SHADOW_OFFSET
via __asan_shadow_memory_dynamic_address to 0.
Reviewers: vitalybuka, kcc, eugenis
Subscribers: dberris, #sanitizers, llvm-commits, davidxl
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D83247
Zakk Chen [Thu, 16 Jul 2020 17:32:01 +0000 (10:32 -0700)]
[RISCV] Add support for -mcpu option.
Summary:
1. gcc uses `-march` and `-mtune` flag to chose arch and
pipeline model, but clang does not have `-mtune` flag,
we uses `-mcpu` to chose both infos.
2. Add SiFive e31 and u54 cpu which have default march
and pipeline model.
3. Specific `-mcpu` with rocket-rv[32|64] would select
pipeline model only, and use the driver's arch choosing
logic to get default arch.
Reviewers: lenary, asb, evandro, HsiangKai
Reviewed By: lenary, asb, evandro
Tags: #llvm, #clang
Differential Revision: https://reviews.llvm.org/D71124
Nadav Rotem [Thu, 16 Jul 2020 00:12:48 +0000 (17:12 -0700)]
[LiveVariables] Replace std::vector with SmallVector.
Replace std::vector with SmallVector to reduce the number of mallocs.
This method is frequently executed, and the number of elements in the
vector is typically small.
https://reviews.llvm.org/D83920
Thomas Lively [Thu, 16 Jul 2020 18:37:25 +0000 (11:37 -0700)]
[WebAssembly] Implement v128.select
Although the SIMD spec proposal does not specifically include a
select instruction, the select instruction in MVP WebAssembly is
polymorphic over the selected types, so it is able to work on v128
values when they are enabled. This patch introduces a new variant of
the select instruction for each legal vector type. Additional ISel
patterns are adapted from the SELECT_I32 and SELECT_I64 patterns.
Depends on D83736.
Differential Revision: https://reviews.llvm.org/D83737
Nadav Rotem [Thu, 16 Jul 2020 05:36:32 +0000 (22:36 -0700)]
[TableGen] Change std::vector to SmallVector
The size of VTList that is pushed into this container is usually 1, but
often 6 or 7. Change the vector to SmallVector to eliminate frequent
mallocs. This happens hundreds of thousands of times in each tablegen
execution during the LLVM/clang build.
https://reviews.llvm.org/D83849
Matt Arsenault [Wed, 1 Jul 2020 16:30:24 +0000 (12:30 -0400)]
AMDGPU: Move handling of AGPR copies to a separate function
This is in preparation for fixing multiple problems with the way AGPR
copies are handled, but this change is NFC itself. First, it's relying
on recursively calling copyPhysReg, which is losing information
necessary to get correct super register handling.
Second, it's constructing a new RegScavenger and doing a O(N^2) walk
on every single sub-spill for every AGPR tuple copy. Third, it's using
the forward form of the scavenger, and not using the preferred
backwards scan.
Fangrui Song [Thu, 16 Jul 2020 18:27:16 +0000 (11:27 -0700)]
[Driver] Make -B take precedence over COMPILER_PATH
There is currently no COMPILER_PATH test. A subsequent --ld-path patch
will improve the coverage here.
Arthur Eubanks [Thu, 16 Jul 2020 18:09:47 +0000 (11:09 -0700)]
[SCEV] Fix ScalarEvolution tests under NPM
Many tests use opt's -analyze feature, which does not translate well to
NPM and has better alternatives. The alternative here is to explicitly
add a pass that calls ScalarEvolution::print().
The legacy pass manager RUNs aren't changing, but they are now pinned to
the legacy pass manager. For each legacy pass manager RUN, I added a
corresponding NPM RUN using the 'print<scalar-evolution>' pass. For
compatibility with update_analyze_test_checks.py and existing test
CHECKs, 'print<scalar-evolution>' now prints what -analyze prints per
function.
This was generated by the following Python script and failures were
manually fixed up:
import sys
for i in sys.argv:
with open(i, 'r') as f:
s = f.read()
with open(i, 'w') as f:
for l in s.splitlines():
if "RUN:" in l and ' -analyze ' in l and '\\' not in l:
f.write(l.replace(' -analyze ', ' -analyze -enable-new-pm=0 '))
f.write('\n')
f.write(l.replace(' -analyze ', ' -disable-output ').replace(' -scalar-evolution ', ' "-passes=print<scalar-evolution>" ').replace(" | ", " 2>&1 | "))
f.write('\n')
else:
f.write(l)
There are a couple failures still in ScalarEvolution under NPM, but
those are due to other unrelated naming conflicts.
Reviewed By: asbirlea
Differential Revision: https://reviews.llvm.org/D83798
Thomas Lively [Thu, 16 Jul 2020 18:19:08 +0000 (11:19 -0700)]
[WebAssembly] Autogenerate tests for simd-select.ll
Updating the simd-select.ll tests manually with consistent named
regexps for the register numbers was taking more time than it was
worth, so this patch updates that test file to have autogenerated
output. This is not a significant readability regression because the
tests in that file are all very small.
Depends on D83734.
Differential Revision: https://reviews.llvm.org/D83736
Thomas Lively [Thu, 16 Jul 2020 18:11:19 +0000 (11:11 -0700)]
[WebAssembly] Lower vselect to v128.bitselect
We were previously expanding vselect and matching on the expansion to
generate bitselects, but in some cases the expansion would be further
combined and a bitselect would not get generated. This patch improves
codegen in those cases by legalizing vselect and lowering it to
v128.bitselect. The old pattern that matches the expansion is still
useful for lowering IR that already uses the expansion rather than a
select operation.
Differential Revision: https://reviews.llvm.org/D83734
Craig Topper [Thu, 16 Jul 2020 17:33:20 +0000 (10:33 -0700)]
[X86] Add test case for PR46455.
Matt Arsenault [Tue, 14 Jul 2020 12:19:39 +0000 (08:19 -0400)]
DAG: Try scalarizing when expanding saturating add/sub
In an upcoming AMDGPU patch, the scalar cases will be legal and vector
ops should be scalarized, rather than producing a long sequence of
vector ops which will also need to be scalarized.
Use a lazy heuristic that seems to work and improves the thumb2 MVE
test.
George Rokos [Thu, 16 Jul 2020 18:02:55 +0000 (11:02 -0700)]
[clang] Fix compilation warnings in OpenMP declare mapper codegen.
This patch fixes the compilation warnings that L is not a reference.
Thanks to Lingda Li for providing the patch.
Differential Revision: https://reviews.llvm.org/D83959
Denis Antrushin [Wed, 10 Jun 2020 12:53:54 +0000 (19:53 +0700)]
MIR Statepoint refactoring. Part 1: Basic MI level changes.
Basic support for variadic-def MIR Statepoint:
- Change TableGen STATEPOINT description to variadic out list
(For self-documentation purpose; by itself it does not affect
code generation in any way).
- Update StatepointOpers helper class to handle variadic defs.
- Update MachineVerifier to properly handle them, too.
With this change, new Statepoint instruction can be passed through
backend (excluding ISEL) without errors.
Full change set is available at D81603.
Reviewed By: reames
Differential Revision: https://reviews.llvm.org/D81645
Matt Arsenault [Fri, 10 Jul 2020 01:02:25 +0000 (21:02 -0400)]
Use findEnumAttribute helper for preallocated
Matt Arsenault [Mon, 29 Jun 2020 19:13:32 +0000 (15:13 -0400)]
IR: Rename Argument::hasPassPointeeByValueAttr to prepare for byref
When the byref attribute is added, there will need to be two similar
functions for the existing cases which have an associate value copy,
and byref which does not. Most, but not all of the existing uses will
use the existing version.
The associated size function added by D82679 also needs to
contextually differ, and will help eliminate a few places still
relying on pointee element types.
Matt Arsenault [Thu, 25 Jun 2020 23:12:55 +0000 (19:12 -0400)]
ValueTracking: Fix isKnownNonZero for non-0 null pointers for byval
The IR doesn't have a proper concept of invalid pointers, and "null"
constants are just all zeros (though it really needs one).
I think it's not possible to break this for AMDGPU due to the copy
semantics of byval. If you have an original stack object at 0, the
byval copy will be placed above it so I don't think it's really
possible to hit a 0 address.
Julian Lettner [Thu, 4 Jun 2020 19:33:30 +0000 (12:33 -0700)]
[Darwin] Fix OS version checks inside simulators
compiler-rt checks OS versions by querying the Darwin kernel version.
This is not necessarily correct inside the simulators if the simulator
runtime is not aligned with the host macOS. Let's instead check the
`SIMULATOR_RUNTIME_VERSION` env var.
Note that we still use the old code path as a fallback in case the
`SIMULATOR_RUNTIME_VERSION` environment variable isn't set.
rdar://
63031937
Reviewers: delcypher
Differential Revision: https://reviews.llvm.org/D79979
Nico Weber [Thu, 16 Jul 2020 17:46:45 +0000 (13:46 -0400)]
[gn build] Fix merge script mishap
Fred Riss [Wed, 15 Jul 2020 22:00:52 +0000 (15:00 -0700)]
[lldb/ObjectFileMachO] Fetch shared cache images from our own shared cache
Summary:
On macOS 11, the libraries that have been integrated in the system
shared cache are not present on the filesystem anymore. LLDB was
using those files to get access to the symbols of those libraries.
LLDB can get the images from the target process memory though.
This has 2 consequences:
- LLDB cannot load the images before the process starts, reporting
an error if someone tries to break on a system symbol.
- Loading the symbols by downloading the data from the inferior
is super slow. It takes tens of seconds at the start of the
debug session to populate the Module list.
To fix this, we can use the library images LLDB has in its own
mapping of the shared cache. Shared cache images are somewhat
special as their LINKEDIT segment is moved to the end of the cache
and thus the images are not contiguous in memory. All of this can
hidden in ObjectFileMachO.
This patch fixes a number of test failures on macOS 11 due to the
first problem described above and adds some specific unittesting
for the new SharedCache Host utilities.
Reviewers: jasonmolenda, labath
Subscribers: llvm-commits, lldb-commits
Tags: #lldb, #llvm
Differential Revision: https://reviews.llvm.org/D83023
Matt Arsenault [Wed, 15 Jul 2020 00:51:45 +0000 (20:51 -0400)]
AMDGPU: Rename gfx9 version of v_add_i32/v_sub_i32
The carry-out opcode is renamed, so eliminate the deceptive _gfx9,
which looked like the encoded instruction. The real encoded version
was named _gfx9_gfx9.
Move it into the VI encoding namespace. The gfx9 namespace is just to
deal with the renamed instructions that reinterpret the opcode. When
codegened, it would fail to find the real instruction since it wasn't
in the right namespace.
Jinsong Ji [Thu, 16 Jul 2020 17:25:21 +0000 (17:25 +0000)]
[docs] fix ident in llvm-exegesis.rst
Matt Arsenault [Tue, 14 Jul 2020 13:18:36 +0000 (09:18 -0400)]
AMDGPU: Rename add/sub with carry out instructions
The hardware has created a real mess in the naming for add/sub, which
have been renamed basically every generation. Switch the carry out
pseudos to have the gfx9/gfx10 names. We were using the original SI/CI
v_add_i32/v_sub_i32 names. Later targets reintroduced these names as
carryless instructions with a saturating clamp bit, which we do not
define. Do this rename so we can unambiguously add these missing
instructions.
The carry-in versions should also be renamed, but at least those had a
consistent _u32 name to begin with. The 16-bit instructions were also
renamed, but aren't ambiguous.
This does regress assembler error message quality in some cases. In
mismatched wave32/wave64 situations, this will switch from
"unsupported instruction" to "invalid operand", with the error
pointing at the wrong position. I couldn't quite follow how the
assembler selects these, but the previous behavior seemed accidental
to me. It looked like there was a partial attempt to handle this which
was never completed (i.e. there is an AMDGPUOperand::isBoolReg but it
isn't used for anything).
Jinsong Ji [Thu, 16 Jul 2020 17:07:12 +0000 (17:07 +0000)]
[docs][lldb] Fix lldb item in releasenotes
Reviewed By: JDevlieghere
Differential Revision: https://reviews.llvm.org/D83962
Michael Forster [Thu, 16 Jul 2020 16:48:34 +0000 (18:48 +0200)]
Add hashing support for std::tuple
Summary:
All tuple values are passed directly to hash_combine. This is inspired by the implementation used for Swift:
https://github.com/llvm/llvm-project-staging/commit/
4a1b4edbe1d1969284c1528e2950ac81b25edc8f
https://github.com/llvm/llvm-project-staging/commit/
845f3829b91522920a59c351b9011af01c5c7f87
Reviewers: gribozavr2
Reviewed By: gribozavr2
Subscribers: dexonsmith, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D83887
Florian Hahn [Thu, 16 Jul 2020 16:55:54 +0000 (17:55 +0100)]
[Matrix] Add test for running matrix lowering with -O0.
Louis Dionne [Thu, 16 Jul 2020 16:30:11 +0000 (12:30 -0400)]
[runtimes] Move the enable_rtti Lit parameter to the DSL
Kostya Kortchinsky [Wed, 17 Jun 2020 17:31:53 +0000 (10:31 -0700)]
[scudo][standalone] Release smaller blocks less often
Summary:
Releasing smaller blocks is costly and only yields significant
results when there is a large percentage of free bytes for a given
size class (see numbers below).
This CL introduces a couple of additional checks for sizes lower
than 256. First we want to make sure that there is enough free bytes,
relatively to the amount of allocated bytes. We are looking at 8X% to
9X% (smaller blocks require higher percentage). We also want to make
sure there has been enough activity with the freelist to make it
worth the time, so we now check that the bytes pushed to the freelist
is at least 1/16th of the allocated bytes for those classes.
Additionally, we clear batches before destroying them now - this
could have prevented some releases to occur (class id 0 rarely
releases anyway).
Here are the numbers, for about 1M allocations in multiple threads:
Size: 16
85% freed -> 0% released
86% freed -> 0% released
87% freed -> 0% released
88% freed -> 0% released
89% freed -> 0% released
90% freed -> 0% released
91% freed -> 0% released
92% freed -> 0% released
93% freed -> 0% released
94% freed -> 0% released
95% freed -> 0% released
96% freed -> 0% released
97% freed -> 2% released
98% freed -> 7% released
99% freed -> 27% released
Size: 32
85% freed -> 0% released
86% freed -> 0% released
87% freed -> 0% released
88% freed -> 0% released
89% freed -> 0% released
90% freed -> 0% released
91% freed -> 0% released
92% freed -> 0% released
93% freed -> 0% released
94% freed -> 0% released
95% freed -> 1% released
96% freed -> 3% released
97% freed -> 7% released
98% freed -> 17% released
99% freed -> 41% released
Size: 48
85% freed -> 0% released
86% freed -> 0% released
87% freed -> 0% released
88% freed -> 0% released
89% freed -> 0% released
90% freed -> 0% released
91% freed -> 0% released
92% freed -> 0% released
93% freed -> 0% released
94% freed -> 1% released
95% freed -> 3% released
96% freed -> 7% released
97% freed -> 13% released
98% freed -> 27% released
99% freed -> 52% released
Size: 64
85% freed -> 0% released
86% freed -> 0% released
87% freed -> 0% released
88% freed -> 0% released
89% freed -> 0% released
90% freed -> 0% released
91% freed -> 0% released
92% freed -> 1% released
93% freed -> 2% released
94% freed -> 3% released
95% freed -> 6% released
96% freed -> 11% released
97% freed -> 20% released
98% freed -> 35% released
99% freed -> 59% released
Size: 80
85% freed -> 0% released
86% freed -> 0% released
87% freed -> 0% released
88% freed -> 0% released
89% freed -> 0% released
90% freed -> 1% released
91% freed -> 1% released
92% freed -> 2% released
93% freed -> 4% released
94% freed -> 6% released
95% freed -> 10% released
96% freed -> 17% released
97% freed -> 26% released
98% freed -> 41% released
99% freed -> 64% released
Size: 96
85% freed -> 0% released
86% freed -> 0% released
87% freed -> 0% released
88% freed -> 0% released
89% freed -> 1% released
90% freed -> 1% released
91% freed -> 3% released
92% freed -> 4% released
93% freed -> 6% released
94% freed -> 10% released
95% freed -> 14% released
96% freed -> 21% released
97% freed -> 31% released
98% freed -> 47% released
99% freed -> 68% released
Size: 112
85% freed -> 0% released
86% freed -> 1% released
87% freed -> 1% released
88% freed -> 2% released
89% freed -> 3% released
90% freed -> 4% released
91% freed -> 6% released
92% freed -> 8% released
93% freed -> 11% released
94% freed -> 16% released
95% freed -> 22% released
96% freed -> 30% released
97% freed -> 40% released
98% freed -> 55% released
99% freed -> 74% released
Size: 128
85% freed -> 0% released
86% freed -> 1% released
87% freed -> 1% released
88% freed -> 2% released
89% freed -> 3% released
90% freed -> 4% released
91% freed -> 6% released
92% freed -> 8% released
93% freed -> 11% released
94% freed -> 16% released
95% freed -> 22% released
96% freed -> 30% released
97% freed -> 40% released
98% freed -> 55% released
99% freed -> 74% released
Size: 144
85% freed -> 1% released
86% freed -> 2% released
87% freed -> 3% released
88% freed -> 4% released
89% freed -> 6% released
90% freed -> 7% released
91% freed -> 10% released
92% freed -> 13% released
93% freed -> 17% released
94% freed -> 22% released
95% freed -> 28% released
96% freed -> 37% released
97% freed -> 47% released
98% freed -> 61% released
99% freed -> 78% released
Size: 160
85% freed -> 1% released
86% freed -> 2% released
87% freed -> 3% released
88% freed -> 4% released
89% freed -> 5% released
90% freed -> 7% released
91% freed -> 10% released
92% freed -> 13% released
93% freed -> 17% released
94% freed -> 22% released
95% freed -> 28% released
96% freed -> 37% released
97% freed -> 47% released
98% freed -> 61% released
99% freed -> 78% released
Size: 176
85% freed -> 2% released
86% freed -> 3% released
87% freed -> 4% released
88% freed -> 6% released
89% freed -> 7% released
90% freed -> 9% released
91% freed -> 12% released
92% freed -> 15% released
93% freed -> 20% released
94% freed -> 25% released
95% freed -> 32% released
96% freed -> 40% released
97% freed -> 51% released
98% freed -> 64% released
99% freed -> 80% released
Size: 192
85% freed -> 4% released
86% freed -> 5% released
87% freed -> 6% released
88% freed -> 8% released
89% freed -> 10% released
90% freed -> 13% released
91% freed -> 16% released
92% freed -> 20% released
93% freed -> 24% released
94% freed -> 30% released
95% freed -> 37% released
96% freed -> 45% released
97% freed -> 55% released
98% freed -> 68% released
99% freed -> 82% released
Size: 224
85% freed -> 8% released
86% freed -> 10% released
87% freed -> 12% released
88% freed -> 14% released
89% freed -> 17% released
90% freed -> 20% released
91% freed -> 23% released
92% freed -> 28% released
93% freed -> 33% released
94% freed -> 39% released
95% freed -> 46% released
96% freed -> 53% released
97% freed -> 63% released
98% freed -> 73% released
99% freed -> 85% released
Size: 240
85% freed -> 8% released
86% freed -> 10% released
87% freed -> 12% released
88% freed -> 14% released
89% freed -> 17% released
90% freed -> 20% released
91% freed -> 23% released
92% freed -> 28% released
93% freed -> 33% released
94% freed -> 39% released
95% freed -> 46% released
96% freed -> 54% released
97% freed -> 63% released
98% freed -> 73% released
99% freed -> 85% released
Reviewers: cferris, pcc, hctim, eugenis
Subscribers: #sanitizers, llvm-commits
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D82031
Louis Dionne [Thu, 16 Jul 2020 16:42:26 +0000 (12:42 -0400)]
[libc++abi] NFC: Fix indentation
Dmitri Gribenko [Thu, 16 Jul 2020 16:14:59 +0000 (18:14 +0200)]
Use TestClangConfig in AST Matchers tests and run them in more configurations
Summary:
I am changing tests for AST Matchers to run in multiple language standards
versions, and under multiple triples that have different behavior with regards
to templates. This change is similar to https://reviews.llvm.org/D82179.
To keep the size of the patch manageable, in this patch I'm only migrating one
file to get the process started and get feedback on this approach.
Reviewers: ymandel
Reviewed By: ymandel
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D83868
Rahul Joshi [Wed, 15 Jul 2020 05:34:26 +0000 (22:34 -0700)]
[NFC] Use appropriate names for `for_each` and `transform` template parameters
Differential Revision: https://reviews.llvm.org/D83848
Rahul Joshi [Wed, 15 Jul 2020 01:27:51 +0000 (18:27 -0700)]
[MLIR][TableGen] Add default value for named attributes for 2 more build methods
- Added more default values for `attributes` parameter for 2 more build methods
- Extend the op-decls.td unit test to test these build methods.
Differential Revision: https://reviews.llvm.org/D83839
David Green [Thu, 16 Jul 2020 14:42:05 +0000 (15:42 +0100)]
[BasicAA] Fix -basicaa-recphi for geps with negative offsets
As shown in D82998, the basic-aa-recphi option can cause miscompiles for
gep's with negative constants. The option checks for recursive phi, that
recurse through a contant gep. If it finds one, it performs aliasing
calculations using the other phi operands with an unknown size, to
specify that an unknown number of elements after the initial value are
potentially accessed. This works fine expect where the constant is
negative, as the size is still considered to be positive. So this patch
expands the check to make sure that the constant is also positive.
Differential Revision: https://reviews.llvm.org/D83576
LLVM GN Syncbot [Thu, 16 Jul 2020 16:14:13 +0000 (16:14 +0000)]
[gn build] Port
1360e140cc7
Vy Nguyen [Thu, 18 Jun 2020 02:45:31 +0000 (22:45 -0400)]
[llvm-exegesis] Add benchmark latency option on X86 that uses LBR for more precise measurements.
Starting with Skylake, the LBR contains the precise number of cycles between the two
consecutive branches.
Making use of this will hopefully make the measurements more precise than the
existing methods of using RDTSC.
Differential Revision: https://reviews.llvm.org/D77422
Rahul Joshi [Thu, 16 Jul 2020 14:35:46 +0000 (07:35 -0700)]
[flang] Adopt NoRegionArguments (WhereOp) and ParentOneOf (ResultOp) traits
Differential Revision: https://reviews.llvm.org/D83522
Sjoerd Meijer [Thu, 16 Jul 2020 15:14:47 +0000 (16:14 +0100)]
And now really disable that test.
Sjoerd Meijer [Thu, 16 Jul 2020 15:11:27 +0000 (16:11 +0100)]
Last attempt for rG3a624c327add: one test fails with the NPM,
so disable that one for now.
Rahul Joshi [Thu, 16 Jul 2020 05:27:17 +0000 (22:27 -0700)]
[MLIR] Add OpPrintingFlags to IRPrinterConfig.
- This will enable tweaking IR printing options when enabling printing (for ex,
tweak elideLargeElementsAttrs to create smaller IR logs)
Differential Revision: https://reviews.llvm.org/D83930
Louis Dionne [Wed, 22 Apr 2020 15:16:27 +0000 (11:16 -0400)]
[CMake] Enforce the minimum CMake version to be at least 3.13.4
This commit changes the warning for CMake < 3.13.4 into a fatal error.
The intent is to revert and re-apply this simple commit until all build
bots are migrated to CMake >= 3.13.4.
This is part of the effort discussed on llvm-dev here:
http://lists.llvm.org/pipermail/llvm-dev/2020-April/140578.html
Differential Revision: https://reviews.llvm.org/D78646
Louis Dionne [Thu, 16 Jul 2020 10:03:00 +0000 (06:03 -0400)]
[runtimes][NFC] Remove unused or unnecessary CMake variables
Frederik Gossen [Thu, 16 Jul 2020 14:43:42 +0000 (14:43 +0000)]
[MLIR][Shape] Lower `shape.shape_eq` to `scf`
Lower `shape.shape_eq` to the `scf` (and `std`) dialect. For now, this lowering
is limited to extent tensor operands.
Differential Revision: https://reviews.llvm.org/D82530
Xiangling Liao [Sat, 11 Jul 2020 21:34:53 +0000 (17:34 -0400)]
[AIX]Generate debug info for static init related functions
Set the debug location for static init related functions(__dtor
and __finalize) so we can generate valid debug info on AIX by invoking
-g with clang or -debug-info-kind=limited with clang_cc1.
This also works for any other future targets who may use sinit and
sterm functions for static initialization, where a direct call to
dtor will be generated within finalize function body.
This patch also aims at validating that the debug info generated
is correct for AIX sinit related functions.
Differential Revision: https://reviews.llvm.org/D83702
Sjoerd Meijer [Thu, 16 Jul 2020 14:36:01 +0000 (15:36 +0100)]
Follow up of rG3a624c327add: pacify buildbot, add "REQUIRES: aarch64" to test
Florian Hahn [Thu, 16 Jul 2020 14:22:29 +0000 (15:22 +0100)]
[SCCP] Add test cases for adding !range to call-sites.
Xing GUO [Thu, 16 Jul 2020 14:32:31 +0000 (22:32 +0800)]
[DWARFYAML] Implement the .debug_str_offsets section.
This patch helps add support for emitting the .debug_str_offsets section
to yaml2elf.
Reviewed By: jhenderson, MaskRay
Differential Revision: https://reviews.llvm.org/D83853
David Green [Thu, 16 Jul 2020 12:37:57 +0000 (13:37 +0100)]
[BasicAA] Add additional negative phi tests. NFC
Petar Avramovic [Thu, 16 Jul 2020 14:31:57 +0000 (16:31 +0200)]
AMDGPU/GlobalISel: Legalize s64->s16 G_SITOFP/G_UITOFP
Add widenScalar for TypeIdx == 0 for G_SITOFP/G_UITOFP.
Legailize, using widenScalar, as s64->s32 G_SITOFP/G_UITOFP
followed by s32->s16 G_FPTRUNC.
Differential Revision: https://reviews.llvm.org/D83880
Joachim Protze [Thu, 16 Jul 2020 14:15:21 +0000 (16:15 +0200)]
[TSan] Optimize handling of racy address
This patch splits the handling of racy address and racy stack into separate
functions. If a race was already reported for the address, we can avoid the
cost for collecting the involved stacks.
This patch also removes the race condition in storing the racy address / racy
stack. This race condition allowed all threads to report the race.
This patch changes the transitive suppression of reports. Previously
suppression could transitively chain memory location and racy stacks.
Now racy memory and racy stack are separate suppressions.
Commit again, now with fixed tests.
Reviewed by: dvyukov
Differential Revision: https://reviews.llvm.org/D83625
Jay Foad [Thu, 16 Jul 2020 12:10:09 +0000 (13:10 +0100)]
[PowerPC] Precommit 64-bit funnel shift test cases
Sjoerd Meijer [Thu, 16 Jul 2020 12:11:30 +0000 (13:11 +0100)]
[Matrix] Add the matrix test from D83570. NFC.
Florian Hahn [Thu, 16 Jul 2020 11:08:54 +0000 (12:08 +0100)]
[SCCP] Only track returns of functions with non-void ret ty (NFC).
There is no need to add functions with void return types to the set of
tracked return values. This does not change functionality, because we
such functions do not have return values and we never update or access
them.
James Y Knight [Thu, 16 Jul 2020 14:01:52 +0000 (10:01 -0400)]
Remove TwoAddressInstructionPass::sink3AddrInstruction.
This function has a bug which will incorrectly reschedule instructions
after an INLINEASM_BR (which can branch). (The bug may also allow
scheduling past a throwing-CALL, I'm not certain.)
I could fix that bug, but, as the removed FIXME notes, it's better to
attempt rescheduling before converting to 3-addr form, as that may
remove the need to convert in the first place. In fact, the code to do
such reordering was added to this pass only a few months later, in
2011, via the addition of the function rescheduleMIBelowKill. That
code does not contain the same bug.
The removal of the sink3AddrInstruction function is not a no-op: in
some cases it would move an instruction post-conversion, when
rescheduleMIBelowKill would not move the instruction pre-converison.
However, this does not appear to be important: the machine instruction
scheduler can reorder the after-conversion instructions, in any case.
This patch fixes a kernel panic 4.4 LTS x86_64 Linux kernels, when
built with clang after
4b0aa5724feaa89a9538dcab97e018110b0e4bc3.
Link: https://github.com/ClangBuiltLinux/linux/issues/1085
Differential Revision: https://reviews.llvm.org/D83708
Frederik Gossen [Thu, 16 Jul 2020 13:57:56 +0000 (13:57 +0000)]
[MLIR][Shape] Use callback builder again
The issue that callback builders caused during rollback of conversion patterns
has been resolved. We can use them again.
See https://bugs.llvm.org/show_bug.cgi?id=46731
Differential Revision: https://reviews.llvm.org/D83932