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>();
72 auto &
TM = TPC.getTM<RISCVTargetMachine>();
73 ST = &
TM.getSubtarget<RISCVSubtarget>(
F);
75 if (skipFunction(
F) || !
ST->hasStdExtZacas())
78 bool MadeChange =
false;
90char RISCVZacasABIFix::
ID = 0;
93 return new RISCVZacasABIFix();
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static bool runOnFunction(Function &F, bool PostInlining)
#define INITIALIZE_PASS_DEPENDENCY(depName)
#define INITIALIZE_PASS_END(passName, arg, name, cfg, analysis)
#define INITIALIZE_PASS_BEGIN(passName, arg, name, cfg, analysis)
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()
LLVM_ABI 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.
Base class for instruction visitors.
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...
IRBuilder(LLVMContext &, FolderTy, InserterTy, MDNode *, ArrayRef< OperandBundleDef >) -> IRBuilder< FolderTy, InserterTy >
FunctionPass * createRISCVZacasABIFixPass()