platform/upstream/llvm.git
22 months ago[AMDGPU] Separate out SGPR spills to VGPR lanes during PEI
Christudasan Devadasan [Wed, 13 Apr 2022 05:58:59 +0000 (11:28 +0530)]
[AMDGPU] Separate out SGPR spills to VGPR lanes during PEI

SILowerSGPRSpills pass handles the lowering of SGPR spills
into VGPR lanes. Some SGPR spills are handled later during
PEI. There is a common function used in both places to find
the free VGPR lane. This patch eliminates that dependency to
find the free VGPR by handling it separately for PEI. It is a
prerequisite patch for a future work to allow SGPR spills to
virtual VGPR lanes during SILowerSGPRSpills.

Reviewed By: arsenm

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

22 months ago[AMDGPU] Correctly set IsKill flag for VGPR spills in the prolog
Christudasan Devadasan [Sun, 17 Apr 2022 12:14:39 +0000 (17:44 +0530)]
[AMDGPU] Correctly set IsKill flag for VGPR spills in the prolog

We always assume the vector register is dead or killed while
inserting the VGPR spills in the prolog. It is not always
true. Used the entry block liveIn data while setting the flag.

Reviewed By: arsenm

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

22 months ago[AMDGPU] Add WWM reserved VGPRs to WWMSpills
Christudasan Devadasan [Tue, 19 Apr 2022 07:04:12 +0000 (12:34 +0530)]
[AMDGPU] Add WWM reserved VGPRs to WWMSpills

The custom VGPR spills inserted during frame lowering
maintain a separate list for WWM reserved registers.
Added them into WWMSpills that already tracks such
reserved registers. It unifies the spill insertion.

Reviewed By: nhaehnle, arsenm

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

22 months ago[AMDGPU] Callee must always spill writelane VGPRs
Christudasan Devadasan [Mon, 13 Jun 2022 13:12:02 +0000 (18:42 +0530)]
[AMDGPU] Callee must always spill writelane VGPRs

Since the writelane instruction used for SGPR spills can
modify inactive lanes, the callee must preserve the VGPR
this instruction modifies even if it was marked Caller-saved.

Reviewed By: arsenm, nhaehnle

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

22 months ago[mlir] llvm::Optional::value => operator*/operator->
Fangrui Song [Sat, 17 Dec 2022 05:27:33 +0000 (05:27 +0000)]
[mlir] llvm::Optional::value => operator*/operator->

std::optional::value() has undesired exception checking semantics and is
unavailable in some older Xcode. The call sites block std::optional migration.

22 months ago[llvm] llvm::Optional::value => operator*/operator->
Fangrui Song [Sat, 17 Dec 2022 05:23:45 +0000 (05:23 +0000)]
[llvm] llvm::Optional::value => operator*/operator->

std::optional::value() has undesired exception checking semantics and is
unavailable in some older Xcode. The call sites block std::optional migration.

22 months ago[clang] llvm::Optional::value => operator*/operator->
Fangrui Song [Sat, 17 Dec 2022 05:15:07 +0000 (05:15 +0000)]
[clang] llvm::Optional::value => operator*/operator->

std::optional::value() has undesired exception checking semantics and is
unavailable in some older Xcode. The call sites block std::optional migration.

22 months ago[clangd] llvm::Optional::value => operator*/operator->
Fangrui Song [Sat, 17 Dec 2022 05:11:01 +0000 (05:11 +0000)]
[clangd] llvm::Optional::value => operator*/operator->

std::optional::value() has undesired exception checking semantics and is
unavailable in some older Xcode. The call sites block std::optional migration.

22 months ago[-Wunsafe-buffer-usage] Ignore array subscript on literal zero
ziqingluo-90 [Sat, 17 Dec 2022 04:59:40 +0000 (20:59 -0800)]
[-Wunsafe-buffer-usage] Ignore array subscript on literal zero

Unsafe Buffer Usage analysis only warns unsafe buffer accesses but not
pointer dereferences.  An array subscript on a literal zero is
equivalent to dereference a pointer thus we do not want to warn it.

Reviewed By: NoQ

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

22 months ago[lld] llvm::Optional::value => operator*/operator->
Fangrui Song [Sat, 17 Dec 2022 05:03:57 +0000 (05:03 +0000)]
[lld] llvm::Optional::value => operator*/operator->

std::optional::value() has undesired exception checking semantics and is
unavailable in some older Xcode. The call sites block std::optional migration.

22 months ago[lldb] llvm::Optional::value => operator*/operator->
Fangrui Song [Sat, 17 Dec 2022 05:01:54 +0000 (05:01 +0000)]
[lldb] llvm::Optional::value => operator*/operator->

std::optional::value() has undesired exception checking semantics and is
unavailable in some older Xcode. The call sites block std::optional migration.

22 months agollvm::Optional::value => operator*/operator->
Fangrui Song [Sat, 17 Dec 2022 04:45:11 +0000 (04:45 +0000)]
llvm::Optional::value => operator*/operator->

std::optional::value() has undesired exception checking semantics and is
unavailable in some older Xcode. The call sites block std::optional migration.

22 months ago[-Wunsafe-buffer-usage] Improve pointer matching pattern
ziqingluo-90 [Sat, 17 Dec 2022 04:35:41 +0000 (20:35 -0800)]
[-Wunsafe-buffer-usage] Improve pointer matching pattern

Generalize the pointer expression AST matcher in Unsafe Buffer Usage analysis.
Add test cases for various kinds of pointer usages.

Reviewed By: NoQ, aaron.ballman, xazax.hun

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

22 months ago[mlir] std::optional::value => operator*/operator->
Fangrui Song [Sat, 17 Dec 2022 04:38:27 +0000 (04:38 +0000)]
[mlir] std::optional::value => operator*/operator->

value() has undesired exception checking semantics and calls
__throw_bad_optional_access in libc++. Moreover, the API is unavailable without
_LIBCPP_NO_EXCEPTIONS on older Mach-O platforms (see
_LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS).

22 months ago[flang] std::optional::value => operator*/operator->
Fangrui Song [Sat, 17 Dec 2022 04:11:55 +0000 (04:11 +0000)]
[flang] std::optional::value => operator*/operator->

22 months ago[lld] std::optional::value => operator*/operator->
Fangrui Song [Sat, 17 Dec 2022 03:19:47 +0000 (03:19 +0000)]
[lld] std::optional::value => operator*/operator->

22 months ago[C-API] Add example code to exercise new MCJIT-like-memory-manager API.
Wenzel Jakob [Sat, 17 Dec 2022 02:11:56 +0000 (13:11 +1100)]
[C-API] Add example code to exercise new MCJIT-like-memory-manager API.

This example shows how to use the newly added
LLVMOrcCreateRTDyldObjectLinkingLayerWithMCJITMemoryManagerLikeCallbacks API.

22 months ago[C-API] LLVMOrcCreateRTDyldObjectLinkingLayerWithMCJITMemoryManagerLikeCallbacks
Lang Hames [Sat, 17 Dec 2022 02:01:08 +0000 (13:01 +1100)]
[C-API] LLVMOrcCreateRTDyldObjectLinkingLayerWithMCJITMemoryManagerLikeCallbacks

Adds a LLVMOrcCreateRTDyldObjectLinkingLayerWithMCJITMemoryManagerLikeCallbacks
function that can be used to create an RTDyldObjectLinkingLayer using callbacks
that are similar (but not identical) to those used in
LLVMCreateSimpleMCJITMemoryManager. This is intended to ease the transition to
ORC for MCJIT C-API clients.

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

22 months agostd::optional::value => operator*/operator->
Fangrui Song [Sat, 17 Dec 2022 03:12:04 +0000 (03:12 +0000)]
std::optional::value => operator*/operator->

value() has undesired exception checking semantics and calls
__throw_bad_optional_access in libc++. Moreover, the API is unavailable without
_LIBCPP_NO_EXCEPTIONS on older Mach-O platforms (see
_LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS).

This fixes check-clang-tools.

22 months agoReland 2nd attempt: [lld-macho] Fix bug in reading cpuSubType field.
Vy Nguyen [Fri, 16 Dec 2022 20:17:06 +0000 (15:17 -0500)]
Reland 2nd attempt:  [lld-macho] Fix bug in reading cpuSubType field.

This reverts commit 52a118d08fbb0a45cba8c34346d9ccb14f599c6a.

New changes:
Fix tests to dump both slices in the fat-archive because otool
isn't deterministic about which slice it prints across different archs.
(It printed x86 on x86 machines but arm64 on arm64, this was why
the test failed on arm64)

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

22 months ago[RISCV][VP] support vp.reduce.mul by ExpandVectorPredication
Yingchi Long [Fri, 9 Dec 2022 16:53:57 +0000 (00:53 +0800)]
[RISCV][VP] support vp.reduce.mul by ExpandVectorPredication

Most of VP intrinsics are implemented in RISC-V backends, but
vp.reduce.mul (element length > 1) does not yet. Legalizes vp.reduce.mul
using ExpandVectorPredication Pass.

Reviewed By: reames

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

22 months ago[-Wunsafe-buffer-usage] NFC: Implement fix-strategies and variable-use-claiming.
Artem Dergachev [Sat, 17 Dec 2022 01:52:02 +0000 (17:52 -0800)]
[-Wunsafe-buffer-usage] NFC: Implement fix-strategies and variable-use-claiming.

This patch adds more abstractions that we'll need later for emitting
-Wunsafe-buffer-usage fixits. It doesn't emit any actual fixits,
so no change is observed behavior, but it introduces a way to emit fixits,
and existing tests now verify that the compiler still emits no fixits,
despite knowing how to do so.

The purpose of our code transformation analysis is to fix variable types
in the code from raw pointer types to C++ standard collection/view types.

The analysis has to decide on its own which specific type is
the most appropriate for every variable. This patch introduces
the Strategy class that maps variables to their most appropriate types.

In D137348 we've introduced the Gadget abstraction, which describes
a rigid AST pattern that the analysis "fully understands" and may need
to fix. Which specific fix is actually necessary for a given Gadget,
and whether it's necessary at all, and whether it's possible in the first place,
depends on the Strategy. So, this patch adds a virtual method which every
gadget can implement in order to teach the analysis how to fix that gadget:

  Gadget->getFixits(Strategy)

However, even if the analysis knows how to fix every Gadget, doesn't
necessarily mean it can fix the variable. Some uses of the variable may have
never been covered by Gadgets, which corresponds to the situation that
the analysis doesn't fully understand how the variable is used. This patch
introduces a Tracker class that tracks all variable uses (i.e. DeclRefExprs)
in the function. Additionally, each Gadget now provides a new virtual method

  Gadget->getClaimedVarUseSites()

that the Tracker can call to see which DeclRefExprs are "claimed" by the Gadget.
In order to fix the variable with a certain Strategy, the Tracker needs to
confirm that there are no unclaimed uses, and every Gadget has to provide
a fix for that Strategy.

This "conservative" behavior guarantees that fixes emitted by our analysis
are correct by construction. We can now be sure that the analysis won't
attempt to emit a fix if it doesn't understand the code. Later, as we implement
more getFixits() methods in individual Gadget classes, we'll start
progressively emitting more and more fixits.

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

22 months agoAllow non-constant divisors in affine mod, floordiv, ceildiv.
Benoit Jacob [Thu, 15 Dec 2022 02:00:39 +0000 (02:00 +0000)]
Allow non-constant divisors in affine mod, floordiv, ceildiv.

The requirement that divisor>0 is not enforced here outside of the
constant case, but how to enforce it? If I understand correctly, it is
UB and while it is nice to be able to deterministically intercept UB,
that isn't always feasible. Hopefully, keeping the existing
enforcement in the constant case is enough.

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

22 months agoReland "[SimplifyCFG] `FoldBranchToCommonDest()`: deal with mismatched IV's in PHI...
Roman Lebedev [Sat, 17 Dec 2022 02:13:30 +0000 (05:13 +0300)]
Reland "[SimplifyCFG] `FoldBranchToCommonDest()`: deal with mismatched IV's in PHI's in common successor block"

This reverts commit 37b8f09a4b61bf9bf9d0b9017d790c8b82be2e17,
and returns commit 1bd0b82e508d049efdb07f4f8a342f35818df341.
The miscompile was in InstCombine, and it has been addressed.

This tries to approach the problem noted by @arsenm:
terrible codegen for `__builtin_fpclassify()`:
https://godbolt.org/z/388zqdE37

Just because the PHI in the common successor happens to have different
incoming values for these two blocks, doesn't mean we have to give up.
It's quite easy to deal with this, we just need to produce a select:
https://alive2.llvm.org/ce/z/000srb

Now, the cost model for this transform is rather overly strict,
so this will basically never fire. We tally all (over all preds)
the selects needed to the NumBonusInsts

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

22 months ago[IR][PatternMatch] `m_Not`: do not apply inner matcher unless `Not` matched
Roman Lebedev [Sat, 17 Dec 2022 01:57:58 +0000 (04:57 +0300)]
[IR][PatternMatch] `m_Not`: do not apply inner matcher unless `Not` matched

This is consistent with how other commutative matchers operate,
and i assumed that is how this one worked, alas it did not,
and thus `foldNestedSelects()` was miscompiling stuff.

22 months ago[NFC][InstCombine] Simplify miscompile testcase
Roman Lebedev [Sat, 17 Dec 2022 01:20:28 +0000 (04:20 +0300)]
[NFC][InstCombine] Simplify miscompile testcase

22 months ago[NFC][InstCombine] Add some readability by using `DecomposedSelect` struct
Roman Lebedev [Fri, 16 Dec 2022 21:22:11 +0000 (00:22 +0300)]
[NFC][InstCombine] Add some readability by using `DecomposedSelect` struct

22 months ago[flang] Catch attempts to initialize allocatable components with DATA statement
Peter Klausler [Sat, 17 Dec 2022 00:47:06 +0000 (16:47 -0800)]
[flang] Catch attempts to initialize allocatable components with DATA statement

Nice try, but no, you can't initialize an instance of a derived type using a
structure constructor that has a component corresponding to an allocatable
component.

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

22 months agoclang/unittests/Basic/SarifTest.cpp: std::optional::value => operator*
Fangrui Song [Sat, 17 Dec 2022 02:08:24 +0000 (02:08 +0000)]
clang/unittests/Basic/SarifTest.cpp: std::optional::value => operator*

22 months agoRevert "[Attributor][NFCI] Update tests according to last commit"
Mitch Phillips [Sat, 17 Dec 2022 01:58:39 +0000 (17:58 -0800)]
Revert "[Attributor][NFCI] Update tests according to last commit"

This reverts commit cc9d9df7e539da4752f1569155d4ceb78465114f.

Reason: This change is dependent on a commit that needs to be rolled
back because it broke the ASan buildbot. See
https://reviews.llvm.org/rGfc21f2d7bae2e0be630470cc7ca9323ed5859892 for
more information.

22 months agoRevert "[Attributor] Introduce AA[Intra/Inter]Reachability"
Mitch Phillips [Sat, 17 Dec 2022 01:56:48 +0000 (17:56 -0800)]
Revert "[Attributor] Introduce AA[Intra/Inter]Reachability"

This reverts commit fc21f2d7bae2e0be630470cc7ca9323ed5859892.

This patch broke the ASan buildbot. See
https://reviews.llvm.org/rGfc21f2d7bae2e0be630470cc7ca9323ed5859892 for
more information.

22 months agoRevert "[OpenMP][FIX] Restrict more unsound assmptions about threading"
Mitch Phillips [Sat, 17 Dec 2022 01:56:38 +0000 (17:56 -0800)]
Revert "[OpenMP][FIX] Restrict more unsound assmptions about threading"

This reverts commit 07c375348083170e39c9498a42a9679c7e08f07f.

Reason: This change is dependent on a commit that needs to be rolled
back because it broke the ASan buildbot. See
https://reviews.llvm.org/rGfc21f2d7bae2e0be630470cc7ca9323ed5859892 for
more information.

22 months agoRevert "[Attributor][FIX] Avoid memory leakage through InstExclusionSet"
Mitch Phillips [Sat, 17 Dec 2022 01:56:21 +0000 (17:56 -0800)]
Revert "[Attributor][FIX] Avoid memory leakage through InstExclusionSet"

This reverts commit 4a5d0d8704aa2860c0459a63adfdd415a451c4f1.

Reason: This change is dependent on a commit that needs to be rolled
back because it broke the ASan buildbot. See
https://reviews.llvm.org/rGfc21f2d7bae2e0be630470cc7ca9323ed5859892 for
more information.

22 months agoRevert "[Attributor][FIX] Try to prevent a potential memory leak"
Mitch Phillips [Sat, 17 Dec 2022 01:56:11 +0000 (17:56 -0800)]
Revert "[Attributor][FIX] Try to prevent a potential memory leak"

This reverts commit 2ac37df5d7f385dbf9c9456aae1cc6d0d98587ef.

Reason: This change is dependent on a commit that needs to be rolled
back because it broke the ASan buildbot. See
https://reviews.llvm.org/rGfc21f2d7bae2e0be630470cc7ca9323ed5859892 for
more information.

22 months agoRevert "[Attributor][FIX] Allow negative offsets for ranges"
Mitch Phillips [Sat, 17 Dec 2022 01:56:00 +0000 (17:56 -0800)]
Revert "[Attributor][FIX] Allow negative offsets for ranges"

This reverts commit 88f9b525085b4292080aec6aba835801ca5793b6.

Reason: This change is dependent on a commit that needs to be rolled
back because it broke the ASan buildbot. See
https://reviews.llvm.org/rGfc21f2d7bae2e0be630470cc7ca9323ed5859892 for
more information.

22 months agoRevert "[AAPointerInfo] handle multiple offsets in PHI"
Mitch Phillips [Sat, 17 Dec 2022 01:55:48 +0000 (17:55 -0800)]
Revert "[AAPointerInfo] handle multiple offsets in PHI"

This reverts commit 88db516af69619d4326edea37e52fc7321c33bb5.

Reason: This change is dependent on a commit that needs to be rolled
back because it broke the ASan buildbot. See
https://reviews.llvm.org/rGfc21f2d7bae2e0be630470cc7ca9323ed5859892 for
more information.

22 months agoRevert "Revert "[AAPointerInfo] handle multiple offsets in PHI""
Mitch Phillips [Sat, 17 Dec 2022 01:55:38 +0000 (17:55 -0800)]
Revert "Revert "[AAPointerInfo] handle multiple offsets in PHI""

This reverts commit 12696d302d146ffe616eecab3feceba9d29be2db.

Reason: This change is dependent on a commit that needs to be rolled
back because it broke the ASan buildbot. See
https://reviews.llvm.org/rGfc21f2d7bae2e0be630470cc7ca9323ed5859892 for
more information.

22 months agoRevert "[AAPointerInfo] handle multiple offsets in PHI"
Mitch Phillips [Sat, 17 Dec 2022 01:54:44 +0000 (17:54 -0800)]
Revert "[AAPointerInfo] handle multiple offsets in PHI"

This reverts commit 179ed8871101cd197e0a719a3629cd5077b1a999.

Reason: This change is dependent on a commit that needs to be rolled
back because it broke the ASan buildbot. See
https://reviews.llvm.org/rGfc21f2d7bae2e0be630470cc7ca9323ed5859892 for
more information.

22 months agostd::optional::value => operator*/operator->
Fangrui Song [Sat, 17 Dec 2022 01:42:39 +0000 (01:42 +0000)]
std::optional::value => operator*/operator->

value() has undesired exception checking semantics and calls
__throw_bad_optional_access in libc++. Moreover, the API is unavailable without
_LIBCPP_NO_EXCEPTIONS on older Mach-O platforms (see
_LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS).

This fixes check-llvm.

22 months ago[-Wunsafe-buffer-usage] Add warnings for unsafe buffer accesses by array subscript...
ziqingluo-90 [Sat, 17 Dec 2022 00:21:57 +0000 (16:21 -0800)]
[-Wunsafe-buffer-usage] Add warnings for unsafe buffer accesses by array subscript operations

Add an unsafe Gadget in the Unsafe Buffer Usage anslysis to represent
(and search (via matchers) for) unsafe buffer-accessing array subscript operations.

Reviewed By: NoQ, jkorous, aaron.ballman, xazax.hun

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

22 months ago[gn] port 7d2c1150d31b
Nico Weber [Sat, 17 Dec 2022 01:09:25 +0000 (20:09 -0500)]
[gn] port 7d2c1150d31b

22 months ago[flang] Prevent crash in error case: elemental with alternate return
Peter Klausler [Fri, 16 Dec 2022 23:10:50 +0000 (15:10 -0800)]
[flang] Prevent crash in error case: elemental with alternate return

When an ELEMENTAL subroutine is erroneously declared with alternate return
arguments, don't crash when checking the ranks of the actual arguments.

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

22 months ago[NFC][OpenMP] Fix format for recent changes on OMPGridValues
Kevin Sala [Sat, 17 Dec 2022 00:37:21 +0000 (01:37 +0100)]
[NFC][OpenMP] Fix format for recent changes on OMPGridValues

This patch applies the clang-format to the recent changes on OMPGridValues
introduced by commit 2e9c3fe6fcfd7b4672facec87dceb76ff3c83566.

22 months agostd::optional::value => operator*/operator->
Fangrui Song [Sat, 17 Dec 2022 00:42:05 +0000 (00:42 +0000)]
std::optional::value => operator*/operator->

value() has undesired exception checking semantics and calls
__throw_bad_optional_access in libc++. Moreover, the API is unavailable without
_LIBCPP_NO_EXCEPTIONS on older Mach-O platforms (see
_LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS).

This fixes clang.

22 months ago[OpenMP] Increase max teams in OMPGridValues
Kevin Sala [Wed, 21 Sep 2022 19:25:39 +0000 (19:25 +0000)]
[OpenMP] Increase max teams in OMPGridValues

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

22 months ago[libc][Obvious] Add missing deps for a few targets.
Siva Chandra Reddy [Sat, 17 Dec 2022 00:20:01 +0000 (00:20 +0000)]
[libc][Obvious] Add missing deps for a few targets.

22 months agoRevert "[InlineAdvisor] Allow loading advisors as plugins"
Mircea Trofin [Sat, 17 Dec 2022 00:10:22 +0000 (16:10 -0800)]
Revert "[InlineAdvisor] Allow loading advisors as plugins"

This reverts commit a00aaf2b1317fbc224dc6606ef7c2a10d617f28f.

Example failures:
    https://lab.llvm.org/buildbot#builders/68/builds/44933
    https://lab.llvm.org/buildbot#builders/230/builds/6938

22 months ago[InlineAdvisor] Allow loading advisors as plugins
ibricchi [Fri, 16 Dec 2022 22:11:52 +0000 (14:11 -0800)]
[InlineAdvisor] Allow loading advisors as plugins

Adds the ability to load InlineAdvisors as plugins. This allows developing and distributing inlining heuristics outside of tree.

The PluginInlineAdvisorAnalysis class serves as the entry point for dynamic advisors. Plugins must register instances of this class to provide their own InliningAdvisor.

Reviewed By: mtrofin

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

22 months ago[NFC] Add llvm-config.h def for LLVM_ENABLE_PLUGINS
Mircea Trofin [Fri, 16 Dec 2022 23:44:27 +0000 (15:44 -0800)]
[NFC] Add llvm-config.h def for LLVM_ENABLE_PLUGINS

Snatched from D139644, but because it'd also need a fix in
Passes/CMakeLists.txt, decided to peel it off.

22 months ago-Wunsafe-buffer-usage: fix build when -DLLVM_ENABLE_ASSERTIONS=off
Fangrui Song [Fri, 16 Dec 2022 23:43:32 +0000 (23:43 +0000)]
-Wunsafe-buffer-usage: fix build when -DLLVM_ENABLE_ASSERTIONS=off

22 months ago[CodeGen] std::optional::value => operator*/operator->
Fangrui Song [Fri, 16 Dec 2022 23:41:36 +0000 (23:41 +0000)]
[CodeGen] std::optional::value => operator*/operator->

value() has undesired exception checking semantics and calls
__throw_bad_optional_access in libc++. Moreover, the API is unavailable without
_LIBCPP_NO_EXCEPTIONS on older Mach-O platforms (see
_LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS).

This fixes LLVMMIRParser, LLVMGlobalISel, LLVMAsmPrinter, LLVMSelectionDAG.

22 months agoEnsure clang test doesn't write out to the source directory
David Blaikie [Fri, 16 Dec 2022 23:39:28 +0000 (23:39 +0000)]
Ensure clang test doesn't write out to the source directory

22 months ago[Transforms,CodeGen] std::optional::value => operator*/operator->
Fangrui Song [Fri, 16 Dec 2022 23:21:27 +0000 (23:21 +0000)]
[Transforms,CodeGen] std::optional::value => operator*/operator->

value() has undesired exception checking semantics and calls
__throw_bad_optional_access in libc++. Moreover, the API is unavailable without
_LIBCPP_NO_EXCEPTIONS on older Mach-O platforms (see
_LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS).

22 months agoclang/test/CodeCompletion: Simplify/fix some `touch` commands
David Blaikie [Fri, 16 Dec 2022 23:13:47 +0000 (23:13 +0000)]
clang/test/CodeCompletion: Simplify/fix some `touch` commands

These were inconsistent (one `touch` line listed all the files in a
single `touch` invocation, but the other listed them as separate
commands with `&&`) and incorrect (one `&&` was missing, causing `touch`
to try to touch a file called `touch` in the cwd, which might not be
accessible/relevant to test execution)

So make them consistent and simpler by using the "list all the files on
a line in a single `touch` invocation" reducing the visual
noise/clutter/etc.

22 months ago[lldb][NFC] Remove unused/unimplemented Type methods
Arthur Eubanks [Fri, 16 Dec 2022 23:16:52 +0000 (15:16 -0800)]
[lldb][NFC] Remove unused/unimplemented Type methods

22 months ago[mlir][linalg] Creating named 1D pooling ops
Murali Vijayaraghavan [Fri, 16 Dec 2022 04:49:45 +0000 (04:49 +0000)]
[mlir][linalg] Creating named 1D pooling ops

This is mostly going to be used for linalg transformations - to make pooling ops similar to convolution ops.

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

22 months ago[flang][runtime] Allow CLASS(*) components when creating descriptors
Peter Klausler [Fri, 16 Dec 2022 21:48:13 +0000 (13:48 -0800)]
[flang][runtime] Allow CLASS(*) components when creating descriptors

Extend the descriptor creation function for components to allow
unlimited polymorphic components (CLASS(*)) and to also properly set
the attributes of the established descriptors.

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

22 months ago[-Wunsafe-buffer-usage] NFC: Introduce an abstraction for fixable code patterns.
Artem Dergachev [Fri, 16 Dec 2022 22:46:05 +0000 (14:46 -0800)]
[-Wunsafe-buffer-usage] NFC: Introduce an abstraction for fixable code patterns.

This patch introduces a hierarchy of Gadget classes, which are going to be
the core concept in the somewhat sophisticated machine behind the upcoming
-Wunsafe-buffer-usage fix-it hints.

A gadget is a rigid code pattern that constitutes an operation that
the fixit machine "understands" well enough to work with. A gadget may be
"unsafe" (i.e., constitute a raw buffer access) or "safe" (constitute
a use of a pointer or array variable that isn't unsafe per se,
but may need fixing if the participating variable changes type
to a safe container/view).

We'll be able to make decisions about how to fix the code depending on
the set of gadgets that we've enumerated. Basically, in order to fix a type
of a variable, each use of that variable has to participate in a gadget,
and each such gadget has to consent to fixing itself according to
the variable's new type.

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

22 months ago[OpenMP][libomptarget] Add AMDGPU NextGen plugin with asynchronous behavior
Kevin Sala [Fri, 16 Dec 2022 14:26:46 +0000 (15:26 +0100)]
[OpenMP][libomptarget] Add AMDGPU NextGen plugin with asynchronous behavior

This commit adds the AMDGPU NextGen plugin inheriting from PluginInterface's classes.
It also implements the asynchronous behavior in the plugin operations: kernel launches
and memory transfers. To this end, it implements the concept of streams of asynchronous
operations. The streams are implemented using the HSA signals to define input and output
dependencies between asynchronous operations.

Missing features:
  - Retrieve the maximum number of threads per group that a kernel can run. This requires
    reading the image.
  - Implement __tgt_rtl_sync_event, not used on the libomptarget side.

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

22 months ago[OpenMP][libomptarget] Add missing symbols in dynamic_hsa
Kevin Sala [Fri, 16 Dec 2022 14:23:34 +0000 (15:23 +0100)]
[OpenMP][libomptarget] Add missing symbols in dynamic_hsa

This patch prepares for the new AMDGPU NextGen plugin.

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

22 months ago[Transforms,InstCombine] std::optional::value => operator*/operator->
Fangrui Song [Fri, 16 Dec 2022 22:57:55 +0000 (22:57 +0000)]
[Transforms,InstCombine] std::optional::value => operator*/operator->

value() has undesired exception checking semantics and calls
__throw_bad_optional_access in libc++. Moreover, the API is unavailable without
_LIBCPP_NO_EXCEPTIONS on older Mach-O platforms (see
_LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS).

22 months agostd::optional::value => operator*/operator->
Fangrui Song [Fri, 16 Dec 2022 22:44:08 +0000 (22:44 +0000)]
std::optional::value => operator*/operator->

value() has undesired exception checking semantics and calls
__throw_bad_optional_access in libc++. Moreover, the API is unavailable without
_LIBCPP_NO_EXCEPTIONS on older Mach-O platforms (see
_LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS).

This commit fixes LLVMAnalysis and its dependencies.

22 months agoTemporarily skip test under ASAN
Adrian Prantl [Fri, 16 Dec 2022 21:50:09 +0000 (13:50 -0800)]
Temporarily skip test under ASAN

22 months ago[lldb] Report clang module build remarks
Dave Lee [Wed, 14 Dec 2022 21:53:15 +0000 (13:53 -0800)]
[lldb] Report clang module build remarks

Update the Clang diagnostic consumer (in ClangModulesDeclVendor) to report
progress on Clang module builds, as both progress events and expression logs.

Module build remarks are enabled by with clang's `-Rmodule-build` flag.

With this change, command line users of lldb will see progress events showing
which modules are being built, and - by how long they stay on screen - how much
time it takes to build them. IDEs that show progress events can show these
updates if desired.

This does not show module-import remarks, although that may be added as a
future change.

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

22 months ago[flang] Correct folding of EXTENDS_TYPE_OF()
Peter Klausler [Fri, 16 Dec 2022 19:44:51 +0000 (11:44 -0800)]
[flang] Correct folding of EXTENDS_TYPE_OF()

There was a falsely known case with a polymorphic type.

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

22 months ago[mlir-c] Add method to create unmanaged dense resource elements attr
Jacques Pienaar [Fri, 16 Dec 2022 21:36:15 +0000 (13:36 -0800)]
[mlir-c] Add method to create unmanaged dense resource elements attr

Following DenseElementsAttr pattern.

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

22 months ago[clang-format] Don't require deduction guides to be templates
Emilia Dreamer [Fri, 16 Dec 2022 21:25:52 +0000 (23:25 +0200)]
[clang-format] Don't require deduction guides to be templates

The C++ standard doesn't require that class template deduction guides
be templates themselves, but previously `isDeductionGuide` would assert
for the existence of a template closer or requires clause closer before
the deduction guide declaration.

This patch simply removes that check. Because of this, a test which
asserted that `x()->x<1>;` *isn't* a deduction guide failed, as it is
now formatted as a deduction guide. However, as @JohelEGP demonstrated,
it is [possible to make that a viable deduction guide][1].

Thus, that test has been removed, but other tests related to
non-template class template deduction guides have been added.

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

[1]: https://compiler-explorer.com/z/Wx3K6d5K9

Reviewed By: HazardyKnusperkeks, owenpan

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

22 months ago[mlir][tensor] Implement TilingInterface for unpack op
Hanhan Wang [Fri, 2 Dec 2022 21:25:48 +0000 (13:25 -0800)]
[mlir][tensor] Implement TilingInterface for unpack op

The main issue of tiling unpack op is about incomplete tile. Since all
the dimensions are orthogonal, discussing 1-d unpack case is enough. The
core idea is to make the input slice have complete tiles. In this case,
a larger unpacked tile will be created. We'll need an extract_slice op
to shift and truncate the output.

Take Nn_to_N as an example. Say that N=32, n=8, and tiling_size=15. The
coordinates of second tile (i.e., result[15..31]) are [(1, 7), (2, 0,),
(2, 1) ... (3, 6), (3, 7)]. The first row and the last row are
incomplete in terms of inputs. It's impossible to represent an unpack op
using the coordinates. Because the input has higher rank and the math
computation of coordinate is using mod and ceilDiv. That's very tricky.

To represent the unpack op, we have to complete the rows. I.e., the
input coordinates would start with (1, 0); end with (3, 7). In this
context, the tiled unpack produces a (3 * n) elements because there are
3 rows in total. Follow by a tensor.extract_slice op, we can get the
actual result.

If the tiling sizes are multiple of inner tile sizes, it is a perfect
tiling case. In this context, the larger input and output is not needed.

Reviewed By: chelini

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

22 months agoFix a syntax error
Adrian Prantl [Fri, 16 Dec 2022 21:02:59 +0000 (13:02 -0800)]
Fix a syntax error

22 months ago[fuzzer] Fix UNSUPPORTED criteria for two tests
Paul Robinson [Fri, 16 Dec 2022 20:47:54 +0000 (12:47 -0800)]
[fuzzer] Fix UNSUPPORTED criteria for two tests

Fuzzer might decide on a target arch different from the triple.

22 months agoError: Replace value() with operator*
Fangrui Song [Fri, 16 Dec 2022 20:31:47 +0000 (20:31 +0000)]
Error: Replace value() with operator*

Some older macOS libc++ report:

    error: 'value' is unavailable: introduced in macOS 10.13

22 months ago[mlir] Drop uses of operator<<(raw_ostream &OS, const Optional<T> &O)
Fangrui Song [Fri, 16 Dec 2022 20:24:35 +0000 (20:24 +0000)]
[mlir] Drop uses of operator<<(raw_ostream &OS, const Optional<T> &O)

22 months ago[flang] Fix fir.dispatch_table generation with derived-type parameter with kind type...
Valentin Clement [Fri, 16 Dec 2022 20:21:00 +0000 (21:21 +0100)]
[flang] Fix fir.dispatch_table generation with derived-type parameter with kind type parameter

When generating the `fir.dispatch_table` operation, the name of the parent
derived-type needs to be mangled. For this the type instantiation
DerivedTypeSpec needs to be retrieved to have the correct kind type parameters.

Reviewed By: PeteSteinfeld

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

22 months ago[flang] Unlimited polymoprhic allocation with intrinsic type spec
Valentin Clement [Fri, 16 Dec 2022 20:19:55 +0000 (21:19 +0100)]
[flang] Unlimited polymoprhic allocation with intrinsic type spec

An unlimited polymoprhic entity can be allocated with a derived type
spec or an intrinsic type spec. This patch add the generation of the
runtime function call when the allocation is done with an intrinsic
type spec.

Reviewed By: jeanPerier

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

22 months ago[AMDGPU][SIFrameLowering] Mark VGPR used for AGPR spills as reserved
Jeffrey Byrnes [Thu, 8 Dec 2022 21:26:59 +0000 (13:26 -0800)]
[AMDGPU][SIFrameLowering] Mark VGPR used for AGPR spills as reserved

Presently, there is an issue on MI100 (and probably other architecture) where the VGPR used for AGPR copies clobbers VGPR used for AGPR spill. AFAICT this is because in processFunctionBeforeFrameIndicesReplaced we think the VGPR register for AGPR spill is unused. This patch aims to correct that. This is a WIP while I work out issues with producing a good test. For now, I'm curious if this is generally a good / bad idea.

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

22 months agoRevert "[SROA] `isVectorPromotionViable()`: memory intrinsics operate on vectors...
Roman Lebedev [Fri, 16 Dec 2022 19:53:58 +0000 (22:53 +0300)]
Revert "[SROA] `isVectorPromotionViable()`: memory intrinsics operate on vectors of bytes (take 3)"

While the PPC litte-endian miscompile did get addressed
by https://reviews.llvm.org/D140046
the PPV big-endian bots are still unhappy.
https://lab.llvm.org/buildbot/#/builders/93/builds/12560

This reverts commit 7bd358bcb4e358b4351c69e02ef76939e08acdc7.

22 months ago[mlir] Drop uses of operator<<(raw_ostream &OS, const Optional<T> &O)
Fangrui Song [Fri, 16 Dec 2022 19:57:30 +0000 (19:57 +0000)]
[mlir] Drop uses of operator<<(raw_ostream &OS, const Optional<T> &O)

22 months ago[clangd] Migrate uses of operator<<(raw_ostream &OS, const Optional<T> &O) to std...
Fangrui Song [Fri, 16 Dec 2022 19:46:00 +0000 (19:46 +0000)]
[clangd] Migrate uses of operator<<(raw_ostream &OS, const Optional<T> &O) to std::optional

22 months ago[vfs] Allow root paths relative to the vfsoverlay YAML file
Haowei Wu [Fri, 4 Nov 2022 23:40:10 +0000 (16:40 -0700)]
[vfs] Allow root paths relative to the vfsoverlay YAML file

This change adds 'root-relative' option in vfsoverlay YAML file format
so the root patchs can be relative to the YAML file directory instead of
the current working directory.

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

22 months ago[clangd] Remove ReferenceFinder::Reference::Target
Nathan Ridge [Wed, 14 Dec 2022 08:18:57 +0000 (03:18 -0500)]
[clangd] Remove ReferenceFinder::Reference::Target

No one was using it

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

22 months ago[flang] Don't crash attempting to fold absurdly large TRANSFER()
Peter Klausler [Sun, 11 Dec 2022 23:17:41 +0000 (15:17 -0800)]
[flang] Don't crash attempting to fold absurdly large TRANSFER()

Apply some sanity checking to the type size and SIZE= values and
avoid crashing on stress tests that attempt to create excessively
large results.

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

22 months ago[InstCombine] Remove code duplication between InstCombiner.h and InstCombineInternal.h.
Craig Topper [Fri, 16 Dec 2022 18:22:55 +0000 (10:22 -0800)]
[InstCombine] Remove code duplication between InstCombiner.h and InstCombineInternal.h.

The class in InstCombineInternal.h inherits from InstCombiner.h.
I think this split was created when target specific InstCombines
were moved to go through TTI.

I had to update some of the code in InstCombiner.h to match changes
that had been made to InstCombineInternal.h.

Reviewed By: nikic

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

22 months ago[fuzzer] Convert tests to check 'target=...'
Paul Robinson [Fri, 16 Dec 2022 19:41:28 +0000 (11:41 -0800)]
[fuzzer] Convert tests to check 'target=...'

Part of the project to eliminate special handling for triples in lit
expressions.

22 months ago[CodeComplete] Offer completions for headers with extension .hxx in include directives
Nathan Ridge [Fri, 16 Dec 2022 08:35:42 +0000 (03:35 -0500)]
[CodeComplete] Offer completions for headers with extension .hxx in include directives

Fixes https://github.com/clangd/clangd/issues/1379

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

22 months ago[trace] Migrate uses of operator<<(raw_ostream &OS, const Optional<T> &O) to std...
Fangrui Song [Fri, 16 Dec 2022 19:30:47 +0000 (19:30 +0000)]
[trace] Migrate uses of operator<<(raw_ostream &OS, const Optional<T> &O) to std::optional

22 months agoFunction: Respect IgnoreLLVMUsed with addrspacecasted functions
Matt Arsenault [Sat, 3 Dec 2022 00:22:54 +0000 (19:22 -0500)]
Function: Respect IgnoreLLVMUsed with addrspacecasted functions

Try to respect IgnoreLLVMUsed if the function was addrspacecasted to
match llvm.used's type.

22 months ago[compiler-rt/cfi] Convert tests to check 'target=...'
Paul Robinson [Fri, 16 Dec 2022 19:09:53 +0000 (11:09 -0800)]
[compiler-rt/cfi] Convert tests to check 'target=...'

Part of the project to eliminate special handling for triples in lit
expressions.

22 months ago[AA][Intrinsics] Add separate_storage assumptions.
David Goldblatt [Fri, 16 Dec 2022 18:52:32 +0000 (10:52 -0800)]
[AA][Intrinsics] Add separate_storage assumptions.

This operand bundle on an assume informs alias analysis that the
arguments point to regions of memory that were allocated separately
(i.e. different heap allocations, different allocas, or different
globals).

As a safety measure, we leave the analysis flag-disabled by default.

Reviewed By: nikic

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

22 months ago[compiler-rt/builtins] Convert tests to check 'target=...'
Paul Robinson [Fri, 16 Dec 2022 19:03:30 +0000 (11:03 -0800)]
[compiler-rt/builtins] Convert tests to check 'target=...'

Part of the project to eliminate special handling for triples in lit
expressions.

22 months agoCorrect typos (NFC)
Sprite [Fri, 16 Dec 2022 18:51:26 +0000 (10:51 -0800)]
Correct typos (NFC)

Just found some typos while reading the llvm/circt project.

compliment -> complement
emitsd -> emits

22 months ago[flang] Expunge needless semantics::ProcInterface
Peter Klausler [Fri, 16 Dec 2022 17:54:55 +0000 (09:54 -0800)]
[flang] Expunge needless semantics::ProcInterface

The ProcInterface structure is used only by ProcEntityDetails; it represents
what a program might have put in parentheses in a procedure-declaration-stmt,
either the name of a procedure interface or a declaration-type-spec.

If a procedure entity has an implicit interface, the function result
type (if any) can be kept in EntityDetails::type_, which already exists
and is currently redundant for ProcEntityDetails symbols.

All that is really needed is a nullable Symbol pointer in ProcEntityDetails
to point to the procedure's explicit interface, when it has one.

Also, catch the case where a procedure has an explicit interface
and a program attempts to also give it a type.

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

22 months ago[asan] Convert more tests to check 'target=...'
Paul Robinson [Fri, 16 Dec 2022 18:35:06 +0000 (10:35 -0800)]
[asan] Convert more tests to check 'target=...'

Part of the project to eliminate special handling for triples in lit
expressions.

22 months ago[mlir][sparse] avoid unnecessary tmp COO buffer and convert when lowering ConcatentateOp.
Peiming Liu [Fri, 16 Dec 2022 18:12:05 +0000 (18:12 +0000)]
[mlir][sparse] avoid unnecessary tmp COO buffer and convert when lowering ConcatentateOp.

When concat along dim 0, and all inputs/outputs are ordered with identity dimension ordering,
the concatenated coordinates will be yield in lexOrder, thus no need to sort.

Reviewed By: aartbik

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

22 months ago[IR][NFC] Cleanup: Remove non-const block iterators to force all updates go through...
Vasileios Porpodas [Wed, 7 Dec 2022 21:10:23 +0000 (13:10 -0800)]
[IR][NFC] Cleanup: Remove non-const block iterators to force all updates go through an interface function

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

22 months ago[flang] Check for elemental finalizer when defined object has vector subscript
Peter Klausler [Fri, 16 Dec 2022 17:48:51 +0000 (09:48 -0800)]
[flang] Check for elemental finalizer when defined object has vector subscript

When a defined object is an array with a vector subscript, and it has a
finalizable type, it may have a final subroutine with a matching or
assumed rank dummy argument that cannot be called.  Unless there is
also a suitable elemental final subroutine, diagnose such a case
with an error message.

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

22 months ago[VPlan] Use macro to define recipe classof implementation (NFC).
Florian Hahn [Fri, 16 Dec 2022 17:52:15 +0000 (17:52 +0000)]
[VPlan] Use macro to define recipe classof implementation (NFC).

Add a VP_CLASSOF_IMPL macro to define common classof implementations for
recipes. This reduces duplication and also adds missing implementations
to existing recipes.

22 months agoUndo one llvm::Optional => std::optional
Paul Robinson [Fri, 16 Dec 2022 17:40:51 +0000 (09:40 -0800)]
Undo one llvm::Optional => std::optional

Using std::optional in Support/TypeTraitsTest.cpp causes gcc 7.5 to
complain. No public bots run a gcc that old, but we have internal bots
that do.

/home/probinson/projects/llvm-org/llvm-project/llvm/unittests/Support/TypeTraitsTest.cpp: In instantiation of ‘void {anonymous}::triviality::TrivialityTester() [with T = std::optional<int>; bool IsTriviallyCopyConstructible = true; bool IsTriviallyMoveConstructible = true]’:
/home/probinson/projects/llvm-org/llvm-project/llvm/unittests/Support/TypeTraitsTest.cpp:121:52:   required from here
/home/probinson/projects/llvm-org/llvm-project/llvm/unittests/Support/TypeTraitsTest.cpp:29:3: error: static assertion failed: Mismatch in expected trivial copy construction!
   static_assert(llvm::is_trivially_copy_constructible<T>::value ==
   ^~~~~~~~~~~~~
/home/probinson/projects/llvm-org/llvm-project/llvm/unittests/Support/TypeTraitsTest.cpp:32:3: error: static assertion failed: Mismatch in expected trivial move construction!
   static_assert(llvm::is_trivially_move_constructible<T>::value ==
   ^~~~~~~~~~~~~

22 months agoAArch64: Stop storing MachineFunction in MachineFunctionInfo
Matt Arsenault [Fri, 16 Dec 2022 17:13:47 +0000 (12:13 -0500)]
AArch64: Stop storing MachineFunction in MachineFunctionInfo

The constructor should not depend on the MachineFunction

22 months ago[NFC] Adjust adjusted manual checklines in DebugInfo to be less sensitive to the...
Roman Lebedev [Fri, 16 Dec 2022 17:28:08 +0000 (20:28 +0300)]
[NFC] Adjust adjusted manual checklines in DebugInfo to be less sensitive to the Value name

The test was passing for me locally, but fails on bots:
https://lab.llvm.org/buildbot/#/builders/98/builds/29290/steps/10/logs/stdio

22 months ago[NFC][InstCombine] Add miscompile reproducer from https://reviews.llvm.org/D139275...
Roman Lebedev [Fri, 16 Dec 2022 16:40:16 +0000 (19:40 +0300)]
[NFC][InstCombine] Add miscompile reproducer from https://reviews.llvm.org/D139275#4001580

SimplifyCFG change is correct and not at fault here.
The actual miscompile appears to be happening in InstCombine.

```
$ /builddirs/llvm-project/build-Clang15/bin/opt -load /repositories/alive2/build-Clang-release/tv/tv.so -load-pass-plugin /repositories/alive2/build-Clang-release/tv/tv.so -passes='tv,instcombine,tv' -o /dev/null /repositories/llvm-project/llvm/test/Transforms/InstCombine/D139275_c4001580.ll

----------------------------------------
define float @D139275_c4001580(float %arg) {
%0:
  %i = fcmp ugt float %arg, 0.000000
  %i1 = fcmp ult float %arg, 1.000000
  %i2 = and i1 %i, %i1
  %i3 = fcmp uge float %arg, 0.100000
  %i4 = xor i1 %i, %i2
  %i5 = select i1 %i4, float 0.100000, float 0.000000
  %i6 = and i1 %i3, %i2
  %i7 = fadd float %arg, -0.100000
  %i8 = select i1 %i6, float %i7, float %i5
  ret float %i8
}
=>
define float @D139275_c4001580(float %arg) {
%0:
  %i = fcmp ugt float %arg, 0.000000
  %i1 = fcmp ult float %arg, 1.000000
  %i2 = and i1 %i, %i1
  %i3 = fcmp uge float %arg, 0.100000
  %i7 = fadd float %arg, -0.100000
  %i5 = select i1 %i3, float %i7, float 0.100000
  %i8 = select i1 %i2, float %i5, float 0.000000
  ret float %i8
}
Transformation doesn't verify! (unsound)
ERROR: Value mismatch

Example:
float %arg = #x3dcbb820 (0.099472284317?)

Source:
i1 %i = #x1 (1)
i1 %i1 = #x1 (1)
i1 %i2 = #x1 (1)
i1 %i3 = #x0 (0)
i1 %i4 = #x0 (0)
float %i5 = #x00000000 (+0.0)
i1 %i6 = #x0 (0)
float %i7 = #xba0a5680 (-0.000527717173?)
float %i8 = #x00000000 (+0.0)

Target:
i1 %i = #x1 (1)
i1 %i1 = #x1 (1)
i1 %i2 = #x1 (1)
i1 %i3 = #x0 (0)
float %i7 = #xba0a5680 (-0.000527717173?)
float %i5 = #x3dcccccd (0.100000001490?)
float %i8 = #x3dcccccd (0.100000001490?)
Source value: #x00000000 (+0.0)
Target value: #x3dcccccd (0.100000001490?)

Pass: (anonymous namespace)::TVPass
Command line: '/builddirs/llvm-project/build-Clang15/bin/opt' '-load' '/repositories/alive2/build-Clang-release/tv/tv.so' '-load-pass-plugin' '/repositories/alive2/build-Clang-release/tv/tv.so' '-passes=tv,instcombine,tv' '-o' '/dev/null' '/repositories/llvm-project/llvm/test/Transforms/InstCombine/D139275_c4001580.ll'

Alive2: Transform doesn't verify!

```