aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/AtomicExpandPass.cpp
diff options
context:
space:
mode:
authorAnshil Gandhi <Anshil.Gandhi@amd.com>2021-08-13 23:58:04 -0600
committerAnshil Gandhi <Anshil.Gandhi@amd.com>2021-08-13 23:58:04 -0600
commit29e11a1aa303cf81b81fdbab74fad4f31e5018d3 (patch)
tree3039e81b4bd9aa683a3799cd2ca1de065099d17f /llvm/lib/CodeGen/AtomicExpandPass.cpp
parentc4e5425aa579d21530ef1766d7144b38a347f247 (diff)
downloadllvm-29e11a1aa303cf81b81fdbab74fad4f31e5018d3.zip
llvm-29e11a1aa303cf81b81fdbab74fad4f31e5018d3.tar.gz
llvm-29e11a1aa303cf81b81fdbab74fad4f31e5018d3.tar.bz2
Revert "[Remarks] Emit optimization remarks for atomics generating CAS loop"
This reverts commit c4e5425aa579d21530ef1766d7144b38a347f247.
Diffstat (limited to 'llvm/lib/CodeGen/AtomicExpandPass.cpp')
-rw-r--r--llvm/lib/CodeGen/AtomicExpandPass.cpp23
1 files changed, 1 insertions, 22 deletions
diff --git a/llvm/lib/CodeGen/AtomicExpandPass.cpp b/llvm/lib/CodeGen/AtomicExpandPass.cpp
index 5b5458e..125a3be 100644
--- a/llvm/lib/CodeGen/AtomicExpandPass.cpp
+++ b/llvm/lib/CodeGen/AtomicExpandPass.cpp
@@ -17,7 +17,6 @@
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallVector.h"
-#include "llvm/Analysis/OptimizationRemarkEmitter.h"
#include "llvm/CodeGen/AtomicExpandUtils.h"
#include "llvm/CodeGen/RuntimeLibcalls.h"
#include "llvm/CodeGen/TargetLowering.h"
@@ -59,7 +58,6 @@ namespace {
class AtomicExpand: public FunctionPass {
const TargetLowering *TLI = nullptr;
- OptimizationRemarkEmitter *ORE;
public:
static char ID; // Pass identification, replacement for typeid
@@ -71,7 +69,6 @@ namespace {
bool runOnFunction(Function &F) override;
private:
- void getAnalysisUsage(AnalysisUsage &AU) const override;
bool bracketInstWithFences(Instruction *I, AtomicOrdering Order);
IntegerType *getCorrespondingIntegerType(Type *T, const DataLayout &DL);
LoadInst *convertAtomicLoadToIntegerType(LoadInst *LI);
@@ -168,16 +165,11 @@ static bool atomicSizeSupported(const TargetLowering *TLI, Inst *I) {
Size <= TLI->getMaxAtomicSizeInBitsSupported() / 8;
}
-void AtomicExpand::getAnalysisUsage(AnalysisUsage &AU) const {
- AU.addRequired<OptimizationRemarkEmitterWrapperPass>();
-}
-
bool AtomicExpand::runOnFunction(Function &F) {
auto *TPC = getAnalysisIfAvailable<TargetPassConfig>();
if (!TPC)
return false;
- ORE = &getAnalysis<OptimizationRemarkEmitterWrapperPass>().getORE();
auto &TM = TPC->getTM<TargetMachine>();
if (!TM.getSubtargetImpl(F)->enableAtomicExpand())
return false;
@@ -578,9 +570,7 @@ static Value *performAtomicOp(AtomicRMWInst::BinOp Op, IRBuilder<> &Builder,
}
bool AtomicExpand::tryExpandAtomicRMW(AtomicRMWInst *AI) {
- LLVMContext &Ctx = AI->getModule()->getContext();
- TargetLowering::AtomicExpansionKind Kind = TLI->shouldExpandAtomicRMWInIR(AI);
- switch (Kind) {
+ switch (TLI->shouldExpandAtomicRMWInIR(AI)) {
case TargetLoweringBase::AtomicExpansionKind::None:
return false;
case TargetLoweringBase::AtomicExpansionKind::LLSC: {
@@ -610,17 +600,6 @@ bool AtomicExpand::tryExpandAtomicRMW(AtomicRMWInst *AI) {
expandPartwordAtomicRMW(AI,
TargetLoweringBase::AtomicExpansionKind::CmpXChg);
} else {
- SmallVector<StringRef> SSNs;
- Ctx.getSyncScopeNames(SSNs);
- auto MemScope = SSNs[AI->getSyncScopeID()].empty()
- ? "system"
- : SSNs[AI->getSyncScopeID()];
- ORE->emit([&]() {
- return OptimizationRemark(DEBUG_TYPE, "Passed", AI->getFunction())
- << "A compare and swap loop was generated for an atomic "
- << AI->getOperationName(AI->getOperation()) << " operation at "
- << MemScope << " memory scope";
- });
expandAtomicRMWToCmpXchg(AI, createCmpXchgInstFun);
}
return true;