#include "BPF.h"
#include "BPFCORE.h"
#include "BPFTargetMachine.h"
#include "llvm/IR/Instruction.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/IntrinsicsBPF.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/PatternMatch.h"
#include "llvm/IR/Type.h"
#include "llvm/IR/User.h"
#include "llvm/IR/Value.h"
#include "llvm/Pass.h"
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
#define DEBUG_TYPE …
usingnamespacellvm;
usingnamespacellvm::PatternMatch;
static cl::opt<bool>
DisableBPFserializeICMP("bpf-disable-serialize-icmp", cl::Hidden,
cl::desc("BPF: Disable Serializing ICMP insns."),
cl::init(false));
static cl::opt<bool> DisableBPFavoidSpeculation(
"bpf-disable-avoid-speculation", cl::Hidden,
cl::desc("BPF: Disable Avoiding Speculative Code Motion."),
cl::init(false));
namespace {
class BPFAdjustOptImpl { … };
}
bool BPFAdjustOptImpl::run() { … }
bool BPFAdjustOptImpl::adjustICmpToBuiltin() { … }
bool BPFAdjustOptImpl::insertPassThrough() { … }
bool BPFAdjustOptImpl::serializeICMPInBB(Instruction &I) { … }
bool BPFAdjustOptImpl::serializeICMPCrossBB(BasicBlock &BB) { … }
bool BPFAdjustOptImpl::avoidSpeculation(Instruction &I) { … }
void BPFAdjustOptImpl::adjustBasicBlock(BasicBlock &BB) { … }
void BPFAdjustOptImpl::adjustInst(Instruction &I) { … }
PreservedAnalyses BPFAdjustOptPass::run(Module &M, ModuleAnalysisManager &AM) { … }