44#include "llvm/ADT/Statistic.h"
45#include "llvm/IR/Constants.h"
46#include "llvm/IR/InstrTypes.h"
47#include "llvm/IR/Instruction.h"
48#include "llvm/IR/Instructions.h"
49#include "llvm/IR/LLVMContext.h"
50#include "llvm/IR/InstIterator.h"
65#define DEBUG_TYPE "break-constgeps"
91 if (
CE->getOpcode() == Instruction::GetElementPtr)
116 if (Instruction::isBinaryOp(
CE->getOpcode()) || Instruction::isUnaryOp(
CE->getOpcode()))
167 if (
CE->getOpcode() == Instruction::GetElementPtr)
192 std::vector<Instruction* >
Worklist;
198 for (Function::iterator
BB = (*F).begin();
BB != (*F).end(); ++
BB)
200 for (BasicBlock::iterator
i =
BB->begin();
i !=
BB->end(); ++
i)
238 if (
PHINode * PHI = SVFUtil::dyn_cast<PHINode>(I))
256 if ((PHI->getIncomingBlock (
i2)) == PHI->getIncomingBlock (
index))
static Instruction * convertExpression(ConstantExpr *CE, Instruction *InsertPt)
static ConstantExpr * hasConstantExpr(Value *V)
STATISTIC(GEPChanges, "Number of Converted GEP Constant Expressions")
static ConstantExpr * hasConstantBinaryOrUnaryOp(Value *V)
static ConstantExpr * hasConstantGEP(Value *V)
virtual bool runOnModule(Module &M)
llvm::Instruction Instruction
llvm::Value Value
LLVM Basic classes.
llvm::ConstantExpr ConstantExpr
llvm::IRBuilder IRBuilder