Skip to content

Commit 7ee0097

Browse files
authored
Revert "[llvm] Add support for llvm IR atomicrmw fminimum/fmaximum instructions" (#137657)
Reverts #136759 due to bad interaction with c792b25
1 parent ac40bc7 commit 7ee0097

File tree

37 files changed

+7
-613
lines changed

37 files changed

+7
-613
lines changed

llvm/docs/GlobalISel/GenericOpcode.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -922,8 +922,7 @@ operands.
922922
G_ATOMICRMW_MIN, G_ATOMICRMW_UMAX,
923923
G_ATOMICRMW_UMIN, G_ATOMICRMW_FADD,
924924
G_ATOMICRMW_FSUB, G_ATOMICRMW_FMAX,
925-
G_ATOMICRMW_FMIN, G_ATOMICRMW_FMAXIMUM,
926-
G_ATOMICRMW_FMINIMUM, G_ATOMICRMW_UINC_WRAP,
925+
G_ATOMICRMW_FMIN, G_ATOMICRMW_UINC_WRAP,
927926
G_ATOMICRMW_UDEC_WRAP, G_ATOMICRMW_USUB_COND,
928927
G_ATOMICRMW_USUB_SAT
929928

llvm/docs/LangRef.rst

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11598,8 +11598,6 @@ operation. The operation must be one of the following keywords:
1159811598
- fsub
1159911599
- fmax
1160011600
- fmin
11601-
- fmaximum
11602-
- fminimum
1160311601
- uinc_wrap
1160411602
- udec_wrap
1160511603
- usub_cond
@@ -11609,7 +11607,7 @@ For most of these operations, the type of '<value>' must be an integer
1160911607
type whose bit width is a power of two greater than or equal to eight
1161011608
and less than or equal to a target-specific size limit. For xchg, this
1161111609
may also be a floating point or a pointer type with the same size constraints
11612-
as integers. For fadd/fsub/fmax/fmin/fmaximum/fminimum, this must be a floating-point
11610+
as integers. For fadd/fsub/fmax/fmin, this must be a floating-point
1161311611
or fixed vector of floating-point type. The type of the '``<pointer>``'
1161411612
operand must be a pointer to that type. If the ``atomicrmw`` is marked
1161511613
as ``volatile``, then the optimizer is not allowed to modify the
@@ -11650,10 +11648,8 @@ operation argument:
1165011648
- umin: ``*ptr = *ptr < val ? *ptr : val`` (using an unsigned comparison)
1165111649
- fadd: ``*ptr = *ptr + val`` (using floating point arithmetic)
1165211650
- fsub: ``*ptr = *ptr - val`` (using floating point arithmetic)
11653-
- fmax: ``*ptr = maxnum(*ptr, val)`` (match the `llvm.maxnum.*` intrinsic)
11654-
- fmin: ``*ptr = minnum(*ptr, val)`` (match the `llvm.minnum.*` intrinsic)
11655-
- fmaximum: ``*ptr = maximum(*ptr, val)`` (match the `llvm.maximum.*` intrinsic)
11656-
- fminimum: ``*ptr = minimum(*ptr, val)`` (match the `llvm.minimum.*` intrinsic)
11651+
- fmax: ``*ptr = maxnum(*ptr, val)`` (match the `llvm.maxnum.*`` intrinsic)
11652+
- fmin: ``*ptr = minnum(*ptr, val)`` (match the `llvm.minnum.*`` intrinsic)
1165711653
- uinc_wrap: ``*ptr = (*ptr u>= val) ? 0 : (*ptr + 1)`` (increment value with wraparound to zero when incremented above input value)
1165811654
- udec_wrap: ``*ptr = ((*ptr == 0) || (*ptr u> val)) ? val : (*ptr - 1)`` (decrement with wraparound to input value when decremented below zero).
1165911655
- usub_cond: ``*ptr = (*ptr u>= val) ? *ptr - val : *ptr`` (subtract only if no unsigned overflow).

llvm/docs/ReleaseNotes.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,6 @@ Changes to LLVM infrastructure
7272
themselves (i.e., the `TargetIntrinsicInfo` class).
7373
* Fix Microsoft demangling of string literals to be stricter
7474
(#GH129970))
75-
* Added the support for ``fmaximum`` and ``fminimum`` in ``atomicrmw`` instruction. The
76-
comparison is expected to match the behavior of ``llvm.maximum.*`` and
77-
``llvm.minimum.*`` respectively.
7875

7976
Changes to building LLVM
8077
------------------------

llvm/include/llvm-c/Core.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -393,12 +393,6 @@ typedef enum {
393393
LLVMAtomicRMWBinOpUSubCond, /**<Subtracts the value only if no unsigned
394394
overflow */
395395
LLVMAtomicRMWBinOpUSubSat, /**<Subtracts the value, clamping to zero */
396-
LLVMAtomicRMWBinOpFMaximum, /**< Sets the value if it's greater than the
397-
original using an floating point comparison and
398-
return the old one */
399-
LLVMAtomicRMWBinOpFMinimum, /**< Sets the value if it's smaller than the
400-
original using an floating point comparison and
401-
return the old one */
402396
} LLVMAtomicRMWBinOp;
403397

404398
typedef enum {

llvm/include/llvm/AsmParser/LLToken.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,6 @@ enum Kind {
276276
kw_umin,
277277
kw_fmax,
278278
kw_fmin,
279-
kw_fmaximum,
280-
kw_fminimum,
281279
kw_uinc_wrap,
282280
kw_udec_wrap,
283281
kw_usub_cond,

llvm/include/llvm/Bitcode/LLVMBitCodes.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -504,9 +504,7 @@ enum RMWOperations {
504504
RMW_UINC_WRAP = 15,
505505
RMW_UDEC_WRAP = 16,
506506
RMW_USUB_COND = 17,
507-
RMW_USUB_SAT = 18,
508-
RMW_FMAXIMUM = 19,
509-
RMW_FMINIMUM = 20,
507+
RMW_USUB_SAT = 18
510508
};
511509

512510
/// OverflowingBinaryOperatorOptionalFlags - Flags for serializing

llvm/include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1663,42 +1663,6 @@ class MachineIRBuilder {
16631663
const DstOp &OldValRes, const SrcOp &Addr, const SrcOp &Val,
16641664
MachineMemOperand &MMO);
16651665

1666-
/// Build and insert `OldValRes<def> = G_ATOMICRMW_FMAXIMUM Addr, Val, MMO`.
1667-
///
1668-
/// Atomically replace the value at \p Addr with the floating point maximum of
1669-
/// \p Val and the original value. Puts the original value from \p Addr in \p
1670-
/// OldValRes.
1671-
///
1672-
/// \pre setBasicBlock or setMI must have been called.
1673-
/// \pre \p OldValRes must be a generic virtual register.
1674-
/// \pre \p Addr must be a generic virtual register with pointer type.
1675-
/// \pre \p OldValRes, and \p Val must be generic virtual registers of the
1676-
/// same type.
1677-
///
1678-
/// \return a MachineInstrBuilder for the newly created instruction.
1679-
MachineInstrBuilder buildAtomicRMWFMaximum(const DstOp &OldValRes,
1680-
const SrcOp &Addr,
1681-
const SrcOp &Val,
1682-
MachineMemOperand &MMO);
1683-
1684-
/// Build and insert `OldValRes<def> = G_ATOMICRMW_FMINIMUM Addr, Val, MMO`.
1685-
///
1686-
/// Atomically replace the value at \p Addr with the floating point minimum of
1687-
/// \p Val and the original value. Puts the original value from \p Addr in \p
1688-
/// OldValRes.
1689-
///
1690-
/// \pre setBasicBlock or setMI must have been called.
1691-
/// \pre \p OldValRes must be a generic virtual register.
1692-
/// \pre \p Addr must be a generic virtual register with pointer type.
1693-
/// \pre \p OldValRes, and \p Val must be generic virtual registers of the
1694-
/// same type.
1695-
///
1696-
/// \return a MachineInstrBuilder for the newly created instruction.
1697-
MachineInstrBuilder buildAtomicRMWFMinimum(const DstOp &OldValRes,
1698-
const SrcOp &Addr,
1699-
const SrcOp &Val,
1700-
MachineMemOperand &MMO);
1701-
17021666
/// Build and insert `OldValRes<def> = G_ATOMICRMW_USUB_COND Addr, Val, MMO`.
17031667
///
17041668
/// Atomically replace the value at \p Addr with the original value minus \p

llvm/include/llvm/CodeGen/ISDOpcodes.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1376,8 +1376,6 @@ enum NodeType {
13761376
ATOMIC_LOAD_FSUB,
13771377
ATOMIC_LOAD_FMAX,
13781378
ATOMIC_LOAD_FMIN,
1379-
ATOMIC_LOAD_FMAXIMUM,
1380-
ATOMIC_LOAD_FMINIMUM,
13811379
ATOMIC_LOAD_UINC_WRAP,
13821380
ATOMIC_LOAD_UDEC_WRAP,
13831381
ATOMIC_LOAD_USUB_COND,

llvm/include/llvm/CodeGen/SelectionDAGNodes.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1517,8 +1517,6 @@ class MemSDNode : public SDNode {
15171517
case ISD::ATOMIC_LOAD_FSUB:
15181518
case ISD::ATOMIC_LOAD_FMAX:
15191519
case ISD::ATOMIC_LOAD_FMIN:
1520-
case ISD::ATOMIC_LOAD_FMAXIMUM:
1521-
case ISD::ATOMIC_LOAD_FMINIMUM:
15221520
case ISD::ATOMIC_LOAD_UINC_WRAP:
15231521
case ISD::ATOMIC_LOAD_UDEC_WRAP:
15241522
case ISD::ATOMIC_LOAD_USUB_COND:
@@ -1605,8 +1603,6 @@ class AtomicSDNode : public MemSDNode {
16051603
N->getOpcode() == ISD::ATOMIC_LOAD_FSUB ||
16061604
N->getOpcode() == ISD::ATOMIC_LOAD_FMAX ||
16071605
N->getOpcode() == ISD::ATOMIC_LOAD_FMIN ||
1608-
N->getOpcode() == ISD::ATOMIC_LOAD_FMAXIMUM ||
1609-
N->getOpcode() == ISD::ATOMIC_LOAD_FMINIMUM ||
16101606
N->getOpcode() == ISD::ATOMIC_LOAD_UINC_WRAP ||
16111607
N->getOpcode() == ISD::ATOMIC_LOAD_UDEC_WRAP ||
16121608
N->getOpcode() == ISD::ATOMIC_LOAD_USUB_COND ||

llvm/include/llvm/IR/Instructions.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -751,14 +751,6 @@ class AtomicRMWInst : public Instruction {
751751
/// \p minnum matches the behavior of \p llvm.minnum.*.
752752
FMin,
753753

754-
/// *p = maximum(old, v)
755-
/// \p maximum matches the behavior of \p llvm.maximum.*.
756-
FMaximum,
757-
758-
/// *p = minimum(old, v)
759-
/// \p minimum matches the behavior of \p llvm.minimum.*.
760-
FMinimum,
761-
762754
/// Increment one up to a maximum value.
763755
/// *p = (old u>= v) ? 0 : (old + 1)
764756
UIncWrap,
@@ -820,8 +812,6 @@ class AtomicRMWInst : public Instruction {
820812
case AtomicRMWInst::FSub:
821813
case AtomicRMWInst::FMax:
822814
case AtomicRMWInst::FMin:
823-
case AtomicRMWInst::FMaximum:
824-
case AtomicRMWInst::FMinimum:
825815
return true;
826816
default:
827817
return false;

0 commit comments

Comments
 (0)