Skip to content

Commit 943f3e5

Browse files
committed
[X86] Remove x86-experimental-unordered-atomic-isel option and associated code
This option enables an experimental lowering for unordered atomics I worked on a few years back. It never reached production quality, and hasn't been worked on in years. So let's rip it out. This wasn't a crazy idea, but I hit some stumbling block which prevented me from pushing it across the finish line. From the look of 027aa27, that change description is probably a good summary. I don't remember the details any longer.
1 parent 74c00d4 commit 943f3e5

File tree

5 files changed

+207
-573
lines changed

5 files changed

+207
-573
lines changed

llvm/include/llvm/CodeGen/TargetLowering.h

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4715,25 +4715,6 @@ class TargetLowering : public TargetLoweringBase {
47154715
return Chain;
47164716
}
47174717

4718-
/// Should SelectionDAG lower an atomic store of the given kind as a normal
4719-
/// StoreSDNode (as opposed to an AtomicSDNode)? NOTE: The intention is to
4720-
/// eventually migrate all targets to the using StoreSDNodes, but porting is
4721-
/// being done target at a time.
4722-
virtual bool lowerAtomicStoreAsStoreSDNode(const StoreInst &SI) const {
4723-
assert(SI.isAtomic() && "violated precondition");
4724-
return false;
4725-
}
4726-
4727-
/// Should SelectionDAG lower an atomic load of the given kind as a normal
4728-
/// LoadSDNode (as opposed to an AtomicSDNode)? NOTE: The intention is to
4729-
/// eventually migrate all targets to the using LoadSDNodes, but porting is
4730-
/// being done target at a time.
4731-
virtual bool lowerAtomicLoadAsLoadSDNode(const LoadInst &LI) const {
4732-
assert(LI.isAtomic() && "violated precondition");
4733-
return false;
4734-
}
4735-
4736-
47374718
/// This callback is invoked by the type legalizer to legalize nodes with an
47384719
/// illegal operand type but legal result types. It replaces the
47394720
/// LowerOperation callback in the type Legalizer. The reason we can not do

llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4857,23 +4857,6 @@ void SelectionDAGBuilder::visitAtomicLoad(const LoadInst &I) {
48574857
InChain = TLI.prepareVolatileOrAtomicLoad(InChain, dl, DAG);
48584858

48594859
SDValue Ptr = getValue(I.getPointerOperand());
4860-
4861-
if (TLI.lowerAtomicLoadAsLoadSDNode(I)) {
4862-
// TODO: Once this is better exercised by tests, it should be merged with
4863-
// the normal path for loads to prevent future divergence.
4864-
SDValue L = DAG.getLoad(MemVT, dl, InChain, Ptr, MMO);
4865-
if (MemVT != VT)
4866-
L = DAG.getPtrExtOrTrunc(L, dl, VT);
4867-
4868-
setValue(&I, L);
4869-
SDValue OutChain = L.getValue(1);
4870-
if (!I.isUnordered())
4871-
DAG.setRoot(OutChain);
4872-
else
4873-
PendingLoads.push_back(OutChain);
4874-
return;
4875-
}
4876-
48774860
SDValue L = DAG.getAtomic(ISD::ATOMIC_LOAD, dl, MemVT, MemVT, InChain,
48784861
Ptr, MMO);
48794862

@@ -4913,14 +4896,6 @@ void SelectionDAGBuilder::visitAtomicStore(const StoreInst &I) {
49134896
Val = DAG.getPtrExtOrTrunc(Val, dl, MemVT);
49144897
SDValue Ptr = getValue(I.getPointerOperand());
49154898

4916-
if (TLI.lowerAtomicStoreAsStoreSDNode(I)) {
4917-
// TODO: Once this is better exercised by tests, it should be merged with
4918-
// the normal path for stores to prevent future divergence.
4919-
SDValue S = DAG.getStore(InChain, dl, Val, Ptr, MMO);
4920-
setValue(&I, S);
4921-
DAG.setRoot(S);
4922-
return;
4923-
}
49244899
SDValue OutChain =
49254900
DAG.getAtomic(ISD::ATOMIC_STORE, dl, MemVT, InChain, Val, Ptr, MMO);
49264901

llvm/lib/Target/X86/X86ISelLowering.cpp

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,6 @@ static cl::opt<bool> MulConstantOptimization(
8383
"SHIFT, LEA, etc."),
8484
cl::Hidden);
8585

86-
static cl::opt<bool> ExperimentalUnorderedISEL(
87-
"x86-experimental-unordered-atomic-isel", cl::init(false),
88-
cl::desc("Use LoadSDNode and StoreSDNode instead of "
89-
"AtomicSDNode for unordered atomic loads and "
90-
"stores respectively."),
91-
cl::Hidden);
92-
9386
X86TargetLowering::X86TargetLowering(const X86TargetMachine &TM,
9487
const X86Subtarget &STI)
9588
: TargetLowering(TM), Subtarget(STI) {
@@ -30598,18 +30591,6 @@ X86TargetLowering::lowerIdempotentRMWIntoFencedLoad(AtomicRMWInst *AI) const {
3059830591
return Loaded;
3059930592
}
3060030593

30601-
bool X86TargetLowering::lowerAtomicStoreAsStoreSDNode(const StoreInst &SI) const {
30602-
if (!SI.isUnordered())
30603-
return false;
30604-
return ExperimentalUnorderedISEL;
30605-
}
30606-
bool X86TargetLowering::lowerAtomicLoadAsLoadSDNode(const LoadInst &LI) const {
30607-
if (!LI.isUnordered())
30608-
return false;
30609-
return ExperimentalUnorderedISEL;
30610-
}
30611-
30612-
3061330594
/// Emit a locked operation on a stack location which does not change any
3061430595
/// memory location, but does involve a lock prefix. Location is chosen to be
3061530596
/// a) very likely accessed only by a single thread to minimize cache traffic,

llvm/lib/Target/X86/X86ISelLowering.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1753,9 +1753,6 @@ namespace llvm {
17531753
LoadInst *
17541754
lowerIdempotentRMWIntoFencedLoad(AtomicRMWInst *AI) const override;
17551755

1756-
bool lowerAtomicStoreAsStoreSDNode(const StoreInst &SI) const override;
1757-
bool lowerAtomicLoadAsLoadSDNode(const LoadInst &LI) const override;
1758-
17591756
bool needsCmpXchgNb(Type *MemType) const;
17601757

17611758
void SetupEntryBlockForSjLj(MachineInstr &MI, MachineBasicBlock *MBB,

0 commit comments

Comments
 (0)