Commit Graph

426785 Commits

Author SHA1 Message Date
Kazu Hirata 145cc9db2b [CodeGen] Remove futureWeight (NFC)
The last use was removed on Jun 5, 2022 in
commit 5c06f7168f, which itself was
a patch to remove unused code.
2022-06-13 17:10:23 -07:00
Ben Shi d7599be9e8 [Driver] Improve linking options for target AVR
1. Support linking with lld
2. Support user specifed linker script

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D126192
2022-06-13 23:38:59 +00:00
Lang Hames 803c770ee0 [C-API][ORC] Add LLVMOrcExecutionSessionLookup -- generic async symbol lookup.
An API to wrap ExecutionSession::lookup, this allows C API clients to use async
lookup.

The immediate motivation for adding this is to simplify upcoming
definition-generator unit tests.

As we're adding more tests that need to convert between C and C++ flag values
this commit adds helper functions to support this. This patch also updates the
CAPIDefinitionGenerator to use these new utilities.
2022-06-13 16:37:35 -07:00
Peter Klausler 6ce0fba0e8 [flang][runtime] Skip remainder of bad input record even with ADVANCE='NO'
After a recoverable error condition in a READ statement with ADVANCE='NO',
skip the remainder of the current record.

Differential Revision: https://reviews.llvm.org/D127433
2022-06-13 16:36:19 -07:00
V Donaldson d4980803b6 [flang] Intrinsic module procedure pure prefixes
Per 7.11.1p1 - All [ieee_arithmetic and ieee_exceptions] functions are
pure and all the subroutines are impure unless otherwise stated.  Most of
these functions are elemental (and not impure), which implies pure.
Several of the remaining non-elemental functions are missing pure prefixes;
add them.
2022-06-13 16:36:07 -07:00
Peter Klausler 850097d6dc [flang][runtime] Don't loop in runtime if blank appears in BOZ input
The code for scanning BOZ input allows for blanks and tabs to appear,
but can hang if they do and the BOZ input value is not followed by
extra valid digits; the repositioning for the second sweep simply
needed to be done in units of character, not valid digits.

Differential Revision: https://reviews.llvm.org/D127431
2022-06-13 16:26:50 -07:00
Peter Klausler f472c099be [flang] Handle USE association in parse tree rewriting
f18 was treating "f() = 1" as a statement function definition
if it could be viewed as being in the specification part and
"f" was a USE-associated function returning a data pointer.
(The non-USE-associated case is fine.)  Fix to allow for "f"
to be USE associated.

Differential Revision: https://reviews.llvm.org/D127430
2022-06-13 16:20:51 -07:00
Peter Klausler 8eebf46964 [flang] Fix crash on USE error
Handle the case of a non-generic procedure that is USE associated
into a scope that has a generic interface of the same name with an
appropriate error rather than crashing.

Differential Revision: https://reviews.llvm.org/D127429
2022-06-13 16:15:47 -07:00
Peter Klausler db52dda8ab [flang][runtime] Detect overflow of fixed-sized exponent output field
When Ew.dEe or Gw.dEe output has an exponent requiring more than 'e'
digits, the whole output field must overflow to asterisks.  The runtime
was detecting short fields and padding them with zeroes, but not
overflow.

Differential Revision: https://reviews.llvm.org/D127428
2022-06-13 16:10:32 -07:00
Peter Klausler 4c42e67bf7 [flang][runtime] Fix overflow detection for REAL input
The test for an overflow during decimal->binary conversion was taking
place too late, causing the data not to be rescanned from the beginning.

Differential Revision: https://reviews.llvm.org/D127427
2022-06-13 16:05:11 -07:00
Peter Klausler 3f3edbe5fc [flang][runtime] Don't emit any leading blanks for G0/E0 output editing
There were cases where E0.d output editing (or G0.d editing that is converted
to E0.d) would emit one or more leading blank characters; fix them.

Differential Revision: https://reviews.llvm.org/D127426
2022-06-13 16:03:24 -07:00
Craig Topper 17457be1c3 [RISCV] Fix use of texternalsym in output pattern where input was tglobaladdr. NFC
I don't think the name used in the output pattern is used to control
anything about the isel table emission, but it should match the input.
2022-06-13 15:42:42 -07:00
Mogball b1b4808c3f [mlir] Fix CMake file 2022-06-13 22:36:14 +00:00
Benjamin Kramer b8cdff8894 [bazel] Unbreak the build after cf6a7c1947 2022-06-14 00:23:17 +02:00
Mogball 537f220891 [mlir] Support getSuccessorInputs from parent op
Ops that implement `RegionBranchOpInterface` are allowed to indicate that they can branch back to themselves in `getSuccessorRegions`, but there is no API that allows them to specify the forwarded operands. This patch enables that by changing `getSuccessorEntryOperands` to accept `None`.

Fixes #54928

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D127239
2022-06-13 22:21:34 +00:00
Florian Hahn 68df5c5c13
[ConstraintElimination] Add tests with cmps with constant ops only.
Add extra test coverage for conditions with constant ops.
2022-06-13 22:57:54 +01:00
Stanislav Mekhanoshin c97436f8b6 [AMDGPU] Use null for dead sdst operand
Differential Revision: https://reviews.llvm.org/D127542
2022-06-13 14:41:40 -07:00
Amir Ayupov 02d510b416 [BOLT][NFC] Pass Function to BC.printInstructions in BinaryBasicBlock::dump
BC::printInstruction(s) has many uses of Function ptr if it's available:
# printing CFI instructions (unconditional)
# printing debug line information (-print-debug-info)
# printing instruction relocations (-print-relocations)

Enable these uses by passing Function ptr from the primary printing entry point:
BinaryBasicBlock::dump.

Reviewed By: maksfb

Differential Revision: https://reviews.llvm.org/D126916
2022-06-13 14:26:51 -07:00
Kazu Hirata 5c41b0f429 [Analysis] Remove getUniqueInstruction (NFC)
The last use was removed on Apr 7, 2022 in commit
5cefe7d9f5.
2022-06-13 14:26:20 -07:00
Mitch Phillips 2a5d567041 Fix-forward broken ASan test on Windows.
Hopefully the final whack-a-mole.

Relevant differential revision: https://reviews.llvm.org/D126929
2022-06-13 14:23:23 -07:00
Florian Hahn 9129e7bb54
[LV] Replace OrigPHIsToFix in native with VPlan traversal. (NFC)
OrigPHIsToFix is only used in the native path. Collecting phis can be
replaced by iterating over the plan. This also removes another
unnecessary use of a late getVPValue.

This also reduces the coupling between ILV and the VPlan utilities.
2022-06-13 22:20:58 +01:00
Alex Brachet 6d1543a167 [libc] Add explicit casts for string functions
This fixes warnings from `-Wimplicit-int-conversion`

Differential revision: https://reviews.llvm.org/D127694
2022-06-13 21:07:45 +00:00
Peter Collingbourne 0e3c8bdd4b Revert "gn build: Add support for building the standalone ubsan runtime."
As well as followup commits.
Build is still failing on mac. I'll debug it locally.
http://45.33.8.238/macm1/37269/step_4.txt

This reverts commit ee21411107.
This reverts commit 6ef9af6386.
This reverts commit b49bd8e07f.
2022-06-13 14:06:14 -07:00
Alex Brachet 15db8c306d [libc] Add Fuchsia implementation of ::testing::Test 2022-06-13 21:03:51 +00:00
Hubert Tong 5efb380c26 [NFC] Undo AIX build compiler workaround
Removes the workaround from https://reviews.llvm.org/D98509#2732628 for
an AIX build compiler issue.

The AIX build compiler product that caused the issue has since been
fixed. Also, the AIX build compiler has been changed to one based on
LLVM.
2022-06-13 17:00:33 -04:00
Peter Collingbourne ee21411107 gn build: Don't define an action for gen_version_script on mac/win.
Nothing should depend on the action on those platforms,
as they don't use version scripts.

Should fix mac build:
http://45.33.8.238/macm1/37264/step_4.txt
2022-06-13 13:54:57 -07:00
Lang Hames 99a7e307ff [C-API][ORC] Add missing error check to unit test. 2022-06-13 13:53:51 -07:00
Lang Hames b425f55693 [C-API][ORC] Fix struct name.
This struct was using the wrong prefix (LLVMJIT... vs LLVMOrc...).
2022-06-13 13:53:51 -07:00
James Nagurne f4fdc4f4d9 Restore missing runtimes-test-depends target that causes build failures when LLVM_INCLUDE_TESTS is ON
7cc8377f removed the 'runtimes-test-depends' target in runtimes builds that
is assumed to exist when using a bootstrapped runtime build.

For a full analysis, see:
https://discourse.llvm.org/t/looking-for-guidance-on-broken-downstream-bootstrapped-runtimes-builds/62934

Differential Revision: https://reviews.llvm.org/D127325
2022-06-13 15:47:38 -05:00
Peter Collingbourne 6ef9af6386 gn build: Disable ubsan build on mac/win.
Build failures:
http://45.33.8.238/macm1/37263/step_4.txt
http://45.33.8.238/win/60034/step_4.txt
2022-06-13 13:45:14 -07:00
Craig Topper e4062522d3 [RISCV] Disable matchSplatAsGather for i1 vectors to prevent creating illegal nodes.
We were incorrectly creating a VRGATHER node with i1 vector type. We
could support this by promoting the mask to i8 and truncating it, but
for now I want to prevent the crash.

Fixes PR56007.

Reviewed By: reames

Differential Revision: https://reviews.llvm.org/D127681
2022-06-13 13:41:39 -07:00
Mahesh Ravishankar cf6a7c1947 [mlir][TilingInterface] Add pattern to tile using TilingInterface and implement TilingInterface for Linalg ops.
This patch adds support for tiling operations that implement the
TilingInterface.
- It separates the loop constructs that are used to iterate over tile
  from the implementation of the tiling itself. For example, the use
  of destructive updates is more related to use of scf.for for
  iterating over tiles that are tensors.
- To test the transformation, TilingInterface is implemented for
  LinalgOps. The separation of the looping constructs used from the
  implementation of tile code generation greatly simplifies the
  latter.
- The implementation of TilingInterface for LinalgOp is kept as an
  external model for now till this approach can be fully flushed out
  to replace the existing tiling + fusion approaches in Linalg.

Differential Revision: https://reviews.llvm.org/D127133
2022-06-13 20:37:44 +00:00
Zequan Wu 602a951bfe Partially revert 3222f95ea8 2022-06-13 13:29:32 -07:00
Stanislav Mekhanoshin cb9ae93712 [AMDGPU] Define SGPR_NULL64 register. NFCI.
On gfx10+ null register can be used as both 32 and 64 bit operand.
Define a 64 bit version of the register to use during codegen.

Differential Revision: https://reviews.llvm.org/D127527
2022-06-13 13:23:33 -07:00
Peter Collingbourne 7316b0d54c gn build: Add support for building the AArch64 LSE builtins.
Differential Revision: https://reviews.llvm.org/D127560
2022-06-13 13:15:29 -07:00
Peter Collingbourne b49bd8e07f gn build: Add support for building the standalone ubsan runtime.
Differential Revision: https://reviews.llvm.org/D127556
2022-06-13 13:15:28 -07:00
Jay Foad bfcfd53b92 [AMDGPU] Add GFX11 llvm.amdgcn.permlane64 intrinsic
Compared to permlane16, permlane64 has no BC input because it has no
boundary conditions, no fi input because the instruction acts as if FI
were always enabled, and no OLD input because it always writes to every
active lane.

Also use the new intrinsic in the atomic optimizer pass.

Differential Revision: https://reviews.llvm.org/D127662
2022-06-13 21:12:11 +01:00
LLVM GN Syncbot be232979bc [gn build] Port ea9ff9fac3 2022-06-13 20:04:00 +00:00
Jay Foad 7b9f620e78 [AMDGPU] Work around GFX11 flat scratch SVS swizzling bug
Differential Revision: https://reviews.llvm.org/D127635
2022-06-13 21:00:42 +01:00
Adrian Prantl ea9ff9fac3 [LLDB][formatters] Add formatter for libc++'s std::span
This patch adds a libcxx formatter for std::span. The
implementation is based on the libcxx formatter for
std::vector. The main difference is the fact that
std::span conditionally has a __size member based
on whether it has a static or dynamic extent.

Example output of formatted span:

(std::span<const int, 18446744073709551615>) $0 = size=6 {
  [0] = 0
  [1] = 1
  [2] = 2
  [3] = 3
  [4] = 4
  [5] = 5
}
The second template parameter here is actually std::dynamic_extent,
but the type declaration we get back from the TypeSystemClang is the
actual value (which in this case is (size_t)-1). This is consistent
with diagnostics from clang, which doesn't desugar this value either.
E.g.,:

span.cpp:30:31: error: implicit instantiation of undefined template
    'Undefined<std::span<int, 18446744073709551615>>'
Testing:

Added API-tests

Confirmed manually using LLDB cli that printing spans works in various scenarios

Patch by Michael Buch!

Differential Revision: https://reviews.llvm.org/D127481
2022-06-13 12:59:38 -07:00
Jay Foad 53e31e273f [AMDGPU] Add some GFX11 atomic optimizer testing
Differential Revision: https://reviews.llvm.org/D127661
2022-06-13 20:59:18 +01:00
Jay Foad d943c51465 [AMDGPU] Fix GFX11 codegen for V_MAD_U64_U32 and V_MAD_I64_I32
GFX11 uses different pseudos for these because of a new constraint
on which operands' registers can overlap.

Differential Revision: https://reviews.llvm.org/D127659
2022-06-13 20:59:18 +01:00
Daniel Bertalan 5f627cc225 [lld-macho] Fix symbol name returned from InputSection::getLocation
This commit fixes the issue that getLocation always printed the name of
the first symbol in the section.

For clarity, upper_bound is used instead of a linear search for finding
the closest symbol name. Note that this change does not affect
performance: this function is only called when printing errors and
`symbols` typically contains a single symbol because of
.subsections_via_symbols.

Differential Revision: https://reviews.llvm.org/D127670
2022-06-13 15:49:27 -04:00
LLVM GN Syncbot c39b76ae2e [gn build] Port 3abaefe64c 2022-06-13 19:41:30 +00:00
Nikolas Klauser 993a22ecca [libc++] Simplify the char_traits specializations
Reviewed By: ldionne, #libc

Spies: mgorny, EricWF, mclow.lists, libcxx-commits

Differential Revision: https://reviews.llvm.org/D127159
2022-06-13 21:38:13 +02:00
Eric Schweitz f5b970c9ef
[flang] Fix type mismatch in verification error
FIR models Fortran intrinsic types with deliberate KIND values. Like
Fortran, COMPLEX and REAL have related KINDs in FIR. Lowering now
converts REAL types to floating point (MLIR) up front. This patch moves
the code to convert from FIR RealType to MLIR FloatType out of codegen
and into the builder, allowing FIR ComplexTypes to have their element
type returned as an MLIR FloatType.

We should consider whether to replace fir::ComplexType with
mlir::ComplexType at some point. I believe these types are presently
used to convey distinctins in the target ABIs in the Tilikum bridge
however.

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: PeteSteinfeld

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

Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
2022-06-13 21:37:39 +02:00
Nikolas Klauser 3abaefe64c [libc++] Granularize some more of <type_traits>
Reviewed By: ldionne, #libc

Spies: libcxx-commits, mgorny

Differential Revision: https://reviews.llvm.org/D127631
2022-06-13 21:37:26 +02:00
Eric Schweitz 0c1cf585c0
[flang][NFC] Add source location information to report unsupported complex types
This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: jeanPerier, PeteSteinfeld

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

Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
2022-06-13 21:31:17 +02:00
Mitch Phillips 77475ffd22 Reland "Add sanitizer metadata attributes to clang IR gen."
RE-LAND (reverts a revert):
This reverts commit 8e1f47b596.

This patch adds generation of sanitizer metadata attributes (which were
added in D126100) to the clang frontend.

We still currently generate the llvm.asan.globals that's consumed by
the IR pass, but the plan is to eventually migrate off of that onto
purely debuginfo and these IR attributes.

Reviewed By: vitalybuka, kstoimenov

Differential Revision: https://reviews.llvm.org/D126929
2022-06-13 12:23:27 -07:00
Balazs Benics 0539b456b7 [analyzer][NFC] Remove unused Analyses enum
Reviewed By: martong

Differential Revision: https://reviews.llvm.org/D127485
2022-06-13 21:19:55 +02:00