Daniel Rodríguez Troitiño [Thu, 15 Jul 2021 21:37:33 +0000 (14:37 -0700)]
[test] Use double pound to denote comments.
Use double pound at the start of the line to differentiate comments from
statements for Lit or FileCheck.
I will also use this small commit to check my commit access.
Differential Revision: https://reviews.llvm.org/D106103
Weiwei Li [Thu, 15 Jul 2021 23:25:56 +0000 (07:25 +0800)]
[mlir][spirv] Add support for GLSL FMix
Add spv.GLSL.FMix opertaion.
co-authered-by: Alan Liu <alanliu.yf@gmail.com>
Reviewed By: mravishankar
Differential Revision: https://reviews.llvm.org/D104153
Vincent Lee [Sat, 10 Jul 2021 00:25:29 +0000 (17:25 -0700)]
[lld-macho] Use intermediate arrays to store opcodes
We want to incorporate some of the optimization passes in bind opcodes from ld64.
This revision makes no functional changes but to start storing opcodes in intermediate
containers in preparation for implementing the optimization passes in a follow-up revision.
Differential Revision: https://reviews.llvm.org/D105866
Kirill Stoimenov [Thu, 15 Jul 2021 20:53:56 +0000 (13:53 -0700)]
[asan] Slightly modified the documentation.
The goal of this change is to test if I can commit changes.
Reviewed By: kcc
Differential Revision: https://reviews.llvm.org/D106101
Nico Weber [Thu, 15 Jul 2021 23:29:04 +0000 (19:29 -0400)]
Revert "tsan: make obtaining current PC faster"
This reverts commit
e33446ea58b8357dd8b79eb39140a1de2baff1ae.
Doesn't build on mac, and causes other problems. See reports
on https://reviews.llvm.org/D106046 and https://reviews.llvm.org/D106081
Also revert follow-up "tsan: strip top inlined internal frames"
This reverts commit
7b302fc9b04c7991cdb869b65316e0d72e41042e.
Matt Arsenault [Thu, 15 Jul 2021 16:29:50 +0000 (12:29 -0400)]
GlobalISel: Surface offsets parameter from ComputeValueVTs
Matt Arsenault [Thu, 15 Jul 2021 16:16:15 +0000 (12:16 -0400)]
AMDGPU/GlobalISel: Fix incorrect memory types in test
Matt Arsenault [Wed, 14 Jul 2021 18:03:18 +0000 (14:03 -0400)]
GlobalISel: Track argument pointeriness with arg flags
Since we're still building on top of the MVT based infrastructure, we
need to track the pointer type/address space on the side so we can end
up with the correct pointer LLTs when interpreting CCValAssigns.
Peter S. Housel [Thu, 15 Jul 2021 22:42:28 +0000 (00:42 +0200)]
[lldb] Add AllocateMemory/DeallocateMemory to the SBProcess API
This change adds AllocateMemory and DeallocateMemory methods to the SBProcess
API, so that clients can allocate and deallocate memory blocks within the
process being debugged (for storing JIT-compiled code or other uses).
(I am developing a debugger + REPL using the API; it will need to store
JIT-compiled code within the target.)
Reviewed By: clayborg, jingham
Differential Revision: https://reviews.llvm.org/D105389
Vitaly Buka [Thu, 15 Jul 2021 22:16:29 +0000 (15:16 -0700)]
[NFC][hwasan] Remove default arguments in internal class
Victor Huang [Thu, 15 Jul 2021 22:21:54 +0000 (17:21 -0500)]
[PowerPC] Add PowerPC population count, reversed load and store related builtins and instrinsics for XL compatibility
This patch is in a series of patches to provide builtins for compatibility
with the XL compiler. This patch adds the builtins and instrisics for population
count, reversed load and store related operations.
Reviewed By: nemanjai, #powerpc
Differential revision: https://reviews.llvm.org/D106021
Shilei Tian [Thu, 15 Jul 2021 22:23:12 +0000 (18:23 -0400)]
[AbstractAttributor] Fold function calls to `__kmpc_is_spmd_exec_mode` if possible
In the device runtime there are many function calls to `__kmpc_is_spmd_exec_mode`
to query the execution mode of current kernels. In many cases, user programs
only contain target region executing in one mode. As a consequence, those runtime
function calls will only return one value. If we can get rid of these function
calls during compliation, it can potentially improve performance.
In this patch, we use `AAKernelInfo` to analyze kernel execution. Basically, for
each kernel (device) function `F`, we collect all kernel entries `K` that can
reach `F`. A new AA, `AAFoldRuntimeCall`, is created for each call site. In each
iteration, it will check all reaching kernel entries, and update the folded value
accordingly.
In the future we will support more function.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D105787
Amara Emerson [Fri, 9 Jul 2021 22:48:47 +0000 (15:48 -0700)]
GlobalISel: Introduce GenericMachineInstr classes and derivatives for idiomatic LLVM RTTI.
This adds some level of type safety, allows helper functions to be added for
specific opcodes for free, and also allows us to succinctly check for class
membership with the usual dyn_cast/isa/cast functions.
To start off with, add variants for the different load/store operations with some
places using it.
Differential Revision: https://reviews.llvm.org/D105751
Roland McGrath [Thu, 15 Jul 2021 22:07:07 +0000 (15:07 -0700)]
[libc] Fix typos in x86_64/FEnv.h
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D106105
Omar Emara [Thu, 15 Jul 2021 21:33:30 +0000 (14:33 -0700)]
[LLDB][GUI] Add Process Attach form
This patch adds a form window to attach a process, either by PID or by
name. This patch also adds support for dynamic field visibility such
that the form delegate can hide or show certain fields based on some
conditions.
Reviewed By: clayborg
Differential Revision: https://reviews.llvm.org/D105655
Eli Friedman [Thu, 15 Jul 2021 20:49:13 +0000 (13:49 -0700)]
[DependenceAnalysis] Guard analysis using getPointerBase().
D104806 broke some uses of getMinusSCEV() in DependenceAnalysis:
subtraction with different pointer bases returns a SCEVCouldNotCompute.
Make sure we avoid cases involving such subtractions.
Differential Revision: https://reviews.llvm.org/D106099
Harald van Dijk [Thu, 15 Jul 2021 21:56:08 +0000 (22:56 +0100)]
[X86] Fix handling of maskmovdqu in X32
The maskmovdqu instruction is an odd one: it has a 32-bit and a 64-bit
variant, the former using EDI, the latter RDI, but the use of the
register is implicit. In 64-bit mode, a 0x67 prefix can be used to get
the version using EDI, but there is no way to express this in
assembly in a single instruction, the only way is with an explicit
addr32.
This change adds support for the instruction. When generating assembly
text, that explicit addr32 will be added. When not generating assembly
text, it will be kept as a single instruction and will be emitted with
that 0x67 prefix. When parsing assembly text, it will be re-parsed as
ADDR32 followed by MASKMOVDQU64, which still results in the correct
bytes when converted to machine code.
The same applies to vmaskmovdqu as well.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D103427
Sanjay Patel [Thu, 15 Jul 2021 20:47:51 +0000 (16:47 -0400)]
[SLP] avoid leaking poison in reduction of safe boolean logic ops
This bug was introduced with D105730 /
25ee55c0baff .
If we are not converting all of the operations of a reduction
into a vector op, we need to preserve the existing select form
of the remaining ops. Otherwise, we are potentially leaking
poison where it did not in the original code.
Alive2 agrees that the version that freezes some inputs
and then falls back to scalar is correct:
https://alive2.llvm.org/ce/z/erF4K2
Nikita Popov [Thu, 15 Jul 2021 18:34:56 +0000 (20:34 +0200)]
[Verifier] Extend address taken check for unknown intrinsics
Intrinsics can only be called directly, taking their address is not
legal. This is currently only enforced for intrinsics that have an
ID, rather than all intrinsics. Adjust the check to cover all
intrinsics.
This came up in D106013.
Differential Revision: https://reviews.llvm.org/D106095
Victor Huang [Thu, 15 Jul 2021 21:06:59 +0000 (16:06 -0500)]
[PowerPC][NFC] Add the missing 'REQUIRES: powerpc-registered-target.' in the builtins' front end test cases for XL compatibility
Sumesh Udayakumaran [Thu, 15 Jul 2021 01:42:39 +0000 (04:42 +0300)]
[mlir] Enable cleanup of single iteration reduction loops being sibling-fused maximally
Changes include the following:
1. Single iteration reduction loops being sibling fused at innermost insertion level
are skipped from being considered as sequential loops.
Otherwise, the slice bounds of these loops is reset.
2. Promote loops that are skipped in previous step into outer loops.
3. Two utility function - buildSliceTripCountMap, getSliceIterationCount - are moved from
mlir/lib/Transforms/Utils/LoopFusionUtils.cpp to mlir/lib/Analysis/Utils.cpp
Reviewed By: bondhugula, vinayaka-polymage
Differential Revision: https://reviews.llvm.org/D104249
Jessica Paquette [Wed, 14 Jul 2021 00:42:00 +0000 (17:42 -0700)]
[AArch64][GlobalISel] Clamp <n x p0> vecs when legalizing G_EXTRACT_VECTOR_ELT
This case was missing from G_EXTRACT_VECTOR_ELT. It's the same as for s64.
https://godbolt.org/z/Tnq4acY8z
Differential Revision: https://reviews.llvm.org/D105952
zhijian [Thu, 15 Jul 2021 20:54:22 +0000 (16:54 -0400)]
[AIX][XCOFF][Bug-Fixed] parse the parameter type of the traceback table
Summary:
in the function PPCFunctionInfo::getParmsType(), there is if (Bits > 31 || (Bits > 30 && (Elt != FixedType || hasVectorParms())))
when the Bit is 31 and the Elt is not FixedType(for example the Elt is FloatingType) , the 31th bit will be not encoded, it leave the bit as zero, when the function Expected<SmallString<32>> XCOFF::parseParmsType() the original implement
**// unsigned ParmsNum = FixedParmsNum + FloatingParmsNum;
while (Bits < 32 && ParsedNum < ParmsNum) {
...
}//**
it will look the 31 bits (zero) as FixedType. which should be FloatingType, and get a error.
Reviewers: Jason Liu,ZarkoCA
Differential Revision: https://reviews.llvm.org/D105023
Louis Dionne [Thu, 15 Jul 2021 17:02:43 +0000 (13:02 -0400)]
[runtimes] Don't try passing --target flags to GCC
When a target triple is specified in CMake via XXX_TARGET_TRIPLE, we tried
passing the --target=<...> flag to the compiler. However, not all compilers
support that flag (e.g. GCC, which is not a cross-compiler). As a result,
setting e.g. LIBCXX_TARGET_TRIPLE=<host-triple> would end up trying to
pass --target=<host-triple> to GCC, which breaks everything because the
flag isn't even supported.
This commit only adds `--target=<...>` & friends to the flags if it is
supported by the compiler.
One could argue that it's confusing to pass LIBCXX_TARGET_TRIPLE=<...>
and have it be ignored. That's correct, and one possibility would be
to assert that the requested triple is the same as the host triple when
we know the compiler is unable to cross-compile. However, note that this
is a pre-existing issue (setting the TARGET_TRIPLE variable never had an
influence on the flags passed to the compiler), and also fixing that is
starting to look like reimplementing a lot of CMake logic that is already
handled with CMAKE_CXX_COMPILER_TARGET.
Differential Revision: https://reviews.llvm.org/D106082
Martin Storsjö [Tue, 13 Jul 2021 12:49:19 +0000 (12:49 +0000)]
[libcxx] [test] Fix mismatches between aligned operator new and std::free
The XFAIL comments about VCRuntime not providing aligned operator new
are outdated; these days VCRuntime does provide them.
However, the tests used to fail on Windows, as the pointers allocated
with an aligned operator new (which is implemented with _aligned_malloc
on Windows) can't be freed using std::free() on Windows (but they need
to be freed with the corresponding function _aligned_free instead).
Instead override the aligned operator new to return a dummy suitably
aligned pointer instead, like other tests that override aligned operator
new.
Also override `operator delete[]` instead of plain `operator delete`
in the array testcase; the fallback from `operator delete[]` to
user defined `operator delete` doesn't work in all DLL build
configurations on Windows.
Also expand the TEST_NOEXCEPT macros, as these tests only are built
in C++17 mode.
By providing the aligned operator new within the tests, this also makes
these test cases pass when testing back deployment on macOS 10.9.
Differential Revision: https://reviews.llvm.org/D105962
Hedin Garca [Thu, 15 Jul 2021 18:13:10 +0000 (18:13 +0000)]
[libc] Relocate the closing directive of #ifdef
Changed where an #endif was placed because previously it
prevented three macro definitions from being enable in Windows.
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D106087
Nikita Popov [Thu, 15 Jul 2021 20:06:39 +0000 (22:06 +0200)]
[ObjCARC] Use objc_msgSend instead of llvm.objc.msgSend in tests
D55348 replaced @objc_msgSend with @llvm.objc.msgSend in tests
together with many other objc intrinsics. However, this is not a
recognized objc intrinsic (https://llvm.org/docs/LangRef.html#objective-c-arc-runtime-intrinsics)
and does not receive special treatment by LLVM. It's likely that
uses of this function were renamed by accident.
This came up in D106013, because the address of @llvm.objs.msgSend
is taken, something which is normally not allowed for intrinsics.
Differential Revision: https://reviews.llvm.org/D106094
George Burgess IV [Thu, 15 Jul 2021 20:03:27 +0000 (13:03 -0700)]
utils: fix broken assertion in revert_checker
`intermediate_commits` is a list of full SHAs, and `across_ref` may/may
not be a full SHA (or a SHA at all). We already have `across_sha`, which
is the resolved form of `across_ref`, so use that instead.
Thanks to probinson for catching this in post-commit review of
https://reviews.llvm.org/D105578!
Harald van Dijk [Thu, 15 Jul 2021 19:52:25 +0000 (20:52 +0100)]
[Driver] Fix compiler-rt lookup for x32
x86_64-linux-gnu and x86_64-linux-gnux32 use different ABIs and objects
built for one cannot be used for the other. In order to build and use
compiler-rt for x32, we need to treat x32 as a new arch there. This
updates the driver to search using the new arch name.
Reviewed By: glaubitz
Differential Revision: https://reviews.llvm.org/D100148
Aart Bik [Thu, 15 Jul 2021 18:06:40 +0000 (11:06 -0700)]
[mlir][sparse] add int64 storage type to sparse tensor runtime support library
This format was missing from the support library. Although there are some
subtleties reading in an external format for int64 as double, there is no
good reason to omit support for this data type form the support library.
Reviewed By: gussmith23
Differential Revision: https://reviews.llvm.org/D106016
Artem Belevich [Sat, 3 Jul 2021 00:02:07 +0000 (17:02 -0700)]
[NVPTX, CUDA] Add .and.popc variant of the b1 MMA instruction.
That should allow clang to compile mma.h from CUDA-11.3.
Differential Revision: https://reviews.llvm.org/D105384
Sushma Unnibhavi [Thu, 15 Jul 2021 19:00:14 +0000 (13:00 -0600)]
[M68k][GloballSel] LegalizerInfo implementation
Added rules for G_ADD, G_SUB, G_MUL, G_UDIV to be legal.
Differential Revision: https://reviews.llvm.org/D105536
Dmitry Vyukov [Thu, 15 Jul 2021 09:18:53 +0000 (11:18 +0200)]
tsan: lock ScopedErrorReportLock around fork
Currently we don't lock ScopedErrorReportLock around fork
and it mostly works becuase tsan has own report_mtx that
is locked around fork and tsan reports.
However, sanitizer_common code prints some own reports
which are not protected by tsan's report_mtx. So it's better
to lock ScopedErrorReportLock explicitly.
Reviewed By: melver
Differential Revision: https://reviews.llvm.org/D106048
Philip Reames [Thu, 15 Jul 2021 17:59:02 +0000 (10:59 -0700)]
[unittest] Exercise SCEV's udiv and udiv ceiling routines
The ceiling variant was recently added (due to the work towards D105216), and we're spending a lot of time trying to find optimizations for the expression. This patch brute forces the space of i8 unsigned divides and checks that we get a correct (well consistent with APInt) result for both udiv and udiv ceiling.
(This is basically what I've been doing locally in a hand rolled C++ program, and I realized there no good reason not to check it in as a unit test which directly exercises the logic on constants.)
Differential Revision: https://reviews.llvm.org/D106083
Louis Dionne [Thu, 15 Jul 2021 13:43:47 +0000 (09:43 -0400)]
[libc++/abi] Fix broken Lit feature no-noexcept-function-type
The feature was always defined, which means that the two test cases
guarded by it were never run.
Differential Revision: https://reviews.llvm.org/D106062
Fangrui Song [Thu, 15 Jul 2021 18:31:11 +0000 (11:31 -0700)]
[ELF] Don't define __rela_iplt_start for -pie/-shared
`clang -fuse-ld=lld -static-pie -fpie` produced executable
currently crashes and this patch makes it work.
See https://sourceware.org/bugzilla/show_bug.cgi?id=27164
and https://sourceware.org/pipermail/libc-alpha/2021-July/128810.html
While it seems unreasonable to keep csu/libc-start.c ARCH_APPLY_IREL unclear in
static-pie mode and have an unneeded diff -u =(ld.bfd --verbose) =(ld.bfd -pie
--verbose) difference, glibc folks don't want to fix their code.
I feel sad about that but this patch can remove an iffy condition for lld/ELF
as well: `needsInterpSection()`.
Fangrui Song [Thu, 15 Jul 2021 18:16:35 +0000 (11:16 -0700)]
[ELF][test] Rework non-preemptible ifunc tests
Nikita Popov [Thu, 15 Jul 2021 18:27:52 +0000 (20:27 +0200)]
[Verifier] Use isIntrinsic() (NFC)
Call Function::isIntrinsic() instead of manually checking the
function name for an "llvm." prefix.
Simon Pilgrim [Thu, 15 Jul 2021 18:20:27 +0000 (19:20 +0100)]
[InstCombine] Add select(cond,gep(gep(x,y),z),gep(x,y)) tests from PR51069
Sam Tebbs [Mon, 5 Jul 2021 15:08:58 +0000 (16:08 +0100)]
[ARM][LowOverheadLoops] Make some stack spills valid for tail predication
This patch makes vector spills valid for tail predication when all loads
from the same stack slot are within the loop
Differential Revision: https://reviews.llvm.org/D105443
Quinn Pham [Thu, 15 Jul 2021 13:35:07 +0000 (08:35 -0500)]
[PowerPC] Fix popcntb XL Compat Builtin for 32bit
This patch implements the `__popcntb` XL compatibility builtin for 32bit in the frontend and backend. This patch also updates tests for `__popcntb` and other XL Compat sync related builtins.
Reviewed By: #powerpc, nemanjai, amyk
Differential Revision: https://reviews.llvm.org/D105360
Simon Pilgrim [Thu, 15 Jul 2021 17:50:06 +0000 (18:50 +0100)]
Fix "unknown pragma 'GCC'" MSVC warning. NFCI.
Simon Pilgrim [Thu, 15 Jul 2021 17:48:56 +0000 (18:48 +0100)]
[InstCombine] Add 3-operand gep test with different ptr and same indices
Dmitry Vyukov [Thu, 15 Jul 2021 17:08:35 +0000 (19:08 +0200)]
tsan: strip top inlined internal frames
The new GET_CURRENT_PC() can lead to spurious top inlined internal frames.
Here are 2 examples from bots, in both cases the malloc is supposed to be
the top frame (#0):
WARNING: ThreadSanitizer: signal-unsafe call inside of a signal
#0 __sanitizer::StackTrace::GetNextInstructionPc(unsigned long)
#1 malloc
Location is heap block of size 99 at 0xbe3800003800 allocated by thread T1:
#0 __sanitizer::StackTrace::GetNextInstructionPc(unsigned long)
#1 malloc
Let's strip these internal top frames from reports.
With other code changes I also observed some top frames
from __tsan::ScopedInterceptor, proactively remove these as well.
Differential Revision: https://reviews.llvm.org/D106081
Philip Reames [Thu, 15 Jul 2021 17:25:06 +0000 (10:25 -0700)]
[SCEV] Fix unsound reasoning in howManyLessThans
This is split from D105216, it handles only a subset of the cases in that patch.
Specifically, the issue being fixed is that the code incorrectly assumed that (Start-Stide) < End implied that the backedge was taken at least once. This is not true when e.g. Start = 4, Stride = 2, and End = 3. Note that we often do produce the right backedge taken count despite the flawed reasoning.
The fix chosen here is to use an alternate form of uceil (ceiling of unsigned divide) lowering which is safe when max(RHS,Start) > Start - Stride. (Note that signedness of both max expression and comparison depend on the signedness of the comparison being analyzed, and that overflow in the Start - Stride expression is allowed.) Note that this is weaker than proving the backedge is taken because it allows start - stride < end < start. Some cases which can't be proven safe are sent down the generic path, and we do end up generating less optimal expressions in a few cases.
Credit for coming up with the approach goes entirely to Eli. I just split it off, tweaked the comments a bit, and did some additional testing.
Differential Revision: https://reviews.llvm.org/D105942
Louis Dionne [Thu, 15 Jul 2021 17:29:47 +0000 (13:29 -0400)]
[libc++] NFC: Reindent the run-buildbot script
Fangrui Song [Thu, 15 Jul 2021 17:26:21 +0000 (10:26 -0700)]
[test] Avoid llvm-readelf/llvm-readobj one-dash long options and deprecated aliases (e.g. --file-headers)
Vy Nguyen [Tue, 13 Jul 2021 17:27:09 +0000 (13:27 -0400)]
[llvm-exegesis] Fix missing-headers build errors.
Details:
Switch all #includes to use <> because that is consistent with what happens in the cmake checks.
Otherwise, we could be in the situation where cmake checks see that headers exist at <perfmon/...>
but in llvm-exegesis code, we use "perfmon/...", which may not exist.
Related PR/revisions: D84076, PR51017+D105615
Differential Revision: https://reviews.llvm.org/D105861
Arthur Eubanks [Thu, 15 Jul 2021 17:15:51 +0000 (10:15 -0700)]
Revert "[SLP]Workaround for InsertSubVector cost."
This reverts commit
2eb50baf059648214cb1c624b5269978a62e86a1.
Causes hangs, see comments on D105827.
Jessica Paquette [Thu, 15 Jul 2021 16:56:14 +0000 (09:56 -0700)]
[GlobalISel] Fix infinite loop in reassociationCanBreakAddressingModePattern
It didn't update the opcode while walking through G_INTTOPTR/G_PTRTOINT.
Differential Revision: https://reviews.llvm.org/D106080
Wouter van Oortmerssen [Tue, 13 Jul 2021 00:18:39 +0000 (17:18 -0700)]
[WebAssembly] Fixed LLD generation of 64-bit __wasm_apply_data_relocs
Differential Revision: https://reviews.llvm.org/D105863
Leonard Grey [Thu, 15 Jul 2021 16:56:13 +0000 (12:56 -0400)]
[lld-macho] Add LTO cache support
This adds support for the lld-only `--thinlto-cache-policy` option, as well as
implementations for ld64's `-cache_path_lto`, `-prune_interval_lto`,
`-prune_after_lto`, and `-max_relative_cache_size_lto`.
Test is adapted from lld/test/ELF/lto/cache.ll
Differential Revision: https://reviews.llvm.org/D105922
Stanislav Mekhanoshin [Wed, 7 Jul 2021 17:57:56 +0000 (10:57 -0700)]
[AMDGPU] Refine -O0 and -O1 passes.
Differential Revision: https://reviews.llvm.org/D105579
Fangrui Song [Thu, 15 Jul 2021 16:50:37 +0000 (09:50 -0700)]
[llvm-nm] Remove one-dash long options except -arch
The documentation and help messages have recommended the double-dash forms for
quite a while. Remove one-dash long options which are not recognized by GNU
style `getopt_long`.
`-arch` is kept as it is in the manpage of classic nm
https://keith.github.io/xcode-man-pages/nm.1.html
Note: the dyldinfo related options don't have a test.
Reviewed By: jhenderson
Differential Revision: https://reviews.llvm.org/D105948
Fangrui Song [Thu, 15 Jul 2021 16:45:46 +0000 (09:45 -0700)]
[test] Avoid llvm-nm one-dash long options
Aart Bik [Wed, 14 Jul 2021 18:07:39 +0000 (11:07 -0700)]
[mlir][sparse] add shift ops support
Arbitrary shifts have some complications, but shift by invariants
(viz. tensor index exp only at left hand side) can be easily
handled with the conjunctive rule.
Reviewed By: gussmith23
Differential Revision: https://reviews.llvm.org/D106002
Andrzej Warzynski [Thu, 15 Jul 2021 10:36:33 +0000 (11:36 +0100)]
[flang][driver] Randomise the names of the unparsed files
This patch makes sure that the base name of the temporary unparsed files
(generated by the `flang` bash script) are randomised and unique to a
particular invocation of the script. Otherwise, we cannot reliably run
the script in parallel.
Differential Revision: https://reviews.llvm.org/D106052
Andrzej Warzynski [Tue, 13 Jul 2021 10:54:37 +0000 (10:54 +0000)]
Enable Flang by default in the test-release.sh script
I've also brought this up on llvm-dev:
https://lists.llvm.org/pipermail/llvm-dev/2021-July/151744.html
Differential Revision: https://reviews.llvm.org/D105885
Aart Bik [Thu, 15 Jul 2021 15:40:31 +0000 (08:40 -0700)]
[mlir][sparse] remove linalg-to-loops from integration tests
With the migration from linalg.copy to memref.copy, this pass
(which was there solely to handle the linalg.copy op) is no
longer required for the end-to-end path for sparse compilation.
Reviewed By: ftynse
Differential Revision: https://reviews.llvm.org/D106073
Louis Dionne [Thu, 15 Jul 2021 14:19:39 +0000 (10:19 -0400)]
[libc++] Add a CMake target to re-generate files and revamp CONTRIBUTING.rst
As we automate more and more things in the library, it becomes useful for
contributors to have a single target for running all the automation as
part of their workflow. This commit adds a new `libcxx-generate-files`
target that should re-generate all the auto-generated files in the library.
As a fly-by, I also revamped the documentation on Contributing to account
for this new target and present it as a bullet list of things to check
before committing. I also added a few things that are often overlooked
to that list, such as updating the synopsis and the status files.
Differential Revision: https://reviews.llvm.org/D106067
Nikita Popov [Wed, 7 Jul 2021 20:29:43 +0000 (22:29 +0200)]
[IR] Add elementtype attribute
This implements the elementtype attribute specified in D105407. It
just adds the attribute and the specified verifier rules, but
doesn't yet make use of it anywhere.
Differential Revision: https://reviews.llvm.org/D106008
Nikita Popov [Sun, 4 Jul 2021 13:52:20 +0000 (15:52 +0200)]
[LangRef] Add elementtype attribute
This adds an elementtype(<ty>) attribute, which can be used to
attach an element type to a pointer typed argument. It is similar
to byval/byref in purpose, but unlike those does not carry any
specific semantics by itself. However, certain intrinsics may
require it and interpret it in specific ways.
The in-tree use cases for this that I'm currently aware of are:
call ptr @llvm.preserve.array.access.index.p0.p0(ptr elementtype(%ty) %base, i32 %dim, i32 %index)
call ptr @llvm.preserve.struct.access.index.p0.p0(ptr elementtype(%ty) %base, i32 %gep_index, i32 %di_index)
call token @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr elementtype(void ()) @foo, i32 0, i32 0, i32 0, i32 0, ptr addrspace(1) %obj)
Notably, the gc.statepoint case needs a function as element type,
in which case the workaround of adding a separate %ty undef
argument would not work, as arguments cannot be unsized.
Differential Revision: https://reviews.llvm.org/D105407
Arthur Eubanks [Wed, 14 Jul 2021 20:56:59 +0000 (13:56 -0700)]
[InstCombine] Look through invariant group intrinsics when removing malloc
Fixes some regressions with -fstrict-vtable-pointers in llvm-test-suite.
Reviewed By: lebedev.ri
Differential Revision: https://reviews.llvm.org/D106017
Geoffrey Martin-Noble [Thu, 15 Jul 2021 15:57:43 +0000 (08:57 -0700)]
[Bazel] Update for
01bdb0f75efb
Update the build files for
https://github.com/llvm/llvm-project/commit/
01bdb0f75efb
Tested:
bazel query //... + @llvm-project//... | xargs bazel test --config=generic_clang --config=rbe --test_output=errors --test_ta
g_filters=-nobuildkite --build_tag_filters=-nobuildkite
Differential Revision: https://reviews.llvm.org/D106075
Philip Reames [Thu, 15 Jul 2021 15:52:52 +0000 (08:52 -0700)]
[LV] Enable vectorization of multiple exit loops w/computable exit counts
This change enables vectorization of multiple exit loops when the exit count is statically computable. That requirement - shared with the rest of LV - in turn requires each exit to be analyzeable and to dominate the latch.
The majority of work to support this was done in a set of previous patches. In particular,,
72314466 avoids having multiple edges from the middle block to the exits, and
4b33b2387 which added support for non-latch single exit and multiple exits with a single exiting block. As a result, this change is basically just removing a bailout and adjusting some tests now that the prerequisite work is done and has stuck in tree for a bit.
Differential Revision: https://reviews.llvm.org/D105817
Nikita Popov [Tue, 13 Jul 2021 20:14:55 +0000 (22:14 +0200)]
[AsmParser] Unify parsing of attributes
Continuing on from D105780, this should be the last major bit of
attribute cleanup. Currently, LLParser implements attribute parsing
for functions, parameters and returns separately, enumerating all
supported (and unsupported) attributes each time. This patch
extracts the common parsing logic, and performs a check afterwards
whether the attribute is valid in the given position. Parameters
and returns are handled together, while function attributes need
slightly different logic to support attribute groups.
Differential Revision: https://reviews.llvm.org/D105938
Dmitry Vyukov [Thu, 15 Jul 2021 08:51:32 +0000 (10:51 +0200)]
tsan: make obtaining current PC faster
We obtain the current PC is all interceptors and collectively
common interceptor code contributes to overall slowdown
(in particular cheaper str/mem* functions).
The current way to obtain the current PC involves:
4493e1: e8 3a f3 fe ff callq 438720 <_ZN11__sanitizer10StackTrace12GetCurrentPcEv>
4493e9: 48 89 c6 mov %rax,%rsi
and the called function is:
uptr StackTrace::GetCurrentPc() {
438720: 48 8b 04 24 mov (%rsp),%rax
438724: c3 retq
The new way uses address of a local label and involves just:
44a888: 48 8d 35 fa ff ff ff lea -0x6(%rip),%rsi
I am not switching all uses of StackTrace::GetCurrentPc to GET_CURRENT_PC
because it may lead some differences in produced reports and break tests.
The difference comes from the fact that currently we have PC pointing
to the CALL instruction, but the new way does not yield any code on its own
so the PC points to a random instruction in the function and symbolizing
that instruction can produce additional inlined frames (if the random
instruction happen to relate to some inlined function).
Reviewed By: melver
Differential Revision: https://reviews.llvm.org/D106046
Victor Huang [Thu, 15 Jul 2021 15:22:36 +0000 (10:22 -0500)]
[PowerPC] Add PowerPC rotate related builtins and emit target independent code for XL compatibility
This patch is in a series of patches to provide builtins for compatibility
with the XL compiler. This patch adds the builtins and emit target independent
code for rotate related operations.
Reviewed By: nemanjai, #powerpc
Differential revision: https://reviews.llvm.org/D104744
Shilei Tian [Thu, 15 Jul 2021 15:19:28 +0000 (11:19 -0400)]
Revert "[AbstractAttributor] Fold function calls to `__kmpc_is_spmd_exec_mode` if possible"
This reverts commit
1100e4aafea233bc8bbc307c5758a7d287ad3bae.
Simon Pilgrim [Thu, 15 Jul 2021 15:08:09 +0000 (16:08 +0100)]
[DAG] Fold select(cond,binop(x,y),binop(x,z)) -> binop(x,select(cond,y,z))
Similar to the folds performed in InstCombinerImpl::foldSelectOpOp, this attempts to push a select further up to help merge a pair of binops.
I'm primarily interested in select(cond,add(x,y),add(x,z)) folds to help expose pointer math (see https://bugs.llvm.org/show_bug.cgi?id=51069 etc.) but I've tried to use the more generic isBinOp().
Differential Revision: https://reviews.llvm.org/D106058
Aart Bik [Thu, 15 Jul 2021 05:58:21 +0000 (22:58 -0700)]
[mlir][sparse] replace linalg.copy with memref.copy
Note, this revision relies on the following revision
for a bugfix in the memref copy library in order for
all sparse integration tests to pass.
https://reviews.llvm.org/D106036
Reviewed By: ftynse
Differential Revision: https://reviews.llvm.org/D106038
Simon Pilgrim [Thu, 15 Jul 2021 14:42:11 +0000 (15:42 +0100)]
[NVPTX] Tweak fast-math tests to avoid select(binop(x,y),binop(x,z)) fold
As suggested on D106058, tweak the tests to keep the combineRepeatedFPDivisors test coverage.
Gabor Marton [Thu, 15 Jul 2021 13:45:58 +0000 (15:45 +0200)]
[Analyzer][solver] Remove unused functions
../../git/llvm-project/clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:2395:17: warning: 'clang::ento::ProgramStateRef {anonymous}::RangeConstraintManager::setRange(clang::ento::ProgramStateRef, {anonymous}::EquivalenceClass, clang::ento::RangeSet)' defined but not used [-Wunused-function]
../../git/llvm-project/clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:2384:10: warning: 'clang::ento::RangeSet {anonymous}::RangeConstraintManager::getRange(clang::ento::ProgramStateRef, {anonymous}::EquivalenceClass)' defined but not used [-Wunused-function]
Differential Revision: https://reviews.llvm.org/D106063
Sander de Smalen [Thu, 15 Jul 2021 14:20:44 +0000 (15:20 +0100)]
Revert "[LV] Print remark when loop cannot be vectorized due to invalid costs."
This reverts commit
efaf3099c8cec1954831ee28a2f75a72096f50eb.
This reverts commit
dc7bdc1e7121693df112f2fdb11cc6b88580ba4b.
Reverting patches due to buildbot failures.
Anton Zabaznov [Thu, 15 Jul 2021 10:02:47 +0000 (13:02 +0300)]
[OpenCL] Add support of __opencl_c_program_scope_global_variables feature macro
Reviewed By: Anastasia
Differential Revision: https://reviews.llvm.org/D103191
Tim Northover [Thu, 15 Jul 2021 14:03:43 +0000 (15:03 +0100)]
MachO: fix Clang test broken by dropping private labels in LLVM.
LLVM changed to not emit L... labels for things marked "do_not_dead_strip"
because the linker can sometimes drop the flag if there's no proper symbol.
This Clang test checked for the old behaviour, but doesn't actually care about
that bit.
Nathan Sidwell [Mon, 12 Jul 2021 15:54:51 +0000 (08:54 -0700)]
[docs] More CMAKE variable documentation
This breaks out some (more) common llvm-specific
variables. Controlling the subprojects and target architectures, along
with clues about restricting build parallelism when linking. 'more
common' is somewhat subjective, of course.
Differential Revision: https://reviews.llvm.org/D105822
David Green [Thu, 15 Jul 2021 13:47:53 +0000 (14:47 +0100)]
[ARM] Expand types handled in VQDMULH recognition
We have a DAG combine for recognizing the sequence of nodes that make up
an MVE VQDMULH, but only currently handles specifically legal types.
This patch expands that to other power-2 vector types. For smaller than
legal types this means any_extending the type and casting it to a legal
type, using a VQDMULH where we only use some of the lanes. The result is
sign extended back to the original type, to properly set the invalid
lanes. Larger than legal types are split into chunks with extracts and
concat back together.
Differential Revision: https://reviews.llvm.org/D105814
Tim Northover [Thu, 15 Jul 2021 13:21:42 +0000 (14:21 +0100)]
MachO: don't emit L... private symbols in do_not_dead_strip sections.
The linker can sometimes drop the do_not_dead_strip if it can't associate the
atom with a symbol (the other place to specify no dead-stripping in MachO
files).
liuke [Thu, 15 Jul 2021 13:38:05 +0000 (09:38 -0400)]
Fix documentation; NFC
The documentation about ignoringImpCasts is wrong, which can cause
misunderstandings. This patch fixes it.
Roman Lebedev [Thu, 15 Jul 2021 13:25:36 +0000 (16:25 +0300)]
[SimplifyCFG] Rerun PHI deduplication after common code sinkinkg (PR51092)
`SinkCommonCodeFromPredecessors()` doesn't itself ensure that duplicate PHI nodes aren't created.
I suppose, we could teach it to do that on-the-fly (& account for the already-existing PHI nodes,
& adjust costmodel), the diff will be bigger than this.
The alternative is to schedule a new EarlyCSE pass invocation somewhere later in the pipeline.
Clearly, we don't have any EarlyCSE runs in module optimization passline, so this pattern isn't cleaned up...
That would perhaps better, but it will again have some compile time impact.
Reviewed By: RKSimon
Differential Revision: https://reviews.llvm.org/D106010
Adrian Kuegel [Thu, 15 Jul 2021 11:36:42 +0000 (13:36 +0200)]
[mlir][rocdl] Add math::Exp2Op lowering to ROCDL
Differential Revision: https://reviews.llvm.org/D106057
Simon Pilgrim [Thu, 15 Jul 2021 12:27:36 +0000 (13:27 +0100)]
[TTI] Consistently make getMinVectorRegisterBitWidth() methods const. NFCI.
The underlying getMinVectorRegisterBitWidth() methods are const, but it was missed in a couple of TargetTransformInfo wrappers.
Noticed while working on D103925
Sander de Smalen [Thu, 15 Jul 2021 11:22:24 +0000 (12:22 +0100)]
[LV] Fix determinism for failing scalable-call.ll test.
The sort function for emitting an OptRemark was not deterministic,
which caused scalable-call.ll to fail on some buildbots. This patch
fixes that.
This patch also fixes an issue where `Instruction::comesBefore()`
is called when two Instructions are in different basic blocks,
which would otherwise cause an assertion failure.
Nicolas Vasilache [Thu, 15 Jul 2021 09:56:50 +0000 (09:56 +0000)]
[mlir][linalg] Improve implementation of hoist padding.
Instead of relying on adhoc bounds calculations, use a projection-based
implementation. This simplifies the implementation and finds more static
constant sizes than previously/
Differential Revision: https://reviews.llvm.org/D106054
Louis Dionne [Thu, 15 Jul 2021 12:04:00 +0000 (08:04 -0400)]
[libc++] Mark failing rel_ops test as XFAIL in back-deployment
The test triggers availability errors.
Stephen Tozer [Wed, 14 Jul 2021 10:54:38 +0000 (11:54 +0100)]
Reapply "[DebugInfo] Enable variadic debug value salvaging"
Reapplied after previous build failures were fixed in
14b62f7e2.
This reverts commit
540b4a5fb31086b6d40735e96e6ec497022107e7.
Louis Dionne [Mon, 12 Jul 2021 13:55:00 +0000 (09:55 -0400)]
[libc++] Implement views::all_t and ranges::viewable_range
Differential Revision: https://reviews.llvm.org/D105816
Louis Dionne [Wed, 14 Jul 2021 15:36:22 +0000 (11:36 -0400)]
[runtimes] Serialize all Lit params instead of passing them to add_lit_testsuite
add_lit_testsuite() takes Lit parameters passed to it and adds them
to the parameters used globally when running all test suites. That
means that a target like `check-all`, which ends up calling Lit on
the whole monorepo, will see the test parameters for all the individual
project's test suites.
So, for example, it would see `--param std=c++03` (from libc++abi), and
`--param std=c++03` (from libc++), and `--param whatever` (from another
project being tested at the same time). While always unclean, that works
when the parameters all agree. However, if the parameters share the same
name but have different values, only one of those two values will be used
and it will be incredibly confusing to understand why one of the test
suites is being run with the incorrect parameter value.
For that reason, this commit moves away from using add_lit_testsuite()'s
PARAM functionality, and serializes the parameter values for the runtimes
in the generated config.py file instead, which is local to the specific
test suite.
Differential Revision: https://reviews.llvm.org/D105991
Fraser Cormack [Thu, 15 Jul 2021 11:30:32 +0000 (12:30 +0100)]
[VP][NFC] Correct formatting in unit test
Simon Pilgrim [Thu, 15 Jul 2021 11:42:29 +0000 (12:42 +0100)]
[NVPTX] Add selp.f32 checks to select(cond,fpbinop(),fpbinop()) tests
Will help show codegen diffs in an upcoming patch
Simon Pilgrim [Thu, 15 Jul 2021 11:19:10 +0000 (12:19 +0100)]
[InstCombine] Strip inbounds from (select C, (gep Ptr, Idx), Ptr) -> (gep Ptr, (select C, Idx, 0)) fold
As discussed on rGd561b6fbdbe6, we can't guarantee that the new gep is inbounds
Simon Pilgrim [Thu, 15 Jul 2021 11:05:33 +0000 (12:05 +0100)]
[MIPS] Refresh ashr test checks. NFCI.
Adrian Kuegel [Thu, 15 Jul 2021 10:04:25 +0000 (12:04 +0200)]
[mlir][nvvm]: Add math::Exp2Op lowering to NVVM.
Differential Revision: https://reviews.llvm.org/D106050
Irina Dobrescu [Fri, 9 Jul 2021 12:09:06 +0000 (13:09 +0100)]
[AArch64][GlobalISel] Optimise lowering for some vector types for min/max
Differential Revision: https://reviews.llvm.org/D105696
Sebastian Neubauer [Thu, 15 Jul 2021 08:21:33 +0000 (10:21 +0200)]
[AMDGPU] Use isMetaInstruction for instruction size
Meta instructions have a size of 0. Use isMetaInstruction instead of
listing them explicitly.
Differential Revision: https://reviews.llvm.org/D106043
Ilya Leoshkevich [Fri, 2 Jul 2021 00:49:30 +0000 (02:49 +0200)]
[TSan] Add SystemZ SANITIZER_GO support
Define the address ranges (similar to the C/C++ ones, but with the heap
range merged into the app range) and enable the sanity check.
Reviewed By: dvyukov
Differential Revision: https://reviews.llvm.org/D105629
Ilya Leoshkevich [Fri, 2 Jul 2021 00:43:00 +0000 (02:43 +0200)]
[TSan] Enable SystemZ support
Enable building the runtime and enable -fsanitize=thread in clang.
Reviewed By: dvyukov
Differential Revision: https://reviews.llvm.org/D105629
Ilya Leoshkevich [Fri, 2 Jul 2021 00:43:49 +0000 (02:43 +0200)]
[TSan] Adjust tests for SystemZ
XFAIL map32bit, define the maximum possible allocation size in
mmap_large.cpp.
Reviewed By: dvyukov
Differential Revision: https://reviews.llvm.org/D105629
Ilya Leoshkevich [Fri, 2 Jul 2021 14:59:32 +0000 (16:59 +0200)]
[TSan] Intercept __tls_get_addr_internal and __tls_get_offset on SystemZ
Reuse the assembly glue code from sanitizer_common_interceptors.inc and
the handling logic from the __tls_get_addr interceptor.
Reviewed By: dvyukov
Differential Revision: https://reviews.llvm.org/D105629