Siva Chandra Reddy [Mon, 28 Mar 2022 21:11:08 +0000 (21:11 +0000)]
[libc] Set rtlib to compiler-rt in integration tests.
The clang driver to picks up compiler runtime files using full paths.
Without this, at least for aarch64, the driver tries to pick up the
compiler runtime files from the working directory.
Reviewed By: michaelrj
Differential Revision: https://reviews.llvm.org/D122617
LLVM GN Syncbot [Mon, 28 Mar 2022 23:38:54 +0000 (23:38 +0000)]
[gn build] Port
2add3fbd976d
Dominic Chen [Wed, 16 Mar 2022 20:40:58 +0000 (13:40 -0700)]
[scudo] Use cast on calls to __builtin_umul_overflow/__builtin_umull_overflow
Platforms may define uintptr_t differently, so perform an explicit cast
Differential Revision: https://reviews.llvm.org/D121852
Dominic Chen [Fri, 25 Mar 2022 23:44:31 +0000 (16:44 -0700)]
[scudo] Use template specialization on Quarantine to avoid zero-length array
Use a separate templated QuarantineBlocks class to avoid a zero-length array
Differential Revision: https://reviews.llvm.org/D122518
Paul Kirth [Sat, 19 Mar 2022 00:54:23 +0000 (00:54 +0000)]
[misexpect] Re-implement MisExpect Diagnostics
Reimplements MisExpect diagnostics from D66324 to reconstruct its
original checking methodology only using MD_prof branch_weights
metadata.
New checks rely on 2 invariants:
1) For frontend instrumentation, MD_prof branch_weights will always be
populated before llvm.expect intrinsics are lowered.
2) for IR and sample profiling, llvm.expect intrinsics will always be
lowered before branch_weights are populated from the IR profiles.
These invariants allow the checking to assume how the existing branch
weights are populated depending on the profiling method used, and emit
the correct diagnostics. If these invariants are ever invalidated, the
MisExpect related checks would need to be updated, potentially by
re-introducing MD_misexpect metadata, and ensuring it always will be
transformed the same way as branch_weights in other optimization passes.
Frontend based profiling is now enabled without using LLVM Args, by
introducing a new CodeGen option, and checking if the -Wmisexpect flag
has been passed on the command line.
Reviewed By: tejohnson
Differential Revision: https://reviews.llvm.org/D115907
Benjamin Kramer [Mon, 28 Mar 2022 23:21:52 +0000 (01:21 +0200)]
Silence compiler warning after the addition of HLSL to Clang
lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp:472:16: warning: enumeration value 'HLSL' not handled in switch [-Wswitch]
switch (IK.getLanguage()) {
^
Fangrui Song [Mon, 28 Mar 2022 23:23:13 +0000 (16:23 -0700)]
[ELF] --emit-relocs: adjust offsets of .rel[a].eh_frame relocations
.eh_frame pieces may be dropped due to GC/ICF. When --emit-relocs adds
relocations against .eh_frame, the offsets need to be adjusted. Use the same
way as MergeInputSection with a special case handling outSecOff==-1 for an
invalid piece (see eh-frame-marker.s).
This exposes an issue in mips64-eh-abs-reloc.s that we don't reliably
handle anyway. Just add --no-check-dynamic-relocations to paper over it.
Original patch by Ayrton Muñoz
Differential Revision: https://reviews.llvm.org/D122459
Alina Sbirlea [Mon, 28 Mar 2022 23:16:07 +0000 (16:16 -0700)]
Revert
29fada4a3d3db309f11f7fa7a0c61cd4021e9947
Seeing a test failure with asan in Halide generated code, reverting
while I investigate.
Differential Revision: https://reviews.llvm.org/D121987
Fangrui Song [Mon, 28 Mar 2022 22:55:46 +0000 (15:55 -0700)]
[ELF][test] Refactor some .eh_frame tests
* Improve eh-frame-merge.s
* Delete invalid .eh_frame+5 test in ehframe-relocation.s
Jacques Pienaar [Mon, 28 Mar 2022 22:44:40 +0000 (15:44 -0700)]
[mlir] Update Vector dialect to prefixed accessors.
Been >2 weeks since flipped to Both, following update procedure and
flipping to prefixed.
James Y Knight [Mon, 28 Mar 2022 22:27:18 +0000 (18:27 -0400)]
[Clang] Implement __builtin_source_location.
This builtin returns the address of a global instance of the
`std::source_location::__impl` type, which must be defined (with an
appropriate shape) before calling the builtin.
It will be used to implement std::source_location in libc++ in a
future change. The builtin is compatible with GCC's implementation,
and libstdc++'s usage. An intentional divergence is that GCC declares
the builtin's return type to be `const void*` (for
ease-of-implementation reasons), while Clang uses the actual type,
`const std::source_location::__impl*`.
In order to support this new functionality, I've also added a new
'UnnamedGlobalConstantDecl'. This artificial Decl is modeled after
MSGuidDecl, and is used to represent a generic concept of an lvalue
constant with global scope, deduplicated by its value. It's possible
that MSGuidDecl itself, or some of the other similar sorts of things
in Clang might be able to be refactored onto this more-generic
concept, but there's enough special-case weirdness in MSGuidDecl that
I gave up attempting to share code there, at least for now.
Finally, for compatibility with libstdc++'s <source_location> header,
I've added a second exception to the "cannot cast from void* to T* in
constant evaluation" rule. This seems a bit distasteful, but feels
like the best available option.
Reviewers: aaron.ballman, erichkeane
Differential Revision: https://reviews.llvm.org/D120159
Jacques Pienaar [Mon, 28 Mar 2022 22:20:48 +0000 (15:20 -0700)]
[mlir] Update the Builtin dialect to use prefixed accessors
Been >2 weeks since flipped to Both, following update procedure and
flipping to prefixed.
Geoffrey Martin-Noble [Mon, 28 Mar 2022 21:48:18 +0000 (14:48 -0700)]
[Bazel] Update zlib to 1.2.12
There's a vulnerability in 1.2.11:
https://twitter.com/taviso/status/
1508438583484452866
Differential Revision: https://reviews.llvm.org/D122619
Pierre d'Herbemont [Mon, 28 Mar 2022 20:24:02 +0000 (13:24 -0700)]
[attributes] Generalize attribute 'enforce_tcb' to Objective-C methods.
Calling an ObjC method from a C function marked with the 'enforce_tcb'
attribute did not produce a warning. Now it does, and on top of that
Objective-C methods can participate in TCBs themselves.
Differential Revision: https://reviews.llvm.org/D122343
Aaron Puchert [Mon, 28 Mar 2022 21:53:50 +0000 (23:53 +0200)]
Let clang-repl link privately against Clang components
First of all, this is the convention: all other tools have their
dependencies private. While it does not have an effect on linking
(there is no linking against executables), it does have an effect
on exporting: having the targets private allows installing the tools
without the libraries in a statically linked build, or a build against
libclang-cpp.so.
Reviewed By: v.g.vassilev
Differential Revision: https://reviews.llvm.org/D122546
David Blaikie [Mon, 28 Mar 2022 21:21:37 +0000 (21:21 +0000)]
ItaniumDemangler: Update BinaryExpr::match to match the ctor
Not sure if this could use more testing, but hopefully this is adequate.
Danny Mösch [Sun, 27 Mar 2022 14:41:32 +0000 (16:41 +0200)]
[clang-tidy] Utilize comparison operation implemented in APInt
This is a fix for #53963.
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D122544
owenca [Sun, 27 Mar 2022 20:19:02 +0000 (13:19 -0700)]
[clang-format] Don't format qualifiers in PPDirective
Fixes #54513
Differential Revision: https://reviews.llvm.org/D122548
Chris Bieneman [Mon, 28 Mar 2022 20:01:41 +0000 (15:01 -0500)]
Add HLSL Language Option and Preprocessor
Bringing in HLSL as a language as well as language options for each of
the HLSL language standards.
While the HLSL language is unimplemented, this patch adds the
HLSL-specific preprocessor defines which enables testing of the command
line options through the driver.
Reviewed By: pete, rnk
Differential Revision: https://reviews.llvm.org/D122087
Emil Kieri [Mon, 28 Mar 2022 18:28:51 +0000 (20:28 +0200)]
[flang][driver] Make --version and -version consistent with clang
This patch makes -version valid, and --version invalid, for
flang-new -fc1. The invocation
flang-new --version
remains valid. This behaviour is consistent with clang
(and with clang -cc1 and clang -cc1as).
Previously, flang-new -fc1 accepted --version (as per Options.td), but
the frontend driver acutally checks for -version. As a result,
flang-new -fc1 --version
triggered no action, emitted no message, and stalled waiting for
standard input.
Fixes #51438
Reviewed By: PeteSteinfeld, awarzynski
Differential Revision: https://reviews.llvm.org/D122542
Fangrui Song [Mon, 28 Mar 2022 20:40:48 +0000 (13:40 -0700)]
[MC] Fix llvm_unreachable when a STB_GNU_UNIQUE symbol needs a relocation
STB_GNU_UNIQUE should be treated in a way similar to STB_GLOBAL.
This fixes an "Invalid Binding" failure in an LLVM_ENABLE_ASSERTIONS=on build
for source files like glibc elf/tst-unique1mod1.c .
This bug has been benign so far because (a) Clang does not produce
%gnu_unique_object by itself (b) a non-assertion build likely picks the
STB_GLOBAL code path anyway.
LLVM GN Syncbot [Mon, 28 Mar 2022 20:09:41 +0000 (20:09 +0000)]
[gn build] Port
c5e54e275241
chenglin.bi [Mon, 28 Mar 2022 20:05:22 +0000 (16:05 -0400)]
[InstCombine] Fold two select patterns into and-or
select (~a | c), a, b -> and a, (or c, b) https://alive2.llvm.org/ce/z/bnDobs
select (~c & b), a, b -> and b, (or a, c) https://alive2.llvm.org/ce/z/k2jJHJ
Differential Revision: https://reviews.llvm.org/D122152
Nico Weber [Sun, 27 Mar 2022 20:10:02 +0000 (16:10 -0400)]
[clang] Make Driver tests pass when running with temp dir containing "crt"
In a recent run, temp files got created in /tmp/lit-tmp-2wcrtcx1/foo-xxx.o.
Since the tmp path contained "crt", this made a few tests fail:
http://45.33.8.238/linux/72221/step_7.txt
Not allowing '/' as path of the file name prevents this.
Differential Revision: https://reviews.llvm.org/D122547
lipracer [Mon, 28 Mar 2022 20:01:46 +0000 (20:01 +0000)]
[mlir] tosa: build error when building with clang
The change of https://reviews.llvm.org/D121513#3411651
has caused a build error when building with clang:
/mnt/vss/_work/1/llvm-project/mlir/lib/Dialect/Tosa/IR/TosaOps.cpp:599:26: error: extra ';' outside of a function is incompatible with C++98 [-Werror,-Wc++98-compat-extra-semi]
ReduceFolder(ReduceAllOp);
Reviewed By: hpmorgan, Mogball
Differential Revision: https://reviews.llvm.org/D122599
Chris Bieneman [Mon, 28 Mar 2022 18:45:41 +0000 (13:45 -0500)]
Add clang DirectX target support
This change adds a stub DirectX target for clang to enable targeting
dxil targets.
Reviewed By: pete
Differential Revision: https://reviews.llvm.org/D122085
Craig Topper [Mon, 28 Mar 2022 19:33:53 +0000 (12:33 -0700)]
[RISCV][SelectionDAG] Enable TargetLowering::hasBitTest for masks that fit in ANDI.
Modified DAGCombiner to pass the shift the bittest input and the shift amount
to hasBitTest. This matches the other call to hasBitTest in TargetLowering.h
This is an alternative to D122454.
Reviewed By: luismarques
Differential Revision: https://reviews.llvm.org/D122458
Sanjay Patel [Mon, 28 Mar 2022 18:21:39 +0000 (14:21 -0400)]
[RISCV] add tests for minnum/maxnum; NFC
Issue #54554
Mogball [Fri, 25 Mar 2022 22:44:34 +0000 (22:44 +0000)]
[mlir] Allow RegionRange to accept ArrayRef<Region *>
Adds another pointer to the union in RegionRange to allow RegionRange to work on ArrayRef<Region *> (i.e. vectors of Region *).
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D122514
Mogball [Fri, 25 Mar 2022 21:13:30 +0000 (21:13 +0000)]
[mlir][cf-sink] Accept a callback for sinking operations
(This was a TODO from the initial patch).
The control-flow sink utility accepts a callback that is used to sink an operation into a region.
The `moveIntoRegion` is called on the same operation and region that return true for `shouldMoveIntoRegion`.
The callback must preserve the dominance of the operation within the region. In the default control-flow
sink implementation, this is moving the operation to the start of the entry block.
Reviewed By: mehdi_amini
Differential Revision: https://reviews.llvm.org/D122445
Changpeng Fang [Mon, 28 Mar 2022 19:13:33 +0000 (12:13 -0700)]
[AMDGPU][NFC]: Remove unnecessary MFI functions
Summary:
hasHostcallPtr() and hasHeapPtr() are only used in metadata emit.
However, we can use the corresponding function attributes directly
instead introducing the functions.
Reviewers: arsenm
Differential Revision: https://reviews.llvm.org/D122600
Volodymyr Sapsai [Fri, 25 Mar 2022 22:05:00 +0000 (15:05 -0700)]
[clang][NFC] Remove unused parameter in `Sema::ActOnDuplicateDefinition`.
zhijian [Mon, 28 Mar 2022 19:05:41 +0000 (15:05 -0400)]
[AIX][XCOFF] address post-commit review comments of patch https://reviews.llvm.org/D82549
Summary:
Address post-commit review comments in the https://reviews.llvm.org/D82549, including
changed file name from llvm/test/tools/llvm-readobj/XCOFF/xcoff-auxiliary-header.test --> llvm/test/tools/llvm-readobj/XCOFF/auxiliary-header.test
replaced macro define by using lambda function.
added a helper function to reduce the duplicated check and print error code.
Reviewer : James Henderson
Differential Revision: https://reviews.llvm.org/D116220
Roland McGrath [Wed, 2 Feb 2022 20:18:23 +0000 (12:18 -0800)]
[compiler-rt][AArch64] Initialize __aarch64_have_lse_atomics for Fuchsia
Use Fuchsia's zx_system_get_features API to determine
whether LSE atomics are available on the machine.
Reviewed By: abrachet
Differential Revision: https://reviews.llvm.org/D118839
Aaron Ballman [Mon, 28 Mar 2022 18:46:14 +0000 (14:46 -0400)]
Fix template instantiation of UDLs
Previously, we would instantiate the UDL by marking the function as
referenced and potentially binding to a temporary; this skipped
transforming the call when the UDL was dependent on a template
parameter.
Now, we defer all the work to instantiating the call expression for the
UDL. This ensures that constant evaluation occurs at compile time
rather than deferring until runtime.
Fixes Issue 54578.
Chris Bieneman [Mon, 28 Mar 2022 18:21:02 +0000 (13:21 -0500)]
Add stub DirectX backend
This is the bare minimum needed to get the DirectX target compiling,
but does not actually do anything.
Reviewed By: pete, rnk, arsenm, jaebaek
Differential Revision: https://reviews.llvm.org/D122080
Eric Li [Mon, 28 Mar 2022 18:29:31 +0000 (18:29 +0000)]
[libTooling] Fix indentation. NFC.
Peter Klausler [Thu, 24 Mar 2022 16:03:07 +0000 (09:03 -0700)]
[flang] Fold NEAREST() and its relatives
Implement constant folding for the intrinsic function NEAREST()
and the related functions IEEE_NEXT_AFTER(), IEEE_NEXT_UP(), and
IEEE_NEXT_DOWN().
Differential Revision: https://reviews.llvm.org/D122510
Joseph Huber [Mon, 28 Mar 2022 16:23:21 +0000 (12:23 -0400)]
[OpenMP] Fix library path missing when using OpenMP
The changes in D122444 caused OpenMP programs built with the
LLVM_ENABLE_RUNTIMES options to stop finding the libraries. We generally
expect to link against the libraries associated with the clang
installation itself but we no longer implicitly included that directory.
This patch adds in the include path of the clang installations library
to ensure we can find them.
Reviewed By: jdoerfert, MaskRay
Differential Revision: https://reviews.llvm.org/D122592
Jacques Pienaar [Mon, 28 Mar 2022 18:24:47 +0000 (11:24 -0700)]
[mlir] Flip Vector dialect accessors used to prefixed form.
This has been on _Both for a couple of weeks. Flip usages in core with
intention to flip flag to _Prefixed in follow up. Needed to add a couple
of helper methods in AffineOps and Linalg to facilitate a pure flag flip
in follow up as some of these classes are used in templates and so
sensitive to Vector dialect changes.
Differential Revision: https://reviews.llvm.org/D122151
Nathan Sidwell [Tue, 1 Mar 2022 16:36:24 +0000 (08:36 -0800)]
[demangler] Add StringView conversion operator
The OutputBuffer class tries to present a NUL-terminated string API to
consumers. But several of them would prefer a StringView. In
particular the Microsoft demangler, juggles between NUL-terminated and
StringView, which is confusing.
This adds a StringView conversion, and adjusts the Demanglers that can
benefit from that.
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/D120990
Akira Hatanaka [Mon, 28 Mar 2022 18:14:44 +0000 (11:14 -0700)]
Pass -disable-llvm-passes to avoid running llvm passes
Differential Revision: https://reviews.llvm.org/D122425
Mogball [Mon, 28 Mar 2022 18:09:26 +0000 (18:09 +0000)]
[mlir] Simplify LoopLikeOpInterface
- Adds default implementations of `isDefinedOutsideOfLoop` and `moveOutOfLoop` since 99% of all implementations of these functions were identical
- `moveOutOfLoop` takes one operation and doesn't return anything anymore. 100% of all implementations of this function would always return `success` and uses would either respond with a pass failure or an `llvm_unreachable`.
Craig Topper [Mon, 28 Mar 2022 15:52:15 +0000 (08:52 -0700)]
[RISCV] Add lowering for vp.fptosi and vp.sitofp.
This as an alternative version of D120641. Starting from the code here
https://repo.hca.bsc.es/gitlab/rferrer/llvm-epi/-/raw/EPI/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
but with some modifications to how the interim types are calculated,
and adding support for f16.
Still need to add fptosi for mask vectors.
Lots of masked isel patterns added so we can pass the mask through
the type changes.
Reviewed By: frasercrmck, arcbbb
Differential Revision: https://reviews.llvm.org/D122512
Fangrui Song [Mon, 28 Mar 2022 18:05:52 +0000 (11:05 -0700)]
[ELF] Fix llvm_unreachable failure when COMMON is placed in SHT_PROGBITS output section
Fix a regression in
aa27bab5a1a17e9c4168a741a6298ecaa92c1ecb: COMMON in an
SHT_PROGBITS output section caused llvm_unreachable failure.
William S. Moses [Mon, 28 Mar 2022 01:59:52 +0000 (21:59 -0400)]
[MLIR][LLVM] Mark read/write behavior of memcpy/memset/memmove
This commit adds MemWrite (and MemRead, as appropriate) to the arugments of the memset/memcpy/memmove intrinsics within the LLVM dialect
Reviewed By: ftynse
Differential Revision: https://reviews.llvm.org/D122552
Roland McGrath [Fri, 25 Mar 2022 00:02:20 +0000 (17:02 -0700)]
sanitizer_common: Remove Fuchsia support for reading flags from files
This has never really been used in practice. Fuchsia is moving
away from the support this requires, so don't use it.
Reviewed By: phosek
Differential Revision: https://reviews.llvm.org/D122500
Fangrui Song [Mon, 28 Mar 2022 17:27:16 +0000 (10:27 -0700)]
[Driver][AVR] Fix warn_drv_avr_stdlib_not_linked condition
Many options (-fsyntax-only, -E, -S, etc) skip the link action phase which the
existing condition does not account for.
Since the code no longer specifies OPT_c, I think a single RUN line about -c
not leading to a warning is sufficient. Adding one for all of -E,
-fsyntax-only, -S would be excessive.
Reviewed By: benshi001
Differential Revision: https://reviews.llvm.org/D122553
Kiran Chandramohan [Mon, 28 Mar 2022 17:05:59 +0000 (17:05 +0000)]
[Flang] Options to lower math intrinsics to relaxed, precise variants
Enable lowering to the relaxed and precise variants in the pgmath
library.
This is part of the upstreaming effort from the fir-dev branch in [1].
[1] https://github.com/flang-compiler/f18-llvm-project
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Peter Klausler <pklausler@nvidia.com>
Reviewed By: clementval
Differential Revision: https://reviews.llvm.org/D122484
Fangrui Song [Mon, 28 Mar 2022 17:11:45 +0000 (10:11 -0700)]
Revert "[Driver][AVR] Fix warn_drv_avr_stdlib_not_linked condition"
This reverts commit
16524d2f1bdc2e74ca34425edf43ac8ef5d39531.
The test caused some warnings when avr-gcc was not installed.
Fangrui Song [Mon, 28 Mar 2022 17:02:35 +0000 (10:02 -0700)]
[ELF] Simplify MergeInputSection::getParentOffset. NFC
and remove overly verbose comments.
Florian Hahn [Mon, 28 Mar 2022 17:00:18 +0000 (18:00 +0100)]
[ConstraintElimination] Add tests with signed predicates and ADDs.
Fangrui Song [Mon, 28 Mar 2022 16:43:36 +0000 (09:43 -0700)]
[Driver][AVR] Fix warn_drv_avr_stdlib_not_linked condition
Many options (-fsyntax-only, -E, -S, etc) skip the link action phase which the
existing condition does not account for.
Since the code no longer specifies OPT_c, I think a single RUN line about -c
not leading to a warning is sufficient. Adding one for all of -E,
-fsyntax-only, -S would be excessive.
Reviewed By: benshi001
Differential Revision: https://reviews.llvm.org/D122553
Nathan Sidwell [Thu, 24 Mar 2022 11:21:52 +0000 (04:21 -0700)]
[llvm] Fix string copy confusion
The microsoft demangler makes copies of the demangled strings, but has
some confusion between StringView representation (sans NUL), and
C-strings (with NUL). Here we also have a use of strcpy, which
happens to work because the incoming string view happens to have a
trailing NUL. But a simple memcpy excluding the NUL is sufficient.
Reviewed By: dblaikie, erichkeane
Differential Revision: https://reviews.llvm.org/D122391
Simon Pilgrim [Mon, 28 Mar 2022 16:21:11 +0000 (17:21 +0100)]
[X86] lowerV64I8Shuffle - attempt to match with lowerShuffleAsLanePermuteAndPermute
Fixes #54562
Kazu Hirata [Mon, 28 Mar 2022 16:18:39 +0000 (09:18 -0700)]
Apply clang-tidy fixes for readability-redundant-smartptr-get in SampleProfReader.cpp (NFC)
Kazu Hirata [Mon, 28 Mar 2022 16:18:38 +0000 (09:18 -0700)]
Apply clang-tidy fixes for readability-redundant-smartptr-get in InstrProfReader.cpp (NFC)
Kazu Hirata [Mon, 28 Mar 2022 16:18:36 +0000 (09:18 -0700)]
Apply clang-tidy fixes for readability-redundant-smartptr-get in TapiUniversal.cpp (NFC)
Kazu Hirata [Mon, 28 Mar 2022 16:18:35 +0000 (09:18 -0700)]
Apply clang-tidy fixes for readability-redundant-smartptr-get in MachOUniversalWriter.cpp (NFC)
Kazu Hirata [Mon, 28 Mar 2022 16:18:33 +0000 (09:18 -0700)]
Apply clang-tidy fixes for readability-redundant-smartptr-get in MCContext.cpp (NFC)
Kazu Hirata [Mon, 28 Mar 2022 16:18:31 +0000 (09:18 -0700)]
Apply clang-tidy fixes for readability-redundant-smartptr-get in SummaryBasedOptimizations.cpp (NFC)
Kazu Hirata [Mon, 28 Mar 2022 16:18:30 +0000 (09:18 -0700)]
Apply clang-tidy fixes for readability-redundant-smartptr-get in GsymReader.cpp (NFC)
Kazu Hirata [Mon, 28 Mar 2022 16:18:28 +0000 (09:18 -0700)]
Apply clang-tidy fixes for readability-redundant-smartptr-get in DwarfTransformer.cpp (NFC)
Kazu Hirata [Mon, 28 Mar 2022 16:18:27 +0000 (09:18 -0700)]
Apply clang-tidy fixes for readability-redundant-member-init in Module.cpp (NFC)
Kazu Hirata [Mon, 28 Mar 2022 16:18:25 +0000 (09:18 -0700)]
Apply clang-tidy fixes for modernize-use-equals-default in ELFObject.cpp (NFC)
Kazu Hirata [Mon, 28 Mar 2022 16:18:23 +0000 (09:18 -0700)]
Apply clang-tidy fixes for modernize-use-equals-default in InputFile.cpp (NFC)
Thomas Symalla [Fri, 25 Mar 2022 16:31:33 +0000 (17:31 +0100)]
[AMDGPU] Fix adding modifiers when creating v_cmpx instructions.
Revision https://reviews.llvm.org/D122332 added a pattern transformation
where v_cmpx instructions are introduced. However, the modifiers are
not correctly inherited from the original operands. The patch
adds the source modifiers, if they are exist, or sets them to 0.
Reviewed By: foad
Differential Revision: https://reviews.llvm.org/D122489
Marius Brehler [Wed, 23 Mar 2022 11:47:59 +0000 (11:47 +0000)]
[mlir][emitc] Adapt to move of FuncOp
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D122305
Eric Li [Mon, 28 Mar 2022 15:39:02 +0000 (15:39 +0000)]
[libTooling] Support TransformerResult<void> in consumer callbacks
Support `TransformerResult<void>` in the consumer callback, which
allows generic code to more naturally use the `Transformer` interface
(instead of needing to specialize on `void`).
This also delete the specialization that existed within `Transformer`
itself, instead replacing it with an `std::function` adapter.
Reviewed By: ymandel
Differential Revision: https://reviews.llvm.org/D122499
Jyotsna Verma [Thu, 24 Mar 2022 21:38:27 +0000 (16:38 -0500)]
[Hexagon] Create an intrinsic to profile using a custom handler
The intrinsic is lowered into a hexagon pseudo instruction which
after register allocation is expanded into A2_tfrsi and J2_call.
Florian Hahn [Mon, 28 Mar 2022 15:20:02 +0000 (16:20 +0100)]
[LV] Move code to place induction increment to VPlan post-processing.
This patch moves the code to set the correct incoming block for the
backedge value to VPlan::execute.
When generating the phi node, the backedge value is temporarily added
using the pre-header as incoming block. The invalid phi node will be
fixed up during VPlan::execute after main VPlan code generation.
At the same time, the backedge value is also moved to the latch.
This change removes the requirement to create the latch block up-front
for VPWidenIntOrFpInductionRecipe::execute, which in turn will enable
modeling the pre-header in VPlan.
As an alternative, the increment could be modeled as separate recipe,
but that would require more work and a bit of redundant code, as we need
to create the step-vector during VPWidenIntOrFpInductionRecipe::execute
anyways, to create the values for different parts.
Reviewed By: Ayal
Differential Revision: https://reviews.llvm.org/D121617
Markus Böck [Mon, 28 Mar 2022 14:54:34 +0000 (16:54 +0200)]
[mlir][NFC] Fix codestyle issues introduced in D121988
These were noticed in the post commit review of https://reviews.llvm.org/D121988
gysit [Mon, 28 Mar 2022 14:36:47 +0000 (14:36 +0000)]
[mlir][linalg] Control dimensions to pad.
This revision supports padding only a subset of the iteration dimensions via an additional padding-dimensions parameter. This control allows us to pad an operation in multiple steps. For example, one may want to pad only the output dimensions of a producer matmul fused into a consumer loop nest, before tiling and padding its reduction dimension.
Depends On D122309
Reviewed By: nicolasvasilache
Differential Revision: https://reviews.llvm.org/D122560
Daniil Kovalev [Mon, 28 Mar 2022 14:33:48 +0000 (17:33 +0300)]
[NVPTX] Fix poorly designed assertion introduced in D120129
NVPTXTargetLowering::getFunctionParamOptimizedAlign, which was introduces in
D120129, contained a poorly designed assertion checking that a function with
internal or private linkage is not a kernel. It relied on invariants that
were not actually guaranteed, and that resulted in compiler crash with some
CUDA versions (see discussion with @jdoerfert in D120129). This patch changes
that assertion and makes it use isKernelFunction which is designed exactly for
such checks. This patch also includes a test with IR that caused compiler crash
before.
Differential Revision: https://reviews.llvm.org/D122562
Dominik Grewe [Mon, 28 Mar 2022 13:45:40 +0000 (15:45 +0200)]
Expose MlirOperationClone in Python bindings.
Expose MlirOperationClone in Python bindings.
Reviewed By: ftynse
Differential Revision: https://reviews.llvm.org/D122526
gysit [Mon, 28 Mar 2022 13:41:39 +0000 (13:41 +0000)]
[mlir][linalg] Use arrays to pass padding options.
Pass the padding options using arrays instead of lambdas. In particular pass the padding value as string and use the argument parser to create the padding value. Arrays are a more natural choice that matches the current use cases and avoids converting arrays to lambdas.
Reviewed By: nicolasvasilache
Differential Revision: https://reviews.llvm.org/D122309
Ranjeet Singh [Mon, 28 Mar 2022 13:40:36 +0000 (14:40 +0100)]
[ARM] Make testcase warning pattern match more specific
Make the warning more specific as downstream compilers could produce other warnings.
Reviewed By: tstellar
Differential Revision: https://reviews.llvm.org/D122487
Jake Egan [Mon, 28 Mar 2022 13:43:21 +0000 (09:43 -0400)]
[NFC][tests][AIX] XFAIL test for lack of visibility support
With the addition of `__attribute__((visibility("hidden")))` to the test, the test fails because AIX's current default behaviour is to ignore hidden visibility, so the expected error is not seen. This patch marks the test `XFAIL` on AIX for now.
Reviewed By: cebowleratibm
Differential Revision: https://reviews.llvm.org/D122519
Erich Keane [Mon, 28 Mar 2022 13:28:13 +0000 (06:28 -0700)]
Update www_status/add test for P1972:
This seems to have been implemented/supported correctly back in Clang
10, so update the documentation and add the test from the paper.
Nathan Sidwell [Fri, 4 Feb 2022 19:45:23 +0000 (11:45 -0800)]
[demangler] Add operator precedence
The demangler had no concept of operator precendence, and would
parenthesize many more subexpressions than necessary. In particular
it would parenthesize primary-expressions, such as '4', which just
looks strange. It would also parenthesize '>' expressions, just in
case they were inside a template parameter list.
This patch fixes both issues.
* Add operator precedence to the OpInfo structure, and add a
subexpression helper that will parenthesize a lower precedence
subexpression.
* Add a 'greater-than is greater-than' indicator to the output buffer,
so the expression printer knows whether it is immediately inside a
template parameter list (and must therefore parenthesize 'expr >
expr'). This is a counter, so that ...
* Add open and close printers to the output buffer, that increment and
decrement the gt-is-gt indicator.
* Parenthesize comma operators inside comma-separated lists. (probably
a rare case, but still).
This dramatically reduces the extraneous parentheses being printed.
Reviewed By: dblaikie, bruno
Differential Revision: https://reviews.llvm.org/D120905
Pavel Labath [Tue, 15 Mar 2022 13:17:28 +0000 (14:17 +0100)]
Remove a top-level using-directive from EPCDebugObjectRegistrar.h
The directive pollutes the namespace of all files which include the
header.
Use alternate ways to reference the namespace constituents instead.
Pavel Labath [Mon, 21 Mar 2022 14:35:49 +0000 (15:35 +0100)]
[lldb] Remove some unused functions from PosixApi.h
There are better llvm replacements for all of these.
Simon Pilgrim [Mon, 28 Mar 2022 12:54:07 +0000 (13:54 +0100)]
[X86] Add shuffle tests from Issue #54562
Nikita Popov [Mon, 28 Mar 2022 12:26:24 +0000 (14:26 +0200)]
[GlobalOpt] Handle non-instruction MTI source (PR54572)
This was reusing a cast to GlobalVariable to check for an
Instruction, which means we'll try to dereference a null pointer
if it's not actually a GlobalVariable. We should be casting
MTI->getSource() instead.
I don't think this problem is really specific to opaque pointers,
but it certainly makes it a lot easier to reproduce.
Fixes https://github.com/llvm/llvm-project/issues/54572.
Valentin Clement [Mon, 28 Mar 2022 11:36:10 +0000 (13:36 +0200)]
[flang] Lower some coarray statements to their runtime functions
This patch adds the lowering of coarray statements to the runtime
functions. The runtime functions are currently not implemented.
This patch is part of the upstreaming effort from fir-dev branch.
Reviewed By: jeanPerier
Differential Revision: https://reviews.llvm.org/D122466
Aaron Ballman [Mon, 28 Mar 2022 11:13:56 +0000 (07:13 -0400)]
Correct a minor point with the Phabricator docs
The repository field we want to leave blank is on the page as the
`Create Diff` button, so merged the instructions about leaving the
field blank and clicking the button.
Alexandros Lamprineas [Wed, 23 Mar 2022 14:51:16 +0000 (14:51 +0000)]
[FuncSpec] Support function specialization across multiple arguments.
The current implementation of Function Specialization does not allow
specializing more than one arguments per function call, which is a
limitation I am lifting with this patch.
My main challenge was to choose the most suitable ADT for storing the
specializations. We need an associative container for binding all the
actual arguments of a specialization to the function call. We also
need a consistent iteration order across executions. Lastly we want
to be able to sort the entries by Gain and reject the least profitable
ones.
MapVector fits the bill but not quite; erasing elements is expensive
and using stable_sort messes up the indices to the underlying vector.
I am therefore using the underlying vector directly after calculating
the Gain.
Differential Revision: https://reviews.llvm.org/D119880
Andrzej Warzynski [Mon, 28 Mar 2022 10:46:47 +0000 (10:46 +0000)]
Revert "[flang] Add & use a better visit()"
This reverts commit
2ab9990c9eb79682a4d4b183dfbc7612d3e55328. It has
caused multiple build failures:
* https://lab.llvm.org/buildbot/#/builders/177/builds/4346
* https://lab.llvm.org/buildbot/#/builders/180/builds/3803
* https://lab.llvm.org/buildbot/#/builders/175/builds/10419
* https://lab.llvm.org/buildbot/#/builders/191/builds/4318
* https://lab.llvm.org/buildbot/#/builders/173/builds/4274
* https://lab.llvm.org/buildbot/#/builders/181/builds/4297
All these bots failed with a time-out:
```
command timed out: 1200 seconds without output running [b'ninja', b'-j', b'32'], attempting to kill
```
I'm guessing that that's due to template instantiations failing at some
point (https://reviews.llvm.org/D122441 introduced a custom
implementation of std::visit). Everything seems fine when either:
* building on X86 with GCC or Clang (tested with GCC 9.3 and Clang 12)
* building on AArch64 with GCC (tested with GCC 11)
Mikhail Goncharov [Mon, 28 Mar 2022 09:23:14 +0000 (11:23 +0200)]
Return -no-canonical-prefixes for riskv32/64 test
W/o -no-canonical-prefixes CC1: clang{{.*}} "-cc1" "-triple" "riscv32"
does not match clang output for some setups.
See
da62a5c6610dd2087ce2f527ca84ba43e93d5e30.
Balázs Kéri [Mon, 28 Mar 2022 06:57:11 +0000 (08:57 +0200)]
[clang][ASTImporter] Fix a bug when importing CXXDefaultInitExpr.
The "in-class initializer" expression should be set in the field of a
default initialization expression before this expression node is created.
The `CXXDefaultInitExpr` objects are created after the AST is loaded and
at import not present in the "To" AST. And the in-class initializers of
the used fields can be missing too, these must be set at import.
This fixes a github issue #54061.
Reviewed By: martong
Differential Revision: https://reviews.llvm.org/D120824
Shraiysh Vaishay [Mon, 28 Mar 2022 08:06:32 +0000 (13:36 +0530)]
[mlir][OpenMP] Added ReductionClauseInterface
This patch adds the ReductionClauseInterface and also adds reduction
support for `omp.parallel` operation.
Reviewed By: kiranchandramohan
Differential Revision: https://reviews.llvm.org/D122402
Carl Ritson [Mon, 28 Mar 2022 08:30:09 +0000 (17:30 +0900)]
[AMDGPU] Split waterfall loop exec manipulation
Split waterfall loops into multiple blocks so that exec mask
manipulation (s_and_saveexec) does not occur in the middle of
a block.
VGPR live range optimizer is updated to handle waterfall loops
spanning multiple blocks.
Reviewed By: ruiling
Differential Revision: https://reviews.llvm.org/D122200
LLVM GN Syncbot [Mon, 28 Mar 2022 08:27:36 +0000 (08:27 +0000)]
[gn build] Port
c0eb9b4cdef6
Fangrui Song [Mon, 28 Mar 2022 08:27:16 +0000 (01:27 -0700)]
[Object][test] Fix invalid.test
Jean Perier [Mon, 28 Mar 2022 08:21:36 +0000 (10:21 +0200)]
[flang][runtime] Ensure PointerDeallocate actually deallocate pointers
PointerDeallocate was silently doing nothing because it relied on
Destroy that doe not do anything for Pointers. Add an option to Destroy
in order to destroy pointers.
Add a unit test for PointerDeallocate.
Differential Revision: https://reviews.llvm.org/D122492
Fangrui Song [Mon, 28 Mar 2022 08:17:37 +0000 (01:17 -0700)]
Revert D121984 "[RISCV][NFC] Moving RVV intrinsic type related util to llvm/Support"
This reverts commit
ad57e10dbca2fdeff1448afc0aa1cf23d6df8736 and
1967fd8d5e7e40a987d8f65d163c7eb8f4b9e76f
llvm/lib/Support/RISCVVIntrinsicUtils.cpp introduced llvm/TableGen includes,
a circular dependency https://llvm.org/docs/CodingStandards.html#library-layering
I think this particular instance is serious and should be reverted.
Adrian Kuegel [Mon, 28 Mar 2022 07:49:18 +0000 (09:49 +0200)]
Revert "Revert "[RISCV][NFC] Remove unused header includes.""
Reland Remove unused header includes.
Add header includes that are needed, but previously were pulled in
transitively.
Fangrui Song [Mon, 28 Mar 2022 08:00:43 +0000 (01:00 -0700)]
[llvm-objdump] --private-headers: change errors to warnings for dynamic section dumping
Fix #54456: `objcopy --only-keep-debug` produces a linked image with invalid
empty dynamic section. llvm-objdump -p currently reports an error which seems
excessive.
```
% llvm-readelf -l a.out
llvm-readelf: warning: 'a.out': no valid dynamic table was found
...
```
Follow the spirit of llvm-readelf -l (D64472) and report a warning instead.
This allows later files to be dumped despite warnings for an input file, and
improves objdump compatibility in that the exit code is now 0 instead of 1.
```
% llvm-objdump -p a.out # new behavior
...
Program Header:
llvm-objdump: warning: 'a.out': invalid empty dynamic section
% objdump -p a.out
...
Dynamic Section:
```
Reviewed By: jhenderson, raj.khem
Differential Revision: https://reviews.llvm.org/D122505
Fangrui Song [Mon, 28 Mar 2022 07:58:14 +0000 (00:58 -0700)]
[llvm-objdump][test] dos2unix some files
Fangrui Song [Mon, 28 Mar 2022 07:51:58 +0000 (00:51 -0700)]
[RISCV] Remove using namespace llvm from public header after D121984