SuccessChanges

Summary

  1. IR: Rename Metadata::ImplicitCode to SubclassData1, NFC (details)
  2. Transforms: Clone distinct nodes in metadata mapper unless RF_ReuseAndMutateDistinctMDs (details)
  3. [Profile] Include a few asserts in coverage mapping test (details)
  4. [InstCombine] add helper for x/pow(); NFC (details)
  5. [InstCombine] fold fdiv with powi divisor (PR49147) (details)
  6. Revert "[Profile] Include a few asserts in coverage mapping test" (details)
  7. [MC][ARM] make Thumb function also if type attribute is set (details)
  8. [builtins] Define fmax and scalbn inline (details)
  9. Reland "[Driver][Windows] Support per-target runtimes dir layout for profile instr generate" (details)
  10. Revert "[builtins] Define fmax and scalbn inline" (details)
  11. [profile] Fix buffer overrun when parsing %c in filename string (details)
  12. Allow !shape.size type operands in "shape.from_extents" op. (details)
Commit 1e1b92f76de79b934ead3be075aff101bd880392 by Duncan P. N. Exon Smith
IR: Rename Metadata::ImplicitCode to SubclassData1, NFC

Metadata::ImplicitCode is a bit shaved off of Metadata::Storage,
currently only in use by the subclass DILocation. However, the bit isn't
reserved for that purpose. Rename it `SubclassData1` to make it clear
that it has nothing to do with Metadata itself (and other subclasses are
free to use it).

As a drive-by, remove an old TODO about exposing bits to subclasses
(looks like that has mostly been done).

No functionality change here.

Differential Revision: https://reviews.llvm.org/D96740
The file was modifiedllvm/include/llvm/IR/DebugInfoMetadata.h
The file was modifiedllvm/include/llvm/IR/Metadata.h
Commit 01701646d5555409a6fad920f0e4801d79c154ea by Duncan P. N. Exon Smith
Transforms: Clone distinct nodes in metadata mapper unless RF_ReuseAndMutateDistinctMDs

This is a follow up to 22a52dfddcefad4f275eb8ad1cc0e200074c2d8a and a
revert of df763188c9a1ecb1e7e5c4d4ea53a99fbb755903.

With this change, we only skip cloning distinct nodes in
MDNodeMapper::mapDistinct if RF_ReuseAndMutateDistinctMDs, dropping the
no-longer-needed local helper `cloneOrBuildODR()`.  Skipping cloning in
other cases is unsound and breaks CloneModule, which is why the textual
IR for PR48841 didn't pass previously. This commit adds the test as:
Transforms/ThinLTOBitcodeWriter/cfi-debug-info-cloned-type-references-global-value.ll

Cloning less often exposed a hole in subprogram cloning in
CloneFunctionInto thanks to df763188c9a1ecb1e7e5c4d4ea53a99fbb755903's
test ThinLTO/X86/Inputs/dicompositetype-unique-alias.ll. If a function
has a subprogram attachment whose scope is a DICompositeType that
shouldn't be cloned, but it has no internal debug info pointing at that
type, that composite type was being cloned. This commit plugs that hole,
calling DebugInfoFinder::processSubprogram from CloneFunctionInto.

As hinted at in 22a52dfddcefad4f275eb8ad1cc0e200074c2d8a's commit
message, I think we need to formalize ownership of metadata a bit more
so that ValueMapper/CloneFunctionInto (and similar functions) can deal
with cloning (or not) metadata in a more generic, less fragile way.

This fixes PR48841.

Differential Revision: https://reviews.llvm.org/D96734
The file was modifiedllvm/lib/Transforms/Utils/CloneFunction.cpp
The file was modifiedllvm/include/llvm/IR/DebugInfo.h
The file was addedllvm/test/Transforms/ThinLTOBitcodeWriter/cfi-debug-info-cloned-type-references-global-value.ll
The file was modifiedllvm/lib/Transforms/Utils/ValueMapper.cpp
Commit 80f329bcd0281c11062879025761d0657167fe8b by phosek
[Profile] Include a few asserts in coverage mapping test

These should catch any accidental use of the compilation directory.

Differential Revision: https://reviews.llvm.org/D97402
The file was modifiedllvm/unittests/ProfileData/CoverageMappingTest.cpp
Commit 868d43fbd6571d11f91564969676bb0f1b19b455 by spatel
[InstCombine] add helper for x/pow(); NFC

We at least want to add powi to this list, so
split it off into a switch to reduce code duplication.
The file was modifiedllvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
Commit a7cee55762c6564de9dfc90985fe5c14cad7f9ee by spatel
[InstCombine] fold fdiv with powi divisor (PR49147)

This extends b40fde062c for the especially non-standard
powi pattern. We want to avoid being completely wrong
on the negation-of-int-min corner case, so I'm adding
an extra FMF check for 'ninf' assuming that gives us
the flexibility to handle that possibility.
https://llvm.org/PR49147
The file was modifiedllvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
The file was modifiedllvm/test/Transforms/InstCombine/fdiv.ll
Commit ae7528a34e2771ba4f0741e4941f78810854103d by phosek
Revert "[Profile] Include a few asserts in coverage mapping test"

This reverts commit 80f329bcd0281c11062879025761d0657167fe8b.
The file was modifiedllvm/unittests/ProfileData/CoverageMappingTest.cpp
Commit a921aaf789912d981cbb2036bdc91ad7289e1523 by ndesaulniers
[MC][ARM] make Thumb function also if type attribute is set

Make sure to set the bottom bit of the symbol even when the type
attribute of a label is set after the label.

GNU as sets the thumb state according to the thumb state of the label.
If a .type directive is placed after the label, set the symbol's thumb
state according to the thumb state of the .type directive. This matches
GNU as in most cases.

From: Stefan Agner <stefan@agner.ch>

This fixes:
https://bugs.llvm.org/show_bug.cgi?id=44860
https://github.com/ClangBuiltLinux/linux/issues/866

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D74927
The file was addedllvm/test/MC/ARM/thumb-function-address.s
The file was modifiedllvm/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp
Commit 341889ee9e03e73b313263c516b3d1fd33d4c4ba by rprichard
[builtins] Define fmax and scalbn inline

Define inline versions of __compiler_rt_fmax* and __compiler_rt_scalbn*
rather than depend on the versions in libm. As with
__compiler_rt_logbn*, these functions are only defined for single,
double, and quad precision (binary128).

Fixes PR32279 for targets using only these FP formats (e.g. Android
on arm/arm64/x86/x86_64).

For single and double precision, on AArch64, use __builtin_fmax[f]
instead of the new inline function, because the builtin expands to the
AArch64 fmaxnm instruction.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D91841
The file was modifiedcompiler-rt/lib/builtins/fp_lib.h
The file was modifiedcompiler-rt/lib/builtins/divdc3.c
The file was addedcompiler-rt/test/builtins/Unit/compiler_rt_fmaxf_test.c
The file was modifiedcompiler-rt/lib/builtins/int_lib.h
The file was addedcompiler-rt/test/builtins/Unit/compiler_rt_scalbnl_test.c
The file was modifiedcompiler-rt/lib/builtins/divsc3.c
The file was modifiedcompiler-rt/lib/builtins/ppc/divtc3.c
The file was addedcompiler-rt/test/builtins/Unit/compiler_rt_scalbnf_test.c
The file was addedcompiler-rt/test/builtins/Unit/compiler_rt_scalbn_test.c
The file was modifiedcompiler-rt/lib/builtins/divtc3.c
The file was addedcompiler-rt/test/builtins/Unit/compiler_rt_fmax_test.c
The file was modifiedcompiler-rt/lib/builtins/int_math.h
The file was addedcompiler-rt/test/builtins/Unit/compiler_rt_fmaxl_test.c
Commit 9f1b832331e350426f7f2f8cc30ab8ba991f5884 by markus.boeck02
Reland "[Driver][Windows] Support per-target runtimes dir layout for profile instr generate"

This relands commit rG7f9d5d6e444c which was reverted in rGab5b00ada9e7

Differential Revision: https://reviews.llvm.org/D96638
The file was modifiedclang/test/Driver/sanitizer-ld.c
The file was modifiedclang/lib/Driver/ToolChain.cpp
The file was modifiedclang/include/clang/Driver/ToolChain.h
The file was modifiedclang/lib/Driver/ToolChains/BareMetal.h
The file was modifiedclang/test/Driver/cl-options.c
The file was modifiedclang/lib/Driver/ToolChains/BareMetal.cpp
The file was modifiedclang/test/Driver/fsanitize.c
The file was modifiedclang/test/Driver/instrprof-ld.c
Commit 680f836c2fa72166badd594a52b3f41b2ad074d2 by rprichard
Revert "[builtins] Define fmax and scalbn inline"

This reverts commit 341889ee9e03e73b313263c516b3d1fd33d4c4ba.

The new unit tests fail on sanitizer-windows.
The file was modifiedcompiler-rt/lib/builtins/divdc3.c
The file was modifiedcompiler-rt/lib/builtins/fp_lib.h
The file was modifiedcompiler-rt/lib/builtins/int_lib.h
The file was modifiedcompiler-rt/lib/builtins/int_math.h
The file was removedcompiler-rt/test/builtins/Unit/compiler_rt_scalbnf_test.c
The file was modifiedcompiler-rt/lib/builtins/divsc3.c
The file was removedcompiler-rt/test/builtins/Unit/compiler_rt_fmaxf_test.c
The file was removedcompiler-rt/test/builtins/Unit/compiler_rt_scalbnl_test.c
The file was modifiedcompiler-rt/lib/builtins/divtc3.c
The file was modifiedcompiler-rt/lib/builtins/ppc/divtc3.c
The file was removedcompiler-rt/test/builtins/Unit/compiler_rt_scalbn_test.c
The file was removedcompiler-rt/test/builtins/Unit/compiler_rt_fmax_test.c
The file was removedcompiler-rt/test/builtins/Unit/compiler_rt_fmaxl_test.c
Commit a7d4826101aba8594bf5308c6a3e40c44608bca5 by Vedant Kumar
[profile] Fix buffer overrun when parsing %c in filename string

Fix a buffer overrun that can occur when parsing '%c' at the end of a
filename pattern string.

rdar://74571261

Reviewed By: kastiglione

Differential Revision: https://reviews.llvm.org/D97239
The file was addedcompiler-rt/test/profile/ContinuousSyncMode/get-filename.c
The file was modifiedcompiler-rt/lib/profile/InstrProfilingFile.c
Commit c519460745ece21238b0ee6c0f9b921366701308 by silvasean
Allow !shape.size type operands in "shape.from_extents" op.

This expands the op to support error propagation and also makes it symmetric with  "shape.get_extent" op.

Reviewed By: silvas

Differential Revision: https://reviews.llvm.org/D97261
The file was modifiedmlir/include/mlir/Dialect/Shape/IR/ShapeOps.td
The file was modifiedmlir/test/Dialect/Shape/canonicalize.mlir