[llvm] [Atomic][doc] Fix outdated hook name and description (PR #66989)

Wang Pengcheng via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 21 00:54:57 PDT 2023


https://github.com/wangpc-pp created https://github.com/llvm/llvm-project/pull/66989

`setInsertFencesForAtomic` is `shouldInsertFencesForAtomic` now.


>From 5209960ab598d87672dd850d574c2a80752c66e6 Mon Sep 17 00:00:00 2001
From: wangpc <wangpengcheng.pp at bytedance.com>
Date: Thu, 21 Sep 2023 15:47:33 +0800
Subject: [PATCH] [Atomic][doc] Fix outdated hook name and description

`setInsertFencesForAtomic` is `shouldInsertFencesForAtomic` now.
---
 llvm/docs/Atomics.rst                       | 2 +-
 llvm/lib/Target/XCore/XCoreISelLowering.cpp | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/llvm/docs/Atomics.rst b/llvm/docs/Atomics.rst
index f64a0aa89b77de3..6ad6e1812cb0a66 100644
--- a/llvm/docs/Atomics.rst
+++ b/llvm/docs/Atomics.rst
@@ -409,7 +409,7 @@ Atomics and Codegen
 Atomic operations are represented in the SelectionDAG with ``ATOMIC_*`` opcodes.
 On architectures which use barrier instructions for all atomic ordering (like
 ARM), appropriate fences can be emitted by the AtomicExpand Codegen pass if
-``setInsertFencesForAtomic()`` was used.
+``shouldInsertFencesForAtomic()`` returns true.
 
 The MachineMemOperand for all atomic operations is currently marked as volatile;
 this is not correct in the IR sense of volatile, but CodeGen handles anything
diff --git a/llvm/lib/Target/XCore/XCoreISelLowering.cpp b/llvm/lib/Target/XCore/XCoreISelLowering.cpp
index 34f2a0576e7c4e3..4604bcc14ee20df 100644
--- a/llvm/lib/Target/XCore/XCoreISelLowering.cpp
+++ b/llvm/lib/Target/XCore/XCoreISelLowering.cpp
@@ -936,7 +936,7 @@ LowerATOMIC_LOAD(SDValue Op, SelectionDAG &DAG) const {
   assert(N->getOpcode() == ISD::ATOMIC_LOAD && "Bad Atomic OP");
   assert((N->getSuccessOrdering() == AtomicOrdering::Unordered ||
           N->getSuccessOrdering() == AtomicOrdering::Monotonic) &&
-         "setInsertFencesForAtomic(true) expects unordered / monotonic");
+         "shouldInsertFencesForAtomic(true) expects unordered / monotonic");
   if (N->getMemoryVT() == MVT::i32) {
     if (N->getAlign() < Align(4))
       report_fatal_error("atomic load must be aligned");
@@ -967,7 +967,7 @@ LowerATOMIC_STORE(SDValue Op, SelectionDAG &DAG) const {
   assert(N->getOpcode() == ISD::ATOMIC_STORE && "Bad Atomic OP");
   assert((N->getSuccessOrdering() == AtomicOrdering::Unordered ||
           N->getSuccessOrdering() == AtomicOrdering::Monotonic) &&
-         "setInsertFencesForAtomic(true) expects unordered / monotonic");
+         "shouldInsertFencesForAtomic(true) expects unordered / monotonic");
   if (N->getMemoryVT() == MVT::i32) {
     if (N->getAlign() < Align(4))
       report_fatal_error("atomic store must be aligned");



More information about the llvm-commits mailing list