SuccessChanges

Summary

  1. [clang-offload-bundler] Add sections and set section flags using one llvm-objcopy invocation (details)
  2. [GlobalISel] Simplify G_ICMP to true/false when the result is known (details)
  3. Speculatively fix failing tests from 6381664580080f015bc0c2ec647853f697cf744a (details)
  4. [MLIR][Affine] Privatize certain escaping memrefs (details)
  5. [X86] AMD Zen 3: fix MULX modelling - don't forget about WriteIMulH (PR50387) (details)
  6. [AArch64][GlobalISel] Prefer mov for s32->s64 G_ZEXT (details)
  7. [gn build] Add target for PassesBindingsTest (details)
  8. [test] Speculative fix for bots (details)
  9. [X86] Use Skylake Server model for x86-64-v4 so we have full instruction coverage (details)
  10. Revert "[test] Speculative fix for bots" (details)
  11. [IR] Add a Location to BlockArgument. (details)
  12. [InstCombine] add tests for funnel shift miscompile; NFC (details)
  13. [gn build] Rename PassesBindingsTests and add it to unittests (details)
  14. [test] Speculative fix for bots (round 2) (details)
  15. [InstCombine] restrict funnel shift match to avoid miscompile (details)
  16. [NFC] Format PassesBindingsTests CMake like other unittests (details)
  17. [IntegerAttr] Add helpers for working with LLVM's APSInt type. (details)
  18. [lld/mac] Correctly set nextdefsym (details)
  19. [Driver] Delete -mimplicit-it= (details)
  20. [flang] Implement MATMUL in the runtime (details)
  21. [LICM] Remove MaybePromotable set (PR50367) (details)
  22. [flang] Accept OPEN(ACCESS='APPEND') legacy extension even without warnings enabled (details)
  23. [RuntimeDyld] Add allowStubs/allowZeroSyms (details)
  24. [X86][AVX] Add variable-permute test case from PR50356 (details)
  25. AMDGPU/NFC: Replace EF_AMDGPU_MACH_AMDGCN_RESERVED_0X3E with EF_AMDGPU_MACH_AMDGCN_GFX1034 (details)
  26. [clang-repl] Better match the underlying architecture. (details)
Commit 8998a8aa97f81c758403615ec897ce79c1ccdcad by serguei.n.dmitriev
[clang-offload-bundler] Add sections and set section flags using one llvm-objcopy invocation

llvm-objcopy has been changed to support adding a section and updating section flags
in one run (D90438), so we can now change clang-offload-bundler to run llvm-objcopy
tool only once when creating fat object.

Reviewed By: ABataev

Differential Revision: https://reviews.llvm.org/D102670
The file was modifiedclang/test/Driver/clang-offload-bundler.c
The file was modifiedclang/tools/clang-offload-bundler/ClangOffloadBundler.cpp
Commit 892497c806306a4b7185ead16d60b0ebcca0a304 by Jessica Paquette
[GlobalISel] Simplify G_ICMP to true/false when the result is known

Use existing KnownBits helpers from KnownBits.h to simplify G_ICMPs.

E.g.

x == x -> true
x != x -> false
load(x) > 1 -> true (when the load is known to be greater than 1)

And so on.

Differential Revision: https://reviews.llvm.org/D102542
The file was modifiedllvm/test/CodeGen/AArch64/fold-global-offsets.ll
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/ssubsat.ll
The file was modifiedllvm/include/llvm/Target/GlobalISel/Combine.td
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/sdiv.i64.ll
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/saddsat.ll
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/srem.i64.ll
The file was modifiedllvm/lib/Target/AArch64/AArch64Combine.td
The file was modifiedllvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/cvt_f32_ubyte.ll
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/fshr.ll
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/udiv.i64.ll
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/urem.i64.ll
The file was addedllvm/test/CodeGen/AArch64/GlobalISel/prelegalizer-combiner-icmp-to-true-false-known-bits.mir
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/fshl.ll
The file was modifiedllvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h
Commit ccbac06a072b86ea3b46479e478a1abee8520ef8 by aaron
Speculatively fix failing tests from 6381664580080f015bc0c2ec647853f697cf744a

This was causing some Mac-specific build failures:
http://45.33.8.238/macm1/9739/step_7.txt
http://45.33.8.238/mac/31615/step_7.txt

As best I can tell with psychic debugging, the /Users/blah path to the
source file is being treated as a macro undef with the clang-cl driver.
This splits the filename off explicitly so hopefully the rest of the
command line arguments will be read properly.
The file was modifiedclang/test/Driver/sycl.c
Commit a3917d36709755df52386bcf01324a98a068f29d by uday
[MLIR][Affine] Privatize certain escaping memrefs

During affine loop fusion, create private memrefs for escaping memrefs
too under the conditions that:
-- the source is not removed after fusion, and
-- the destination does not write to the memref.

This creates more fusion opportunities as illustrated in the test case.

Reviewed By: bondhugula, ayzhuang

Differential Revision: https://reviews.llvm.org/D102604
The file was modifiedmlir/test/Transforms/loop-fusion.mlir
The file was modifiedmlir/lib/Transforms/LoopFusion.cpp
Commit 75ea0abaae4547574aa887650b09b98832384fc5 by lebedev.ri
[X86] AMD Zen 3: fix MULX modelling - don't forget about WriteIMulH (PR50387)

Otherwise lack thereof will be caught by a defensive check during
scheduling, and we'll crash.

I've literally never seen this syntax before..
The file was modifiedllvm/lib/Target/X86/X86ScheduleZnver3.td
Commit 58c57e1b5f5fbc489b95f3b3a387451632c60eea by Jessica Paquette
[AArch64][GlobalISel] Prefer mov for s32->s64 G_ZEXT

We can use an ORRWrs (mov) + SUBREG_TO_REG rather than a UBFX for G_ZEXT on
s32->s64.

This closer matches what SDAG does, and is likely more power efficient etc.

(Also fixed up arm64-rev.ll which had a fallback check line which was entirely
useless.)

Simple example: https://godbolt.org/z/h1jKKdx5c

Differential Revision: https://reviews.llvm.org/D102656
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/opt-fold-ext-tbz-tbnz.mir
The file was modifiedllvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/select-redundant-zext.mir
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/select-cmp.mir
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/select-int-ext.mir
The file was modifiedllvm/test/CodeGen/AArch64/arm64-rev.ll
Commit 85f8698eb96f5e74844c839b9da579239bc0854d by aeubanks
[gn build] Add target for PassesBindingsTest
The file was modifiedllvm/utils/gn/secondary/llvm/unittests/Passes/BUILD.gn
Commit 5c291482ec8bcd686044ebc0d4cffe7bf769521c by aeubanks
[test] Speculative fix for bots

Bot has error "Failed to create target from default triple: Unable to
find target for this triple (no targets are registered)", likely because
we only initialized the native target, not the registered target if it's
different.

https://lab.llvm.org/buildbot/#/builders/86/builds/13664
The file was modifiedllvm/unittests/Passes/PassBuilderBindingsTest.cpp
Commit 99c0f16ea406a99d2cfc063ffdd1d5d7a3825277 by llvm-dev
[X86] Use Skylake Server model for x86-64-v4 so we have full instruction coverage

The x86-64-v4 generic cpu arch supports AVX512BW/DQ/CD/VLX which isn't covered by the Haswell model, use the SkylakeServer model instead which is a lot closer to what the arch represents.

Differential Revision: https://reviews.llvm.org/D102553
The file was modifiedllvm/lib/Target/X86/X86.td
Commit c3530e75cee121b665f3d960934dda00a23522ec by aeubanks
Revert "[test] Speculative fix for bots"

This reverts commit 5c291482ec8bcd686044ebc0d4cffe7bf769521c.

unittests/Passes/CMakeFiles/PassesBindingsTests.dir/PassBuilderBindingsTest.cpp.o: In function `PassBuilderCTest::SetUp()':
PassBuilderBindingsTest.cpp:(.text._ZN16PassBuilderCTest5SetUpEv[_ZN16PassBuilderCTest5SetUpEv]+0x28): undefined reference to `LLVMInitializeARMTargetInfo'
The file was modifiedllvm/unittests/Passes/PassBuilderBindingsTest.cpp
Commit 3043be9d2db4d0cdf079adb5e1bdff032405e941 by clattner
[IR] Add a Location to BlockArgument.

This adds the ability to specify a location when creating BlockArguments.
Notably Value::getLoc() will return this correctly, which makes diagnostics
more precise (e.g. the example in test-legalize-type-conversion.mlir).

This is currently optional to avoid breaking any existing code - if
absent, the BlockArgument defaults to using the location of its enclosing
operation (preserving existing behavior).

The bulk of this change is plumbing location tracking through the parser
and printer to make sure it can round trip (in -mlir-print-debuginfo
mode).  This is complete for generic operations, but requires manual
adoption for custom ops.

I added support for function-like ops to round trip their argument
locations - they print correctly, but when parsing the locations are
dropped on the floor.  I intend to fix this, but it will require more
invasive plumbing through "function_like_impl" stuff so I think it
best to split it out to its own patch.

Differential Revision: https://reviews.llvm.org/D102567
The file was modifiedmlir/lib/IR/FunctionImplementation.cpp
The file was modifiedmlir/lib/IR/Value.cpp
The file was modifiedmlir/test/Transforms/test-legalize-type-conversion.mlir
The file was modifiedmlir/test/mlir-tblgen/pattern.mlir
The file was modifiedmlir/include/mlir/IR/Value.h
The file was modifiedmlir/lib/IR/AsmPrinter.cpp
The file was modifiedmlir/test/IR/locations.mlir
The file was modifiedmlir/include/mlir/IR/Block.h
The file was modifiedmlir/include/mlir/IR/OpImplementation.h
The file was modifiedmlir/include/mlir/IR/Builders.h
The file was modifiedmlir/lib/IR/Builders.cpp
The file was modifiedmlir/lib/Parser/Parser.cpp
The file was modifiedmlir/lib/IR/Block.cpp
Commit e81f09f8f880dc54ab6a460aa7591e9615bac222 by spatel
[InstCombine] add tests for funnel shift miscompile; NFC
The file was modifiedllvm/test/Transforms/InstCombine/rotate.ll
The file was modifiedllvm/test/Transforms/InstCombine/funnel.ll
Commit 16cbc80e72d9d60df6c18d4c524bfce343e2a755 by aeubanks
[gn build] Rename PassesBindingsTests and add it to unittests
The file was modifiedllvm/utils/gn/secondary/llvm/unittests/BUILD.gn
The file was modifiedllvm/utils/gn/secondary/llvm/unittests/Passes/BUILD.gn
Commit 0b031eeefa8f510f78a4b63d52ce12bab28bf54c by aeubanks
[test] Speculative fix for bots (round 2)

Bot has error "Failed to create target from default triple: Unable to
find target for this triple (no targets are registered)", likely because
we only initialized the native target, not the registered target if it's
different.

https://lab.llvm.org/buildbot/#/builders/86/builds/13664
The file was modifiedllvm/unittests/Passes/CMakeLists.txt
The file was modifiedllvm/unittests/Passes/PassBuilderBindingsTest.cpp
Commit 6d949a9c8fa440b0b91c9a96a30a9b7c1b7cf1e1 by spatel
[InstCombine] restrict funnel shift match to avoid miscompile

As noted in the post-commit discussion for:
https://reviews.llvm.org/rGabd7529625a73f405e40a63dcc446c41d51a219e

...that change exposed a logic hole that allows a miscompile
if the shift amount could exceed the narrow width:
https://alive2.llvm.org/ce/z/-i_CiM
https://alive2.llvm.org/ce/z/NaYz28

The restriction isn't necessary for a rotate (same operand for
both shifts), so we should adjust the matching for the shift
value as a follow-up enhancement:
https://alive2.llvm.org/ce/z/ahuuQb
The file was modifiedllvm/test/Transforms/InstCombine/funnel.ll
The file was modifiedllvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
The file was modifiedllvm/test/Transforms/InstCombine/rotate.ll
Commit 5781f9a7434267bf15a94f4210d3abca3bf773e2 by aeubanks
[NFC] Format PassesBindingsTests CMake like other unittests
The file was modifiedllvm/unittests/Passes/CMakeLists.txt
Commit 855b42ddd0117055477546e9cc16667a62ffdedf by clattner
[IntegerAttr] Add helpers for working with LLVM's APSInt type.

The FIRRTL dialect in CIRCT uses inherently signful types, and APSInt
is the best way to model that.  Add a couple of helpers that make it
easier to work with an IntegerAttr that carries a sign.

This follows the example of getZExt() and getSExt() which assert when
the underlying type of the attribute is unexpected.  In this case
we assert fail when the underlying type of the attribute is signless.

This is strictly additive, so it is NFC.  It is tested in the CIRCT
repo.

Differential Revision: https://reviews.llvm.org/D102701
The file was modifiedmlir/include/mlir/Support/LLVM.h
The file was modifiedmlir/lib/IR/BuiltinAttributes.cpp
The file was modifiedmlir/include/mlir/IR/BuiltinAttributes.td
Commit b4ead2c37bcbb1f81919c68e2a2a227aac90f07c by thakis
[lld/mac] Correctly set nextdefsym

In LC_DYSYMTAB, private externs were still emitted as exported symbols instead
of as locals.

Fixes PR50373. See bug for details.

Differential Revision: https://reviews.llvm.org/D102662
The file was modifiedlld/MachO/SyntheticSections.cpp
The file was modifiedlld/test/MachO/symtab.s
Commit 2919222d8017f2425a85765b95e4b7c6f8e70ca4 by i
[Driver] Delete -mimplicit-it=

This is a GNU as and Clang cc1as option, not a GCC option.
Users should specify `-Wa,-mimplicit-it=` instead.

Note: mixing the -m option and the -Wa, option doesn't work
`-Wa,-mimplicit-it=never -mimplicit-it=always` =>
`clang (LLVM option parsing): for the --arm-implicit-it option: may only occur zero or one times!`

Reviewed By: nickdesaulniers, raj.khem

Differential Revision: https://reviews.llvm.org/D102568
The file was modifiedclang/test/Driver/as-options.s
The file was removedclang/test/Driver/arm-implicit-it.s
The file was modifiedclang/include/clang/Driver/Options.td
The file was modifiedclang/lib/Driver/ToolChains/Clang.cpp
The file was modifiedclang/test/Driver/arm-target-as-mimplicit-it.s
Commit 5e1421b22f642a6b34690d0d724e691ba3984836 by pklausler
[flang] Implement MATMUL in the runtime

Define an API for the transformational intrinsic function MATMUL,
implement it, and add some basic unit tests.  The large number of
possible argument type combinations are covered by a set of
generalized templates that are instantiated for each valid
pair of possible argument types.

Places where BLAS-2/3 routines could be called for acceleration
are marked with TODOs.  Handling for other special cases (e.g.,
known-shape 3x3 matrices and vectors) are deferred.

Some minor tweaks were made to the recent related implementation
of DOT_PRODUCT to reflect lessons learned.

Differential Revision: https://reviews.llvm.org/D102652
The file was modifiedflang/runtime/CMakeLists.txt
The file was addedflang/unittests/RuntimeGTest/Matmul.cpp
The file was modifiedflang/runtime/reduction.h
The file was modifiedflang/unittests/RuntimeGTest/CMakeLists.txt
The file was addedflang/runtime/matmul.cpp
The file was modifiedflang/runtime/dot-product.cpp
The file was addedflang/runtime/matmul.h
Commit e81334a75401f3af3b10f64e307d705d97637a03 by nikita.ppv
[LICM] Remove MaybePromotable set (PR50367)

The MaybePromotable set keeps track of loads/stores for which
promotion was not attempted yet. Normally, any load/stores that
are promoted in the current iteration will be removed from this
set, because they naturally MustAlias with the promoted value.
However, if the source program has UB with metadata claiming that
a store is NoAlias, while it is actually MustAlias, and multiple
different pointers are promoted in the same iteration, it can
happen that a store is removed that is still in the MaybePromotable
set, causing a use-after-free.

While this could be fixed by explicitly invalidating values in
MaybePromotable in the LoopPromoter, I'm going with the more
radical option of dropping the set entirely here and check all
load/stores on each promotion iteration. As promotion, and especially
repeated promotion, are quite rare, this doesn't seem to have any
impact on compile-time.

Fixes https://bugs.llvm.org/show_bug.cgi?id=50367.
The file was modifiedllvm/lib/Transforms/Scalar/LICM.cpp
The file was addedllvm/test/Transforms/LICM/pr50367.ll
Commit 8cd199b85f907a7349bc5cb1b3d3562e0e79b72c by pklausler
[flang] Accept OPEN(ACCESS='APPEND') legacy extension even without warnings enabled

My earlier patch to accept ACCESS='APPEND' only worked when warnings
were enabled; fix it.

Differential Revision: https://reviews.llvm.org/D102653
The file was modifiedflang/lib/Semantics/check-io.cpp
Commit a33687ec584d18dc0d092853d583d7116808459c by rafaelauler
[RuntimeDyld] Add allowStubs/allowZeroSyms

This patch introduces functionality used by BOLT when
re-linking the final binary. It adds to MemoryManager a new member
function allowStubAllocation to control whether this MemoryManager
supports increasing code size with stubs or not. Since BOLT can
rewrite some files in-place, it needs to avoid stub insertion done
by the linker. This patch also introduces allowsZeroSymbols to the
JITSymbolResolver class, enabling us to finish a link successfully
even when some symbols resolve to the value zero. When rewriting a
binary, sometimes we do need to resolve a target to zero in case
the input binary calls address zero and we want to be bug
compatible. We also expose reassignSectionAddress as it is used by
BOLT.

Reviewed By: lhames

Differential Revision: https://reviews.llvm.org/D97898
The file was modifiedllvm/include/llvm/ExecutionEngine/RuntimeDyld.h
The file was modifiedllvm/include/llvm/ExecutionEngine/JITSymbol.h
The file was modifiedllvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
The file was modifiedllvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
Commit c7f46423900f358c07c9e6fe945a1ad2e0412299 by llvm-dev
[X86][AVX] Add variable-permute test case from PR50356
The file was modifiedllvm/test/CodeGen/X86/var-permute-256.ll
Commit 0f544be244e31d3988b2024dfbfe4b91f8e909e1 by kzhuravl_dev
AMDGPU/NFC: Replace EF_AMDGPU_MACH_AMDGCN_RESERVED_0X3E with EF_AMDGPU_MACH_AMDGCN_GFX1034

Differential Revision: https://reviews.llvm.org/D102708
The file was modifiedllvm/include/llvm/BinaryFormat/ELF.h
Commit 8dd5ef01ef13e402784bba47f7a24175f5f00325 by v.g.vassilev
[clang-repl] Better match the underlying architecture.

In cases where -fno-integrated-as is specified we should overwrite the
EmitAssembly action as well.

We also should rely on the target triple from the process at least until we
implement out-of-process execution.

This patch should improve clang-repl on AIX.

Discussion available at: https://reviews.llvm.org/D96033

Differential revision: https://reviews.llvm.org/D102688
The file was modifiedclang/lib/Interpreter/IncrementalParser.cpp
The file was modifiedclang/lib/Interpreter/Interpreter.cpp