Commit Graph

392449 Commits

Author SHA1 Message Date
Duncan P. N. Exon Smith ac2bec5add OpaquePtr: Support i32** with --force-opaque-pointers
4506f614cb fixed parsing of textual IR to
reject `ptr*`, but broke the auto-conversion of `i32**` to `ptr` with
`--force-opaque-pointers`.

Get that working again by refactoring LLParser::parseType to only send
`ptr`-spelled pointers into the type suffix logic when it's the return
of a function type. This also rejects `ptr addrspace(3) addrspace(2)`,
which 1e6303e60c invadvertently started
accepting. Just the default top-level error message for the
double-addrspace since I had trouble thinking of something nice;
probably it's fine as is (it doesn't look valid the way that `ptr*`
does).

Differential Revision: https://reviews.llvm.org/D105146
2021-06-29 14:10:29 -07:00
Alexander Shaposhnikov 6d72845a85 [llvm-objcopy][MachO] Code cleanup
1. Remove unnecessary templates.
2. Fix potentially unaligned reads inside constructSection.

Test plan: make check-all

Differential revision: https://reviews.llvm.org/D105089
2021-06-29 14:08:23 -07:00
Stella Stamenova c8a9c78e17 [lldb] Fix debug_loc.s which was broken after https://reviews.llvm.org/D103502
An empty location is now printed as <empty>
2021-06-29 13:54:48 -07:00
Dhruva Chakrabarti 2240b41ee4 [libomptarget] [amdgpu] Fix default setting of max flat workgroup size
When max flat workgroup size is not specified, it is set to the default
workgroup size. This prevents kernel launch with a workgroup size larger
than the default. The fix is to ignore a size of 0 and treat it as
unspecified.

Reviewed By: JonChesterfield

Differential Revision: https://reviews.llvm.org/D105073
2021-06-29 13:47:24 -07:00
Siva Chandra Reddy 58af0d567d [libc] Allow target architecture independent configs
Previously, we required entrypoints.txt for every target architecture
supported by a target OS. With this change, we allow architecture
independent config for a target OS. That is, if an architecture specific
entrypoints.txt is missing, then a generic entrypoints.txt for that
target OS will be used.

Reviewed By: caitlyncano

Differential Revision: https://reviews.llvm.org/D105147
2021-06-29 20:41:28 +00:00
Stella Stamenova 9952d591cc [lldb] Fix globals-bss.cpp which was broken in https://reviews.llvm.org/D105055
-S replaced -s, so the test needs to be updated to use the new option
2021-06-29 13:39:18 -07:00
Jianzhou Zhao ae6648cee0 [dfsan] Expose dfsan_get_track_origins to get origin tracking status
This allows application code checks if origin tracking is on before
printing out traces.

-dfsan-track-origins can be 0,1,2.
The current code only distinguishes 1 and 2 in compile time, but not at runtime.
Made runtime distinguish 1 and 2 too.

Reviewed By: browneee

Differential Revision: https://reviews.llvm.org/D105128
2021-06-29 20:32:39 +00:00
Stella Laurenzo 485cc55edf [mlir] Generare .cpp.inc files for dialects.
* Previously, we were only generating .h.inc files. We foresee the need to also generate implementations and this is a step towards that.
* Discussed in https://llvm.discourse.group/t/generating-cpp-inc-files-for-dialects/3732/2
* Deviates from the discussion above by generating a default constructor in the .cpp.inc file (and adding a tablegen bit that disables this in case if this is user provided).
* Generating the destructor started as a way to flush out the missing includes (produces a link error), but it is a strict improvement on its own that is worth doing (i.e. by emitting key methods in the .cpp file, we root vtables in one translation unit, which is a non-controversial improvement).

Differential Revision: https://reviews.llvm.org/D105070
2021-06-29 20:10:30 +00:00
Stella Stamenova bb2cfca2f3 Revert D104488 and friends since it broke the windows bot
Reverts commits:
"Fix failing tests after https://reviews.llvm.org/D104488."
"Fix buildbot failure after https://reviews.llvm.org/D104488."
"Create synthetic symbol names on demand to improve memory consumption and startup times."

This series of commits broke the windows lldb bot and then failed to fix all of the failing tests.
2021-06-29 12:58:55 -07:00
Eugene Zhulenev c1194c2ec3 [mlir:Async] Change async-parallel-for block size/count calculation
Depends On D105037

Avoid creating too many tasks when the number of workers is large.

Reviewed By: herhut

Differential Revision: https://reviews.llvm.org/D105126
2021-06-29 12:57:11 -07:00
Eugene Zhulenev f57b2420b2 [mlir:Async] Add an async reference counting pass based on the user defined policy
Depends On D104999

Automatic reference counting based on the liveness analysis can add a lot of reference counting overhead at runtime. If the IR is known to be constrained to few particular "shapes", it's much more efficient to provide a custom reference counting policy that will specify where it is required to update the async value reference count.

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D105037
2021-06-29 12:53:09 -07:00
Nicolas Vasilache a77524cd2c [mlir][Linalg] Add a ComprehensiveModuleBufferizePass and support for CallOp analysis(9/n)
This revision adds the minimal plumbing to create a simple ComprehensiveModuleBufferizePass that can behave conservatively in the presence of CallOps.

A topological sort of caller/callee is performed and, if the call-graph is cycle-free, analysis can proceed.

Differential revision: https://reviews.llvm.org/D104859
2021-06-29 19:18:22 +00:00
Stefan Pintilie 90dfd05919 [Clang] Add option to handle behaviour of vector bool/vector pixel.
Added the option `-altivec-src-compat=[mixed,gcc,xl]`. The default at this time is `mixed`.

The default behavior for clang is for all vector compares to return a scalar unless the vectors being
compared are vector bool or vector pixel. In that case the compare returns a
vector. With the gcc case all vector compares return vectors and in the xl case
all vector compares return scalars.

This patch does not change the default behavior of clang.

This option will be used in future patches to implement behaviour compatibility for the vector bool/pixel types.

Reviewed By: bmahjour

Differential Revision: https://reviews.llvm.org/D103615
2021-06-29 14:07:12 -05:00
Leonard Chan 8e74668e96 [NFC][compiler-rt][hwasan] Re-use ring buffer size calculation
Users can call HwasanThreadList::GetRingBufferSize rather than RingBufferSize
to prevent having to do the calculation in RingBufferSize. This will be useful
for Fuchsia where we plan to initialize the stack ring buffer separately from
the rest of thread initialization.

Differential Revision: https://reviews.llvm.org/D104823
2021-06-29 11:57:33 -07:00
Fangrui Song d4dcb55c70 [llvm-readobj] Make -s and -t match llvm-readelf
llvm-readobj is an internal testing tool for binary formats. Its output and
command line options do not need to be stable. It isn't supposed to be part of a
build process.

llvm-readelf was created as a user-facing utility and its interface intends to
be compatible with GNU readelf (unless there are good reasons not to).

The two tools have mostly compatible options. -s and -t are noticeable
exceptions due to history. I think the cost of keeping the inconsistency
overweighs the little history-compatible benefit and hinders transition from
cl::opt to OptTable, so let's change it.

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D105055
2021-06-29 11:56:26 -07:00
Leonard Chan c4a00ed851 [NFC][compiler-rt][hwasan] Move GetCurrentThread to hwasan.cpp
We can reuse the same implementation for getting the current thread on fuchsia.

Differential Revision: https://reviews.llvm.org/D104824
2021-06-29 11:55:30 -07:00
Fangrui Song a9854045f6 [test] Change -t to --syms and -s to -S for llvm-readobj RUN lines
-s and -t will be changed to improve consistency with llvm-readelf.
The inconsistency issue regularly contributes to confusion using the two tools.
2021-06-29 11:50:31 -07:00
Nikita Popov c4de78e91c [SanitizerCoverage] Fix global type check with opaque pointers
The code was previously relying on the fact that an incorrectly
typed global would result in the insertion of a BitCast constant
expression. With opaque pointers, this is no longer the case, so
we should check the type explicitly.
2021-06-29 20:32:14 +02:00
Fangrui Song 69937a8080 [llvm-objcopy][MachO] Support ARM64_RELOC_ADDEND
An ARM64_RELOC_ADDEND relocation reuses the symbol field for the addend value.
We should pass through such relocations.

Reviewed By: alexander-shaposhnikov

Differential Revision: https://reviews.llvm.org/D104967
2021-06-29 11:23:30 -07:00
Jacob Hegna 7b639f5095 [NFC] clang-format on InlineCost.cpp and InlineAdvisor.h. 2021-06-29 18:15:27 +00:00
Nikita Popov f8aaec19e6 [OpaquePtr] Support forward references in textual IR
Currently, LLParser will create a Function/GlobalVariable forward
reference based on the desired pointer type and then modify it when
it is declared. With opaque pointers, we generally do not know the
correct type to use until we see the declaration.

Solve this by creating the forward reference with a dummy type, and
then performing a RAUW with the correct Function/GlobalVariable when
it is declared. The approach is adopted from
b5b55963f6.

This results in a change to the use list order, which is why we see
test changes on some module passes that are not stable under use list
reordering.

Differential Revision: https://reviews.llvm.org/D104950
2021-06-29 20:10:31 +02:00
Craig Topper 9132299836 [LegalizeTypes][VE] Don't Expand BITREVERSE/BSWAP during type legalization promotion if they will be promoted for NVT in op legalization.
We were trying to expand these if they were going to be expanded
in op legalization so that we generated the minimum number of
operations. We failed to take into account that NVT could be
promoted to another legal type in op legalization.

Hoping this fixes the issue on the VE target reported as a follow
up to D96681. The check line changes were taken from before
1e46b6f401 so this patch does
appear to improve some cases that had previously regressed.
2021-06-29 11:00:11 -07:00
Jonas Devlieghere 71be4db05b [lldb] Check for the mangled symbol name for objc_copyRealizedClassList_nolock
When we check whether the Objective-C SPI is available, we need to check
for the mangled symbol name. Unlike `objc_copyRealizedClassList`, which
is C exported, the `nolock` variant is not.

Differential revision: https://reviews.llvm.org/D105136
2021-06-29 10:58:35 -07:00
Louis Dionne a562853a51 [libc++] NFC: Fix return-by-const-value and pass-by-const-value typos
While we can debate on the value of passing by const value, there is no
arguing that it's confusing to do so in some circumstances, such as when
marking a pointer parameter as being const (did you mean a pointer-to-const?).
This commit fixes a few issues along those lines.
2021-06-29 13:57:04 -04:00
Nick Desaulniers 3999dcae5e [Inline] prevent inlining on noprofile mismatch
Similar to
commit bc044a88ee ("[Inline] prevent inlining on stack protector mismatch")

The noprofile function attribute is meant to prevent compiler
instrumentation from being inserted into a function. Inlining may defeat
the developer's intent. If the caller and callee don't either BOTH have
the attribute or BOTH lack the attribute, suppress inline substitution.

This matches behavior being proposed in GCC:
https://gcc.gnu.org/pipermail/gcc-patches/2021-June/573511.html
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80223

Add LangRef entry for noprofile fn attr, similar to text added in D93422
and D104944.

Reviewed By: MaskRay, melver, phosek

Differential Revision: https://reviews.llvm.org/D104810
2021-06-29 10:32:03 -07:00
Melanie Blower aaba37187f [clang][PATCH][nfc] Refactor TargetInfo::adjust to pass DiagnosticsEngine to allow diagnostics on target-unsupported options
Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D104729
2021-06-29 13:26:23 -04:00
Akira Hatanaka 952944c12c [ObjC][ARC] Don't add operand bundle clang.arc.attachedcall to a call if
the call already has the operand bundle

This bug was causing the call to `replaceAllUsesWith` to crash because
the old call instruction and the new call instruction were the same.

rdar://74957948

Differential Revision: https://reviews.llvm.org/D97824
2021-06-29 10:23:01 -07:00
Alexey Bataev 129ae515fb [INSTCOMBINE] Transform reduction(shuffle V, poison, unique_mask) to reduction(V).
After SLP + LTO we may have have reduction(shuffle V, poison,
mask). This can be simplified to just reduction(V) if the mask is only
for single vector and just all elements from this vector are permuted,
  without reusing, replacing with undefs and/or other values, etc.

Differential Revision: https://reviews.llvm.org/D105053
2021-06-29 10:02:38 -07:00
Michael Kruse 5d933c0b0c [Flang][test] Fix Windows buildbot after D104930.
Add

    REQUIRES: shell

to the unpack.f90 test that executes a UNIX shell script.
2021-06-29 17:01:45 +00:00
Raphael Isemann c00032321a [lldb] Skip TestPairFromStdModule for now
I didn't get around to fix this change and the original commit itself seems
fine, so this looks like an existing LLDB/Clang bug that was just uncovered
by this change. Skipping while I'm investigating.
2021-06-29 19:01:11 +02:00
Craig Topper 3b6dfa381e [RISCV] Protect the SHL/SRA/SRL handlers in LowerOperation against being called for an illegal i32 shift amount.
It seems it is possible for DAG combine to create a shl with an
i64 result type and an i32 shift amount. This is ok before type
legalization since the type don't need to match in SelectionDAG.
This results in type legalization calling LowerOperation to
legalize just the amount. We weren't expecting this so we
asserted for not finding a fixed vector shift.

To fix this, I've added a check for the fixed vector case and
returned SDValue() to get the default type legalizer. I've
factored all shifts together and added a fixed vector specific
handler to avoid repeating similar code for each in
LowerOperation.

The particular case I found was exposed by D104581, but the bad
shift is created after that patch triggers.
2021-06-29 09:45:13 -07:00
Arthur O'Dwyer 287847dace [libc++] Update ABI docs. NFCI.
Differential Revision: https://reviews.llvm.org/D103160
2021-06-29 12:39:23 -04:00
Eugene Zhulenev 9ccdaac8f9 [mlir:Async] Fix a bug in automatic refence counting around function calls
Depends On D104998

Function calls "transfer ownership" to the callee and it puts additional constraints on the reference counting optimization pass

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D104999
2021-06-29 09:35:43 -07:00
Eugene Zhulenev 6088f86a2e [mlir:Async] Convert AsyncParallelFor pass to ModuleOp pass
Depends On D104891

Outlining scf.parallel body as a function requires async-parallel-for pass to be a ModuleOp pass

Reviewed By: bondhugula

Differential Revision: https://reviews.llvm.org/D104998
2021-06-29 09:28:22 -07:00
Eugene Zhulenev a8f819c6d8 [mlir:Async] Remove async operations if it is statically known that the parallel operation has a single compute block
Depends On D104850

Add a test that verifies that canonicalization removes all async overheads if it is statically known that the scf.parallel operation will be computed using a single block.

Reviewed By: herhut

Differential Revision: https://reviews.llvm.org/D104891
2021-06-29 09:26:28 -07:00
gbreynoo a37f558682 [llvm-objdump] Add --no-print-imm-hex to the command guide
The option --no-print-imm-hex was not included in the command guide for
llvm-objdump but appears in the help text. This commit adds it to the
command guide.

Differential Revision: https://reviews.llvm.org/D104717
2021-06-29 17:18:32 +01:00
gbreynoo 56fa49878b [llvm-objdump] Add testing for --print-imm-hex, --headers, --section-headers and --private-headers
llvm-objdump had some missing coverage that is fixed by this change:
- A test specifically for --print-imm-hex, and coverage of --no-print-imm-hex
- section-headers.test checks the aliases --headers or --section-headers
- A test for the use of --private-headers for ELF that checks the output
- A test for ELF program headers

Differential Revision: https://reviews.llvm.org/D103974
2021-06-29 17:03:21 +01:00
Piotr Sobczak f38a8b54ea [AMDGPU] Fix 224-bit spills
Related to D104622.

Differential Revision: https://reviews.llvm.org/D105109
2021-06-29 17:52:16 +02:00
David Green aaf6a7ac34 [ARM] Extra test for gep immediate costs. NFC 2021-06-29 16:51:47 +01:00
LLVM GN Syncbot 2a063173c1 [gn build] Port d03aa7d6b6 2021-06-29 15:41:00 +00:00
Louis Dionne d03aa7d6b6 [libc++] NFCI: Remove __functional/search.h
The __search helper function was once split into __functional for circular
dependency reasons, however this is not an issue anymore now that we have
finer grained headers.
2021-06-29 11:40:47 -04:00
Eugene Zhulenev e88ac7295f [perf] Fix a data race in the PerfJITEventListener
Concurrent JIT compilation + PerfJITEventListener triggers tsan error

Reviewed By: cota

Differential Revision: https://reviews.llvm.org/D104977
2021-06-29 08:30:31 -07:00
Florian Hahn bd4bfe0e0c
[SCCP] Extend tests added 1092357ccd in with UREM/SREM by 0.
Add additional coverage for computing UREM/SREM C, 0.
2021-06-29 16:08:56 +01:00
Philip Reames e49d65f36d [LV] Fix bug when unrolling (only) a loop with non-latch exit
If we unroll a loop in the vectorizer (without vectorizing), and the cost model requires a epilogue be generated for correctness, the code generation must actually do so.

The included test case on an unmodified opt will access memory one past the expected bound.  As a result, this patch is fixing a latent miscompile.

Differential Revision: https://reviews.llvm.org/D103700
2021-06-29 08:04:26 -07:00
Pratyush Das c33ebad735 Print default template argument if manually specified in typedef declaration.
If a default template type argument is manually specified to be of the default
type, then it is committed when printing the template.

Differential revision: https://reviews.llvm.org/D103040
2021-06-29 14:57:26 +00:00
Louis Dionne 58a230455b [libc++] Serialize Lit parameters to make them available to from-scratch configs
Before this patch, Lit parameters that were set as a result of CMake
options were not made available to from-scratch configs. This patch
serializes those parameters into the generated lit config file so that
they are available to all configs.

Differential Revision: https://reviews.llvm.org/D105047
2021-06-29 10:51:42 -04:00
Louis Dionne 7756216547 [libc++] NFCI: Remove code duplication and obsolete declarations in wrap_iter
Differential Revision: https://reviews.llvm.org/D105040
2021-06-29 10:51:07 -04:00
Jeremy Morse e63b18bc84 Catch an extremely obvious memory leak, thanks asan
https://lab.llvm.org/buildbot/#/builders/5/builds/9208

(dbg-phis-merging-in-ldv.mir and dbg-phis-with-loops.mir in the asan
 check stage)
2021-06-29 15:47:17 +01:00
Alex Zinenko bf9dcb4cd2 [mlir] silence -Wunused-variable in Linalg comprehensive bufferize 2021-06-29 16:44:16 +02:00
Johannes Doerfert 4eb90e893f Revert "[OpenMP] Add Two-level Distributed Barrier"
This reverts commit 25073a4ecf.

This breaks non-x86 OpenMP builds for a while now. Until a solution is
ready to be upstreamed we revert the feature and unblock those builds.
See:
  https://reviews.llvm.org/rG25073a4ecfc9b2e3cb76776185e63bfdb094cd98#1005821
and
  https://reviews.llvm.org/rG25073a4ecfc9b2e3cb76776185e63bfdb094cd98#1005821

The currently proposed fix (D104788) seems not to be ready yet:
  https://reviews.llvm.org/D104788#2841928
2021-06-29 09:38:27 -05:00