platform/upstream/llvm.git
2 years ago[flang] Lower character result of bind(c) function by value
Valentin Clement [Sat, 24 Sep 2022 06:58:50 +0000 (08:58 +0200)]
[flang] Lower character result of bind(c) function by value

BIND(C) Function returning character must return it by value and
not as hidden argument like done currently. This patch update the
code to return it by value for both use cases.

Reviewed By: PeteSteinfeld

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

2 years ago[RISCV] Rename RISCVScheduleB.td to RISCVScheduleZb.td. NFC
Craig Topper [Sat, 24 Sep 2022 04:38:03 +0000 (21:38 -0700)]
[RISCV] Rename RISCVScheduleB.td to RISCVScheduleZb.td. NFC

2 years ago[RISCV] Add missing scheduler classes to Zbkb and Zbkx instructions.
Craig Topper [Sat, 24 Sep 2022 04:37:09 +0000 (21:37 -0700)]
[RISCV] Add missing scheduler classes to Zbkb and Zbkx instructions.

2 years ago[mlir][spirv] Switch to kEmitAccessorPrefix_Predixed
Jakub Kuderski [Sat, 24 Sep 2022 04:36:53 +0000 (00:36 -0400)]
[mlir][spirv] Switch to kEmitAccessorPrefix_Predixed

Fixes https://github.com/llvm/llvm-project/issues/57887

Reviewed By: antiagainst

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

2 years ago[RISCV] Remove a few remnants of Zbr I misssed.
Craig Topper [Sat, 24 Sep 2022 04:21:51 +0000 (21:21 -0700)]
[RISCV] Remove a few remnants of Zbr I misssed.

2 years ago[mlir][nvgpu] Use TableGen TypeDef for NVGPU dialect types
Christopher Bate [Fri, 23 Sep 2022 20:37:38 +0000 (14:37 -0600)]
[mlir][nvgpu] Use TableGen TypeDef for NVGPU dialect types

Moves definition of DeviceAsyncToken to use the declarative Tablegen
TypeDef since the type is trivial. This also allows for removing the
current code for parsing/printing types by using the auto-generated
functions.

Reviewed By: ThomasRaoux

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

2 years agoRevert "[RISCV] Lower BUILD_VECTOR to RISCVISD::VID_VL if it is floating-point type."
Craig Topper [Sat, 24 Sep 2022 00:16:09 +0000 (17:16 -0700)]
Revert "[RISCV] Lower BUILD_VECTOR to RISCVISD::VID_VL if it is floating-point type."

This reverts commit dd53a0bb30413d26c3ab63a5c57c3cdf301be7a1.

We have seen crashes from this internally. Probably due to the use
of RoundingMode::Dynamic.

2 years ago[mlir][spirv] Switch to kEmitAccessorPrefix_Both
Jakub Kuderski [Sat, 24 Sep 2022 01:28:58 +0000 (21:28 -0400)]
[mlir][spirv] Switch to kEmitAccessorPrefix_Both

Prepare for switching to prefixed accessors.

Issue: https://github.com/llvm/llvm-project/issues/57887

Reviewed By: antiagainst, rriddle

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

2 years ago[flang] Fix crash in semantics in error recovery
Peter Klausler [Wed, 7 Sep 2022 00:45:38 +0000 (17:45 -0700)]
[flang] Fix crash in semantics in error recovery

When a FUNCTION statement has both an explicit type in its prefix
and a RESULT clause in its suffix, semantics crashes due to the
redundant type; emit a nice error message instead.

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

2 years agoImplement nanosleep per https://pubs.opengroup.org/onlinepubs/009695399/basedefs...
Raman Tenneti [Sat, 24 Sep 2022 00:13:23 +0000 (00:13 +0000)]
Implement nanosleep per https://pubs.opengroup.org/onlinepubs/009695399/basedefs/time.h.html

Tested:
Limited unit test: This makes a call and checks that no error was
returned, but we currently don't have the ability to ensure that
time has elapsed as expected.

Co-authored-by: Jeff Bailey <jeffbailey@google.com>
Reviewed By: sivachandra, jeffbailey

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

2 years ago[flang] Preserve component array lower bounds in folding
Peter Klausler [Wed, 21 Sep 2022 19:22:18 +0000 (12:22 -0700)]
[flang] Preserve component array lower bounds in folding

When a component array of a named constant is extracted as
a constant value, ensure that the lower bounds of the array
are properly acquired from the declaration of the component.

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

2 years ago[RISCV] Merge half-intrinsics-strict.ll into zvh-half-intrinsics-strict.ll. NFC
Craig Topper [Fri, 23 Sep 2022 21:25:27 +0000 (14:25 -0700)]
[RISCV] Merge half-intrinsics-strict.ll into zvh-half-intrinsics-strict.ll. NFC

I had forgotten how we had the files partitioned.

2 years ago[objdump] Fix typo in error message.
Daniel Rodríguez Troitiño [Fri, 23 Sep 2022 23:10:27 +0000 (16:10 -0700)]
[objdump] Fix typo in error message.

Change "inconsistant" for "inconsistent" in the message, the file name
and the test output.

Reviewed By: pete, MaskRay

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

2 years ago[flang][runtime] Enabled HAS_FLOAT128 for builds with clang.
Slava Zakharin [Thu, 22 Sep 2022 23:58:53 +0000 (16:58 -0700)]
[flang][runtime] Enabled HAS_FLOAT128 for builds with clang.

I am building with clang, and I noticed for quite a while that
REAL(16) runtimes functions are not available. I did not know why
until I saw this typo.

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

2 years ago[flang] Fix spurious error with COMMON and EQUIVALENCE
Peter Klausler [Wed, 21 Sep 2022 19:21:18 +0000 (12:21 -0700)]
[flang] Fix spurious error with COMMON and EQUIVALENCE

f18 emits an error message when two objects related by EQUIVALENCE
to a third are specified as members of a COMMON block.  This is not
always a sign of an error, however; it is possible for multiple objects
in a COMMON block to all be equivalenced to distinct offsets in another
object in a way that is consistent.  So refine the check.

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

2 years ago[flang] Allow "non-expandable" scalars in single-element contexts
Peter Klausler [Wed, 21 Sep 2022 19:20:25 +0000 (12:20 -0700)]
[flang] Allow "non-expandable" scalars in single-element contexts

When a scalar expression is not expandable -- i.e., it would have to be
evaluated once and saved in a temporary to avoid changing the semantics
of the program if it were to be evaluated more than once -- it affects
some aspects of folding and expression semantics.  In cases where
scalar expansion would not cause multiple evaluations due to the shape
of the result having but a single element, however, these "non-expandable"
scalar expressions can be safely allowed.

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

2 years agoMake MLIR model URLs cache variables
Yi Kong [Fri, 23 Sep 2022 22:21:53 +0000 (15:21 -0700)]
Make MLIR model URLs cache variables

This allows us to directly use the models published on Github.

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

2 years ago[AMDGPU] Precommit switching test to generated checks for D134463
jeff [Fri, 23 Sep 2022 22:08:51 +0000 (22:08 +0000)]
[AMDGPU] Precommit switching test to generated checks for D134463

Change-Id: I0d90f86ab759347a2f20448d28cc09ddaea3a4d4

2 years ago[flang] Allow a generic-spec on a PUBLIC/PRIVATE statement to declare a generic
Peter Klausler [Wed, 21 Sep 2022 19:19:22 +0000 (12:19 -0700)]
[flang] Allow a generic-spec on a PUBLIC/PRIVATE statement to declare a generic

A generic-spec can appear on a module accessibility control statement
even if it has not been declared as a generic interface, because there's
nothing else that it could be.

While here, simplify the parse tree and parser for AccessId, since
one of its alternatives is ambiguous with the other.

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

2 years ago[flang] Fold IS_CONTIGUOUS() to .FALSE. when it is known to be
Peter Klausler [Wed, 21 Sep 2022 19:18:15 +0000 (12:18 -0700)]
[flang] Fold IS_CONTIGUOUS() to .FALSE. when it is known to be

At present, IS_CONTIGUOUS() can only either fold to .TRUE. or
remain unknown.  The underlying analysis, however, is capable
of returning a tri-state result (true, false, or unknown).
Extend and expose it to folding so that IS_CONTIGUOUS() can
fold to .FALSE. as well as to .TRUE. when contiguity is
known.

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

2 years ago[RISCV] Promote f16 STRICT_FCEIL/FLOOR/TRUNC/NEARBYINT/RINT/ROUND,ROUNDEVEN to f32.
Craig Topper [Fri, 23 Sep 2022 20:59:30 +0000 (13:59 -0700)]
[RISCV] Promote f16 STRICT_FCEIL/FLOOR/TRUNC/NEARBYINT/RINT/ROUND,ROUNDEVEN to f32.

2 years ago[flang] Don't emit portability warnings for things in module files
Peter Klausler [Wed, 21 Sep 2022 19:16:37 +0000 (12:16 -0700)]
[flang] Don't emit portability warnings for things in module files

Any symbol in a module file will have been already shamed with
portability warnings when the module was compiled, so don't pile
on when compiling other program units that use the module.
This also silences warnings about some symbols whose names were
created or extended by the compiler to avoid clashes.

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

2 years ago[RISCV] Simplify check-prefixes in half-intrinsics.ll. NFC
Craig Topper [Fri, 23 Sep 2022 18:47:58 +0000 (11:47 -0700)]
[RISCV] Simplify check-prefixes in half-intrinsics.ll. NFC

2 years ago[flang] Fix spurious errors from MODULE subprograms
Peter Klausler [Wed, 21 Sep 2022 19:15:09 +0000 (12:15 -0700)]
[flang] Fix spurious errors from MODULE subprograms

When an explicit MODULE procedure is defined in the same (sub)module
as its interface, and the interface was defined in a generic
interface of the same name, bogus errors about symbols already
having been defined will ensue.  Cleaning up this aspect of name
resolution and symbol table management requires marking the
place-holding SubprogramNameDetails symbols of explicit MODULE
subprograms as such, ensuring that that attribute is not inherited
if the SubprogramNameDetails symbol is recycled as a SubprogramDetails,
and gathering some code that should have been common between
BeginSubprogram() and BeginMpSubprogram() together in one
new routine.

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

2 years ago[clang][AMDGPU] Temporarily disable clang atomic fadd test for gfx90a
Petar Avramovic [Fri, 23 Sep 2022 19:48:27 +0000 (21:48 +0200)]
[clang][AMDGPU] Temporarily disable clang atomic fadd test for gfx90a

Test is broken by D130579. Temporarily disable to silence builbot failures.

2 years agoFix Z3 version detection regexp
Mikhail Korolev [Fri, 23 Sep 2022 18:46:32 +0000 (15:46 -0300)]
Fix Z3 version detection regexp

regexp for try_run path expects '0 or more' digits which is incorrect because it should be 'one or more', regexp for header parsing expects 'exactly one' digit which is incorrect with current Z3 version (4.11.2)

Reviewed By: mikhail.ramalho

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

2 years agoRevert "[SROA] Create additional vector type candidates based on store and load slices"
Douglas Yung [Fri, 23 Sep 2022 18:24:02 +0000 (11:24 -0700)]
Revert "[SROA] Create additional vector type candidates based on store and load slices"

This reverts commit de3445e0ef15c420955ad720fccf08473f460443.

This is causing GHI #57796 and #57821.

2 years agoRevert "[SROA] Check typeSizeEqualsStoreSize in isVectorPromotionViable"
Douglas Yung [Fri, 23 Sep 2022 18:23:51 +0000 (11:23 -0700)]
Revert "[SROA] Check typeSizeEqualsStoreSize in isVectorPromotionViable"

This reverts commit 3f08d248c44c744deda38423409b86720822739e.

The commit this change is fixing is being reverted due to GHI #57796 and #37821, so revert this commit as well.

2 years ago[flang] Replace negative known CHARACTER length with zero in type analysis
Peter Klausler [Wed, 21 Sep 2022 19:12:36 +0000 (12:12 -0700)]
[flang] Replace negative known CHARACTER length with zero in type analysis

When a DynamicType for CHARACTER has a known length, correct a negative
length value to its effective length of zero so that all such types
compare equal in interface compatibility checking.

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

2 years agoFix GH57943: Friend constraint checker didn't handle null decls.
Erich Keane [Fri, 23 Sep 2022 19:17:12 +0000 (12:17 -0700)]
Fix GH57943: Friend constraint checker didn't handle null decls.

Apparently TransformDecl in TreeTransform can be called with a nullptr
for a Decl, so my casts were illegal.  The fix here is to add an early
exit to my TransformDecl.

2 years ago[AMDGPU] Add GFX11 feature for subtargets with more VGPRs
Jay Foad [Fri, 23 Sep 2022 08:02:49 +0000 (09:02 +0100)]
[AMDGPU] Add GFX11 feature for subtargets with more VGPRs

The full complement of physical VGPRs for GFX11 is 50% more than GFX10.
Some subtargets have this, others stay the same as GFX10. This affects
occupancy calculations.

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

2 years ago[RegisterCoalescer] fix dst subreg replacement during remat copy trick
Afanasyev Ivan [Fri, 23 Sep 2022 18:52:29 +0000 (18:52 +0000)]
[RegisterCoalescer] fix dst subreg replacement during remat copy trick

Instructions might use definition register as its "undef" operand. It
happens on architectures with predicated executon:

```
%0:subreg = instruction op_1, ..., op_N, undef %0:subreg, op_N+2, ...
```

RegisterCoalescer should take into account all remat instruction
operands during destination subregister fixup.

```
; remat result before fix:
%1 = instruction op_1, ..., op_N, undef %1:subreg, op_N+2, ...

; remat result after fix (correct):
%1 = instruction op_1, ..., op_N, undef %1, op_N+2, ...
```

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

2 years ago[flang] A separate module procedure must inherit interface attributes
Peter Klausler [Wed, 21 Sep 2022 19:09:56 +0000 (12:09 -0700)]
[flang] A separate module procedure must inherit interface attributes

Attributes like PURE, ELEMENTAL, &c. are specified on the interface of
a separate module procedure, so when the MODULE PROCEDURE is defined in
a submodule, it must acquire those attributes from the interface.

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

2 years agoRestore "[MemProf] Memprof profile matching and annotation"
Teresa Johnson [Fri, 23 Sep 2022 13:43:07 +0000 (06:43 -0700)]
Restore "[MemProf] Memprof profile matching and annotation"

This reverts commit 794b7ea960ccc3222f2af582efadbc5e5c464292, and
thus restores commit a212d8da94d08e229aa8d65283e4b116310bba10, and
follow on fixes 0cd6763fa93159b84d70a5bb602c24996acaafaa,
e9ff53d42feac7fc157718523275619a8106f2f3, and
37c6a25e9ab230e5e21fa34e246d9fec55275df0.

Use a hash function (BLAKE3) instead of hash_combine/hash_code which are
not guaranteed to be stable across executions.

Additionally, it adds a "REQUIRES: x86_64-linux" to the tests that have
raw profile inputs to avoid failures on big endian bots.

Reviewers: snehasish, davidxl

Subscribers: llvm-commits

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

2 years agoReland "[llvm] Support forward-referenced globals with dso_local_equivalent"
Leonard Chan [Wed, 21 Sep 2022 20:15:14 +0000 (20:15 +0000)]
Reland "[llvm] Support forward-referenced globals with dso_local_equivalent"

This reverts commit eef5db2c744e4799dc40ada54fdde7dbbd552807.

See https://github.com/llvm/llvm-project/issues/57815.

dso_local_equivalent would fail with an assertion on forward-referenced
globals. This is an issue that only comes up in textual IR, which is why
we've never seen this assertion with clang.

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

2 years ago[flang] Accept a separate module procedure interface as a specific procedure
Peter Klausler [Thu, 1 Sep 2022 17:14:24 +0000 (10:14 -0700)]
[flang] Accept a separate module procedure interface as a specific procedure

The code snippet

  module m
    interface
      module subroutine specific
      end subroutine
    end interface
    interface generic
       module procedure specific
    end interface
  end module

elicits a bogus semantic error about "specific" not being an acceptable
module procedure for the generic interface; fix.

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

2 years ago[flang] Special handling of ENTRY BIND(C,NAME=...)
Peter Klausler [Wed, 21 Sep 2022 19:06:40 +0000 (12:06 -0700)]
[flang] Special handling of ENTRY BIND(C,NAME=...)

We apply special symbol table scoping to top-level subroutine
and function names that have interoperable binding names, so
that it's possible to define the same subroutine/function name
more than once at the top level so long as their binding names
are distinct.  But we don't use those scoping techniques for
ENTRY statement symbols with interoperable binding names,
which can lead to bogus semantic errors when the same ENTRY
name is defined multiple times with distinct binding names.

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

2 years ago[flang][NFC] Document non-extension (user ELEMENTAL procedures as actual arguments)
Peter Klausler [Wed, 21 Sep 2022 19:05:20 +0000 (12:05 -0700)]
[flang][NFC] Document non-extension (user ELEMENTAL procedures as actual arguments)

Some Fortran compilers accept user-defined ELEMENTAL procedures as actual
arguments corresponding to (necessarily) non-ELEMENTAL dummy procedures;
most do not, and f18 is one of them.  Document the fact that this is not
a supported extension.

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

2 years ago[flang] Don't resolve names in derived type definitions to generics
Peter Klausler [Wed, 21 Sep 2022 19:03:54 +0000 (12:03 -0700)]
[flang] Don't resolve names in derived type definitions to generics

There's code in name resolution that handles resolution of references
that appear in the definitions of derived types -- it checks for
existing components in the type being defined, as well as for
non-parent components in its ancestors.  Special case code prevents
resolution of a name to the symbol of a procedure binding.  This
code needs to be extended so that names of generic procedures
are similarly prevented from shadowing symbols in the scope around
the type.

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

2 years ago[mlir] NFC: move mergeOffsetsSizesAndStrides into Affine/Utils
Lei Zhang [Fri, 23 Sep 2022 17:20:10 +0000 (13:20 -0400)]
[mlir] NFC: move mergeOffsetsSizesAndStrides into Affine/Utils

So that these utility functions can also be used ViewLikeInterface
ops not in the memref dialect.

Reviewed By: mravishankar, christopherbate

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

2 years ago[LV] Update handling of scalable pointer inductions after b73d2c8.
Florian Hahn [Fri, 23 Sep 2022 17:23:01 +0000 (18:23 +0100)]
[LV] Update handling of scalable pointer inductions after b73d2c8.

The dependent code has been changed quite a lot since 151c144 which
b73d2c8 effectively reverts. Now we run into a case where lowering
didn't expect/support the behavior pre 151c144 any longer.

Update the code dealing with scalable pointer inductions to also check
for uniformity in combination with isScalarAfterVectorization. This
should ensure scalable pointer inductions are handled properly during
epilogue vectorization.

Fixes #57912.

2 years agoRevert "[AggressiveInstCombine] Combine consecutive loads which are being merged...
Dmitri Gribenko [Fri, 23 Sep 2022 17:05:34 +0000 (19:05 +0200)]
Revert "[AggressiveInstCombine] Combine consecutive loads which are being merged to form a wider load."

This reverts commit 3c70c8c1df66500f67f77596b1e76cf0a8447ee5.

After this commit, during the 3-stage bootstrap the second-stage Clang
crashes.

2 years ago[AMDGPU] Precommit switching test to generated checks for D134463
jeff [Fri, 23 Sep 2022 16:22:14 +0000 (16:22 +0000)]
[AMDGPU] Precommit switching test to generated checks for D134463

Change-Id: Iaa8f6263178cfa8405d9a0298b2695b32a42fdf3

2 years ago[libc][obvious] disable mprotect test under sanitizers
Michael Jones [Fri, 23 Sep 2022 17:01:17 +0000 (10:01 -0700)]
[libc][obvious] disable mprotect test under sanitizers

fixes a build failure in my previous patch

Reviewed By: sivachandra

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

2 years ago[mlir] Plumb missing paramter to gpu transform op
Thomas Raoux [Fri, 23 Sep 2022 16:49:23 +0000 (16:49 +0000)]
[mlir] Plumb missing paramter to gpu transform op

rewriteMapNestedForeachThreadToGpuThreads was dropping the paramter to
skip inserting barrier

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

2 years ago[SLP] Adjust debug output for store vectorization failure
Philip Reames [Fri, 23 Sep 2022 16:56:08 +0000 (09:56 -0700)]
[SLP] Adjust debug output for store vectorization failure

When store vectorization is infeasible, it's helpful to have a debug logging indication of why.  A case I've hit a couple times now is accidentally using -march instead of -mtriple and getting the default TTI results.  This causes max-vf to become 1, and thus hits the added logging line.

2 years agoRevert "[Analysis] Make members of InlineCost const (NFC)"
Kazu Hirata [Fri, 23 Sep 2022 16:41:21 +0000 (09:41 -0700)]
Revert "[Analysis] Make members of InlineCost const (NFC)"

This reverts commit 9ac934d1bf5769276335b247e954f2dbcb467c79.

I'm reverting this to accommodate Yevgeny Rouban's downstream branch
where a field of InlineCost changes.

2 years ago[libc] add madvise and posix_madvise
Michael Jones [Wed, 21 Sep 2022 23:59:29 +0000 (16:59 -0700)]
[libc] add madvise and posix_madvise

Add the madvise and posix_madvise syscall wrappers and tests.

Reviewed By: sivachandra

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

2 years ago[libc] add mprotect
Michael Jones [Wed, 21 Sep 2022 23:51:53 +0000 (16:51 -0700)]
[libc] add mprotect

Add the mprotect syscall wrapper and tests.

Reviewed By: sivachandra

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

2 years ago[libc] move sys/mman macros to /include
Michael Jones [Wed, 21 Sep 2022 23:49:30 +0000 (16:49 -0700)]
[libc] move sys/mman macros to /include

Previously the mman macros were in api.td, but platform differences are
easier to handle with preprocessor macros so they have been moved to
include. Also I completed the list of macros (at least for what I need
soon) and fixed some previously incorrect values.

Reviewed By: sivachandra, lntue

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

2 years ago[X86] Use BuildStackAdjustment in stack probes
Josh Stone [Thu, 22 Sep 2022 19:56:20 +0000 (12:56 -0700)]
[X86] Use BuildStackAdjustment in stack probes

This has the advantage of dealing with live EFLAGS, using LEA instead of
SUB if needed to avoid clobbering. That also respects feature "lea-sp".

We could allow unrolled stack probing from blocks with live-EFLAGS, if
canUseAsEpilogue learns when emitStackProbeInlineGeneric will be used.

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

2 years ago[X86] Don't allow prologue stack probing with live EFLAGS
Josh Stone [Thu, 22 Sep 2022 18:45:37 +0000 (11:45 -0700)]
[X86] Don't allow prologue stack probing with live EFLAGS

Fixes https://github.com/llvm/llvm-project/issues/49509

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

2 years ago[NFC][CodeGen] Use const MF in TargetLowering stack probe functions
Josh Stone [Thu, 22 Sep 2022 18:34:26 +0000 (11:34 -0700)]
[NFC][CodeGen] Use const MF in TargetLowering stack probe functions

This makes them callable from places like canUseAsPrologue.

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

2 years ago[bazel] Be consistent and say we don't support libfpm everywhere
Arthur Eubanks [Fri, 23 Sep 2022 01:41:50 +0000 (18:41 -0700)]
[bazel] Be consistent and say we don't support libfpm everywhere

We're inconsistent about saying whether or not we support libfpm in the bazel build.

This should perhaps be configurable via a --config.

This allows the buildbots to see when llvm-exegesis-related breakages occur.

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

2 years ago[flang] Improve handling of NULL pointers when folding components of named constants
Peter Klausler [Wed, 21 Sep 2022 19:02:15 +0000 (12:02 -0700)]
[flang] Improve handling of NULL pointers when folding components of named constants

When a component reference to a named constant of derived type should
fold down to NULL() without a MOLD=, do so.

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

2 years ago[PhaseOrdering] add test for issue #50778; NFC
Sanjay Patel [Fri, 23 Sep 2022 16:08:39 +0000 (12:08 -0400)]
[PhaseOrdering] add test for issue #50778; NFC

Several different passes are involved to get the expected IR,
and we don't want that to break again.

2 years ago[lldb] Use Optional::{has_value,value,value_or}
Kazu Hirata [Fri, 23 Sep 2022 16:10:40 +0000 (09:10 -0700)]
[lldb] Use Optional::{has_value,value,value_or}

2 years agoRevert "[PhaseOrdering] add test for issue #50778; NFC"
Sanjay Patel [Fri, 23 Sep 2022 16:06:29 +0000 (12:06 -0400)]
Revert "[PhaseOrdering] add test for issue #50778; NFC"

This reverts commit cdc012fa2696434689c872abc4797a1ee8284ddf.
This accidentally deleted a test file (not sure how that became
part of the commit).

2 years ago[PhaseOrdering] add test for issue #50778; NFC
Sanjay Patel [Fri, 23 Sep 2022 15:41:04 +0000 (11:41 -0400)]
[PhaseOrdering] add test for issue #50778; NFC

Several different passes are involved to get the expected IR,
and we don't want that to break again.

2 years agoAMDGPU: Use tablegen patterns for buffer global and flat atomic fadd
Petar Avramovic [Fri, 23 Sep 2022 15:51:29 +0000 (17:51 +0200)]
AMDGPU: Use tablegen patterns for buffer global and flat atomic fadd

Remove manual selection for atomic fadd from global-isel.
Stop pre-isel translation to AtomicLoadFAdd/G_ATOMICRMW_FADD
which corresponds to llvm-ir's atomicrmw fadd instruction.

global and flat atomic fadd patterns changes:
Split rtn/no-rtn patterns
Add missing patterns or fix predicates
Remove atomicrmw patterns for v2f16 (atomic rmw doesn't support vectors).
Patterns now check addrspace of pointer, added patterns for flat intrinsic.
with global addrspace pointer that selects into global atomic instruction.

buffer atomic fadd patterns changes:
Rdit patterns to import into global-isel.
Remove gfx6/gfx7 _addr64 and _offset patterns.
Remove patterns that can't be reached (same pattern but different feature).

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

2 years agoAMDGPU: Improve atomicrmw fadd selection
Petar Avramovic [Fri, 23 Sep 2022 15:46:33 +0000 (17:46 +0200)]
AMDGPU: Improve atomicrmw fadd selection

Use same atomicrmw fadd expansion rules for gfx908, gfx940 and gfx11
as for gfx90a. Add missing globalisel legalizer support for flat
atomicrmw fadd f32 on gfx940 and gfx11.
Isel support for gfx11 will be added in D130579.

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

2 years agoAMDGPU: Add detailed buffer, global and flat atomic fadd tests
Petar Avramovic [Fri, 23 Sep 2022 15:40:00 +0000 (17:40 +0200)]
AMDGPU: Add detailed buffer, global and flat atomic fadd tests

Precommit for D130579 that will remove manual selection and use
patterns from td files. Tests are grouped based on target features.

All patterns have rtn and no-rtn versions.

buffer atomics patterns are selected based on the intrinsic used
(raw or struct) and the offset operand (imm or vgpr):
_offset raw with imm offset
_offen raw with vgpr offset (or large imm offset)
_idxen struct with imm offset
_bothen struct with vgpr offset (or large imm offset)

global and flat atomics are selected via intrinsic or the atomicrmw fadd.
atomicrmw tests have amdgpu-unsafe-fp-atomics=true and non-system scope
since they get expanded otherwise. atomicrmw fadd does not support vector
type, test float and double.

global atomics patterns are selected based on address type via (global or
flat) intrinsic or atomicrmw fadd with global address(addrspace(1)*).
'no suffix' vgpr addrspace(1)* address
_saddr sgpr addrspace(1)* address

flat atomics patterns are selected via (flat)intrinsic or atomicrmw fadd
with flat address (* - address space 0).

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

2 years ago[AMDGPU] Add FeatureFlatAtomicFaddF32Inst
Petar Avramovic [Fri, 23 Sep 2022 15:33:45 +0000 (17:33 +0200)]
[AMDGPU] Add FeatureFlatAtomicFaddF32Inst

Feature used by targets that have flat_atomic_add_f32 instruction
(gfx940 and gfx11). Remove isGFX940GFX11Plus.
Add hasFlatAtomicFaddF32Inst Subtarget check for codegen.

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

2 years ago[SLP] Fix cost model w.r.t. operand properties
Philip Reames [Fri, 23 Sep 2022 15:19:06 +0000 (08:19 -0700)]
[SLP] Fix cost model w.r.t. operand properties

We allow the target to report different costs depending on properties of the operands; given this, we have to make sure we pass the right set of operands and account for the fact that different scalar instructions can have operands with different properties.

As a motivating example, consider a set of multiplies which each multiply by a constant (but not all the same constant). Most of the constants are power of two (but not all).

If the target doesn't have support for non-uniform constant immediates, this will likely require constant materialization and a non-uniform multiply. However, depending on the balance of target costs for constant scalar multiplies vs a single vector multiply, this might or might not be a profitable vectorization.

This ends up basically being a rewrite of the existing code. Normally, I'd scope the change more narrowly, but I kept noticing things which seemed highly suspicious, and none of the existing code appears to have any test coverage at all. I think this is a case where simply throwing out the existing code and starting from scratch is reasonable.

This is a follow on to Alexey's D126885, but also handles the arithmetic instruction case since the existing code appears to have the same problem.

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

2 years ago[Docs] [HLSL] Add IR reference for HLSL
Chris Bieneman [Fri, 23 Sep 2022 14:59:21 +0000 (09:59 -0500)]
[Docs] [HLSL] Add IR reference for HLSL

HLSL uses a variety of named IR metadata and attributes to convey
additional information from the frontend to the backend. This document
tries to capture and document the named annotations to provide a
reference for future contributors.

Reviewed By: python3kgae

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

2 years ago[flang] Prevent a bad folding rewrite
Peter Klausler [Wed, 21 Sep 2022 19:00:24 +0000 (12:00 -0700)]
[flang] Prevent a bad folding rewrite

When a subexpression does not have both constant elements and
a constant shape, folding is rewriting it into a vector of its
elements.  This is of course wrong when the shape shows that
the result has rank greater than 1.

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

2 years agoAllow getting template args for ClassTemplateSpecializations
Anders Langlands [Fri, 23 Sep 2022 15:05:31 +0000 (11:05 -0400)]
Allow getting template args for ClassTemplateSpecializations

Modifies clang_Cursor_getNumTemplateArguments() and friends to work on
Struct, Class and ClassTemplatePartialSpecialization decls as well as
functions.

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

2 years ago[mlir] Add map_nested_foreach_thread_to_gpu_blocks op to transform dialect
Guray Ozen [Fri, 23 Sep 2022 12:42:51 +0000 (14:42 +0200)]
[mlir] Add map_nested_foreach_thread_to_gpu_blocks op to transform dialect

This revision adds a new op `map_nested_foreach_thread_to_gpu_blocks` to transform dialect.
If `generate_gpu_launch` argument is given, the op first generates `gpu_launch`. Otherwise, `target` must be `gpu_launch`. The op searches top level `scf.foreach_threads` inside the `gpu_launch` and distributes them with gpu.block_id attribute.
Loop mapping is explicit and given by the map_nested_foreach_thread_to_gpu_blocks op. Mapping is done one-to-one, therefore the loops disappear.
It also adds `gpu dialect` as dependent since the new op can create `gpu::LaunchOp` for given `scf::ForeachThreadOp`.

Reviewed By: nicolasvasilache

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

2 years ago[LoopDeletion] Invalidate SCEV after moving instruction.
Florian Hahn [Fri, 23 Sep 2022 14:13:30 +0000 (15:13 +0100)]
[LoopDeletion] Invalidate SCEV after moving instruction.

LoopDeletion may hoist instructions out of a loop using
makeLoopInvariant without invalidating the SCEV for the moved
instruction.

Moving the instruction to a different block may change its
cached block disposition, so invalidate the cached info.

Fixes #57837.

2 years ago[sanitizer_common] Restore sanitizer_procmaps_solaris.cpp compilation on Solaris...
Rainer Orth [Fri, 23 Sep 2022 13:50:00 +0000 (15:50 +0200)]
[sanitizer_common] Restore sanitizer_procmaps_solaris.cpp compilation on Solaris 11.3

When upstream `compiler-rt` was recently imported into GCC's
`libsanitizer`, Solaris 11.3 bootstrap broke because in 11.3
`<sys/procfs.h>` doesn't mix with largefile compilation.  I'd caused this
in D129837 <https://reviews.llvm.org/D129837> where I forgot that the code
still needs to support Solaris 11.3.

Fixed by restoring the `#undef _FILE_OFFSET_BITS`.

Tested on `sparc-sun-solaris2.11` and `amd64-pc-solaris2.11` (Solaris 11.4)
in LLVM and both Solaris 11.3 and 11.4 in GCC.

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

2 years agoFix gcc warning about ambiguous if-else chain
Simon Pilgrim [Fri, 23 Sep 2022 13:36:06 +0000 (14:36 +0100)]
Fix gcc warning about ambiguous if-else chain

Fixes warnings introduced by D111968

2 years ago[clang] Make --ld-path= work with -fuse-ld=lld
Nico Weber [Fri, 16 Sep 2022 14:46:11 +0000 (10:46 -0400)]
[clang] Make --ld-path= work with -fuse-ld=lld

This allows using --ld-path= to set a custom linker path, while
still informing clang that the binary at that path is an lld built
at the same revision as clang, so that clang can make assumptions
about the flags it supports, its output format, etc.

This currently only has an observable effect on Darwin.

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

2 years ago[TTI] Add OperandValueProperties::OP_NegatedPowerOf2 enum (PR51436)
Simon Pilgrim [Fri, 23 Sep 2022 13:02:26 +0000 (14:02 +0100)]
[TTI] Add OperandValueProperties::OP_NegatedPowerOf2 enum (PR51436)

The mul by constant costmodels handle power-of-2 constants, but not negated-power-of-2, despite the backends handling both.

This patch adds the OperandValueProperties::OP_NegatedPowerOf2 enum and wires it for use for basic mul cost analysis and SLP handling.

Fixes #50778

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

2 years ago[FunctionAttrs] Add tests for inaccessiblememonly (NFC)
Nikita Popov [Fri, 23 Sep 2022 12:45:08 +0000 (14:45 +0200)]
[FunctionAttrs] Add tests for inaccessiblememonly (NFC)

2 years ago[LLDB] Fix "memory region --all" when there is no ABI plugin
David Spickett [Fri, 16 Sep 2022 12:51:31 +0000 (12:51 +0000)]
[LLDB] Fix "memory region --all" when there is no ABI plugin

There are two conditions for the loop exit. Either we hit LLDB_INVALID_ADDRESS
or the ABI tells us we are beyond mappable memory.

I made a mistake in that second part that meant if you had no ABI plugin
--all would stop on the first loop and return nothing.

If there's no ABI plugin we should only check for LLDB_INVALID_ADDRESS.

Depends on D134029

Reviewed By: labath

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

2 years ago[LLDB] Properly return errors from "memory region --all"
David Spickett [Fri, 16 Sep 2022 12:48:58 +0000 (12:48 +0000)]
[LLDB] Properly return errors from "memory region --all"

When I wrote the initial version I forgot that a region being
unmapped is not an error. There are real errors that we don't
want to hide, such as the remote not supporting the
qMemoryRegionInfo packet (gdbserver does not).

Reviewed By: labath

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

2 years ago[NFC]: AArch64-SVE
Hassnaa Hamdi [Fri, 23 Sep 2022 11:51:19 +0000 (11:51 +0000)]
[NFC]: AArch64-SVE

modify some comments

2 years ago[FunctionAttrs] Use MemoryLocation::getOrNone() when infering memory attrs
Nikita Popov [Fri, 23 Sep 2022 11:55:07 +0000 (13:55 +0200)]
[FunctionAttrs] Use MemoryLocation::getOrNone() when infering memory attrs

MemoryLocation::getOrNone() already has the necessary logic to
handle different instruction types. Use it, rather than repeating
a subset of the logic. This adds support for previously unhandled
instructions like atomicrmw.

2 years ago[LoopVersioning] Invalidate SCEV for phi if new values are added.
Florian Hahn [Fri, 23 Sep 2022 10:53:29 +0000 (11:53 +0100)]
[LoopVersioning] Invalidate SCEV for phi if new values are added.

After 20d798bd47ec5191d, SCEV looks through PHIs with a single incoming
value. This means adding a new incoming value may change the SCEV for a
phi. Add missing invalidation when an existing PHI is reused during
LoopVersioning. New incoming values will be added later from the
versioned loop.

Similar issues have been fixed by also adding missing invalidation.

Fixes #57825.

Note that the test case unfortunately requires running loop-vectorize
followed by loop-load-elimination, which does the actual versioning. I
don't think it is possible to reproduce the failure without that
combination.

2 years ago[LV] Add test for #57912.
Florian Hahn [Fri, 23 Sep 2022 10:44:13 +0000 (11:44 +0100)]
[LV] Add test for #57912.

Add test showing miscompilation during epilogue vectorization with SVE.

2 years ago[lldb][TypeSystemClang] Deduce lldb::eEncodingUint for unsigned enum types
Michael Buch [Thu, 22 Sep 2022 14:17:31 +0000 (16:17 +0200)]
[lldb][TypeSystemClang] Deduce lldb::eEncodingUint for unsigned enum types

The motivating issue was the following:
```
$ cat main.cpp
enum class EnumVals : uint16_t {
    VAL1 = 0
};

struct Foo {
    EnumVals b1 : 4;
};

int main() {
    // Assign value out-of-range if
    // bit-field were signed
    Foo f{.b1 = (EnumVals)8};

    return 0; // Break here
}

(lldb) script
>>> lldb.frame.FindVariable("f").GetChildMemberWithName("b1").GetValueAsUnsigned()
4294967288
```

In the above example we observe a unsigned integer wrap-around
because we sign-extended the bit-fields underlying Scalar value
before casting it to an unsigned. The sign extension occurs because
we don't mark APSInt::IsUnsigned == true correctly when extracting
the value from memory (in Value::ResolveValue). The reason why sign
extension causes the wraparound is that the value we're assigning
to the bit-field is out-of-range (if it were a signed bit-field),
which causes `Scalar::sext` to left-fill the Scalar with 1s.

This patch corrects GetEncoding to account for unsigned enum types.
With this change the Scalar would be zero-extended instead.

This is mainly a convenience fix which well-formed code wouldn't
encounter.

rdar://99785324

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

2 years ago[BasicAA] Clean up calculation of FMRB from attributes
Nikita Popov [Thu, 22 Sep 2022 15:16:48 +0000 (17:16 +0200)]
[BasicAA] Clean up calculation of FMRB from attributes

The current implementation for call sites is pretty convoluted
when you take the underlying implementation of the used APIs
into account. We will query the call site attributes, and then
fall back to the function attributes while taking into account
operand bundles. However, getModRefBehavior() already has it's
own (more accurate) logic for combining call-site FMRB with
function FMRB.

Clean this up by extracting a function that only fetches FMRB
from attributes, which can be directly used in getModRefBehavior()
for functions, and needs to be combined with an operand-bundle
respecting fallback in the call site case.

One caveat (that makes this non-NFC) is that CallBase function
attribute lookups allow using attributes from functions with
mismatching signature. To ensure we don't regress quality, do
the same for the function FMRB fallback.

2 years agoRemove an unused var decl, NFC.
Haojian Wu [Fri, 23 Sep 2022 09:54:19 +0000 (11:54 +0200)]
Remove an unused var decl, NFC.

2 years ago[AArch64]Remove svget/svset/svcreate from llvm
Caroline Concatto [Wed, 10 Aug 2022 07:20:11 +0000 (08:20 +0100)]
[AArch64]Remove svget/svset/svcreate from llvm

This patch removes the aarch64 instrinsic svget/svset/svcreate from llvm.
It also implements the InstCombine for vector.extract that used to be in svget.

Depends on: D131547

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

2 years ago[flang][NFC] Fix typo
Valentin Clement [Fri, 23 Sep 2022 09:47:38 +0000 (11:47 +0200)]
[flang][NFC] Fix typo

2 years ago[LV] Convert sve-epilog-vect.ll to use opaque pointers.
Florian Hahn [Fri, 23 Sep 2022 09:24:18 +0000 (10:24 +0100)]
[LV] Convert sve-epilog-vect.ll to use opaque pointers.

2 years ago[AggressiveInstCombine] Combine consecutive loads which are being merged to form...
bipmis [Fri, 23 Sep 2022 09:19:34 +0000 (10:19 +0100)]
[AggressiveInstCombine] Combine consecutive loads which are being merged to form a wider load.

The patch simplifies some of the patterns as below

1. (ZExt(L1) << shift1) | (ZExt(L2) << shift2) -> ZExt(L3) << shift1
2. (ZExt(L1) << shift1) | ZExt(L2) -> ZExt(L3)

The pattern is indicative of the fact that the loads are being merged to a wider load and the only use of this pattern is with a wider load. In this case for a non-atomic/non-volatile loads reduce the pattern to a combined load which would improve the cost of inlining, unrolling, vectorization etc.

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

2 years ago[Attribute] Clean up test prefixes (NFC)
Nikita Popov [Fri, 23 Sep 2022 09:03:57 +0000 (11:03 +0200)]
[Attribute] Clean up test prefixes (NFC)

Now that the legacy PM is no longer tested, the huge matrix of
test prefixes used by attributor tests is no longer needed and very
confusing for the casual reader. Reduce the prefixes down to just
CHECK, TUNIT and CGSCC.

2 years ago[NFC] update_llc_test_checks llvm/test/CodeGen/ARM/memcpy-inline.ll
Guillaume Chatelet [Fri, 23 Sep 2022 09:00:21 +0000 (09:00 +0000)]
[NFC] update_llc_test_checks llvm/test/CodeGen/ARM/memcpy-inline.ll

2 years ago[clang] Fix the bogus diagnostic introduced by the newly-added UsingTemplate Kind.
Haojian Wu [Thu, 22 Sep 2022 13:06:12 +0000 (15:06 +0200)]
[clang] Fix the bogus diagnostic introduced by the newly-added UsingTemplate Kind.

Reviewed By: sammccall

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

2 years ago[MemorySSA] Convert tests to use opaque pointers (NFC)
Nikita Popov [Fri, 23 Sep 2022 08:30:52 +0000 (10:30 +0200)]
[MemorySSA] Convert tests to use opaque pointers (NFC)

2 years ago[IR] Handle assume intrinsics in hasClobberingOperandBundle()
Nikita Popov [Fri, 23 Sep 2022 08:25:27 +0000 (10:25 +0200)]
[IR] Handle assume intrinsics in hasClobberingOperandBundle()

Operand bundles on assumes do not read or write -- we correctly
modelled the read side of this, but not the write side. In practice
this did not matter because of how the method is used, but this
will become relevant for a future patch.

2 years ago[Arm][AArch64] Make getArchFeatures to use TargetParser.def
Daniel Kiss [Fri, 23 Sep 2022 08:25:01 +0000 (10:25 +0200)]
[Arm][AArch64] Make getArchFeatures to use TargetParser.def

Prefixing the the SubArch with plus sign makes the ArchFeature name.

Reviewed By: DavidSpickett

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

2 years ago[flang] Add TODOs for some FORALL assignments with Pointers and Allocatables
Jean Perier [Fri, 23 Sep 2022 08:09:49 +0000 (10:09 +0200)]
[flang] Add TODOs for some FORALL assignments with Pointers and Allocatables

Add TODO for whole array allocatable assignment inside FORALL
Whole allocatable array assignment inside FORALL are otherwise currently
hitting more cryptic asserts.

Add TODO in FORALL assignment when a designator appear with a part ref
that is an allocatable or pointer component (a(i)%pointer%k). The lowering
code does not handle this case well because of the pointer dereference.

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

2 years ago[CMake] Add clang-bolt target
Amir Ayupov [Fri, 23 Sep 2022 08:08:58 +0000 (10:08 +0200)]
[CMake] Add clang-bolt target

This patch adds `CLANG_BOLT_INSTRUMENT` option that applies BOLT instrumentation
to Clang, performs a bootstrap build with the resulting Clang, merges resulting
fdata files into a single profile file, and uses it to perform BOLT optimization
on the original Clang binary.

The projects and targets used for bootstrap/profile collection are configurable via
`CLANG_BOLT_INSTRUMENT_PROJECTS` and `CLANG_BOLT_INSTRUMENT_TARGETS`.
The defaults are "llvm" and "count" respectively, which results in a profile with
~5.3B dynamically executed instructions.

The intended use of the functionality is through BOLT CMake cache file, similar
to PGO 2-stage build:
```
cmake <llvm-project>/llvm -C <llvm-project>/clang/cmake/caches/BOLT.cmake
ninja clang++-bolt # pulls clang-bolt
```

Stats with a recent checkout (clang-16), pre-built BOLT and Clang, 72vCPU/224G
| CMake configure with host Clang + BOLT.cmake | 1m6.592s
| Instrumenting Clang with BOLT | 2m50.508s
| CMake configure `llvm` with instrumented Clang | 5m46.364s (~5x slowdown)
| CMake build `not` with instrumented Clang |0m6.456s
| Merging fdata files | 0m9.439s
| Optimizing Clang with BOLT | 0m39.201s

Building Clang:
```cmake ../llvm-project/llvm -DCMAKE_C_COMPILER=... -DCMAKE_CXX_COMPILER=...
  -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS=clang
  -DLLVM_TARGETS_TO_BUILD=Native -GNinja```

| | Release | BOLT-optimized
| cmake | 0m24.016s | 0m22.333s
| ninja clang | 5m55.692s | 4m35.122s

I know it's not rigorous, but shows a ballpark figure.

Reviewed By: phosek

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

2 years ago[C++] [Modules] Add a test case for mocking implementation for std modules
Chuanqi Xu [Fri, 23 Sep 2022 07:17:35 +0000 (15:17 +0800)]
[C++] [Modules] Add a test case for mocking implementation for std modules

I found this with the patch: https://reviews.llvm.org/D131858. It breaks
my local implementation but not the in-tree test cases. So I reduce the
failure and submit the test case. The more testing should be always
good.

2 years ago[llvm-dwarfutil][DWARFv5] fix reading of DW_FORM_addrx attribute.
Alexey Lapshin [Mon, 5 Sep 2022 14:33:22 +0000 (17:33 +0300)]
[llvm-dwarfutil][DWARFv5] fix reading of DW_FORM_addrx attribute.

llvm::dwarfutil::ObjFileAddressMap::relocateIndexedAddr() does not
read address value. The relocateIndexedAddr() should not relocate
the address as the linked binary has already resolved relocations.
But it should read the value. This patch adds the reading value
of the address.

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

2 years ago[flang] Load allocatable or pointer box of namelist item from common block
Valentin Clement [Fri, 23 Sep 2022 05:06:33 +0000 (07:06 +0200)]
[flang] Load allocatable or pointer box of namelist item from common block

If a namelist item is an allocatable or pointer and is also part of a common
block, the box should be loaded from the common block ref.

Reviewed By: PeteSteinfeld

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

2 years agoIntroduce predicate for a atomic operations in GMIR
Yashwant Singh [Fri, 23 Sep 2022 05:41:39 +0000 (11:11 +0530)]
Introduce predicate for a atomic operations in GMIR

Reviewed By: arsenm, sameerds

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

2 years ago[BOLT] Support building bolt when LLVM_LINK_LLVM_DYLIB is ON
serge-sans-paille [Thu, 22 Sep 2022 13:01:04 +0000 (15:01 +0200)]
[BOLT] Support building bolt when LLVM_LINK_LLVM_DYLIB is ON

This does *not* link with libLLVM, but with static archives instead. Not
super-great, but at least the build works, which is probably better than
failing.

Related to #57551

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