28#define DEBUG_TYPE "riscv-zacas-abi-fix"
29#define PASS_NAME "RISC-V Zacas ABI fix"
61 assert(
ST->hasStdExtZacas() &&
"only necessary to run in presence of zacas");
63 if (
I.getFailureOrdering() != AtomicOrdering::SequentiallyConsistent)
66 Builder.CreateFence(AtomicOrdering::SequentiallyConsistent);
70bool RISCVZacasABIFix::runOnFunction(
Function &
F) {
71 auto &TPC = getAnalysis<TargetPassConfig>();
75 if (skipFunction(
F) || !
ST->hasStdExtZacas())
78 bool MadeChange =
false;
90char RISCVZacasABIFix::
ID = 0;
93 return new RISCVZacasABIFix();
#define INITIALIZE_PASS_DEPENDENCY(depName)
#define INITIALIZE_PASS_END(passName, arg, name, cfg, analysis)
#define INITIALIZE_PASS_BEGIN(passName, arg, name, cfg, analysis)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
void visit(MachineFunction &MF, MachineBasicBlock &Start, std::function< void(MachineBasicBlock *)> op)
This file defines the 'Statistic' class, which is designed to be an easy way to expose various metric...
Target-Independent Code Generator Pass Configuration Options pass.
Represent the analysis usage information of a pass.
AnalysisUsage & addRequired()
void setPreservesCFG()
This function should be called by the pass, iff they do not:
An instruction that atomically checks whether a specified value is in a memory location,...
FunctionPass class - This class is used to implement most global optimizations.
virtual bool runOnFunction(Function &F)=0
runOnFunction - Virtual method overriden by subclasses to do the per-function processing of the pass.
This provides a uniform API for creating instructions and inserting them into a basic block: either a...
Base class for instruction visitors.
RetTy visitAtomicCmpXchgInst(AtomicCmpXchgInst &I)
void visitInstruction(Instruction &I)
virtual void getAnalysisUsage(AnalysisUsage &) const
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
virtual StringRef getPassName() const
getPassName - Return a nice clean name for a pass.
StringRef - Represent a constant reference to a string, i.e.
Target-Independent Code Generator Pass Configuration Options.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
This is an optimization pass for GlobalISel generic memory operations.
iterator_range< early_inc_iterator_impl< detail::IterOfRange< RangeT > > > make_early_inc_range(RangeT &&Range)
Make a range that does early increment to allow mutation of the underlying range without disrupting i...
FunctionPass * createRISCVZacasABIFixPass()