Files
Alessandro Di Federico a65ccc3413 Introduce ValueMaterializer
`ValueMaterializer` is a rewrite of what was called `AdvancedValueInfo`
which follows the same principles.

The main benefits over the old version is:

* We materialize the data-flow graph and the CFG of the relevant part of
  root. This makes debugging significantly easier.
* We drop the old MonotoneFramework infrastructure in favor of
  getMaximalFixedPoint.
* We significantly reduce the amount of queries we make to
  AdvancedValueInfo.
2023-06-30 13:39:22 +02:00

29 lines
618 B
C++

#pragma once
//
// This file is distributed under the MIT License. See LICENSE.md for details.
//
#include "llvm/IR/Instructions.h"
#include "revng/Support/Debug.h"
#include "revng/Support/IRHelpers.h"
namespace llvm {
class APInt;
}
inline Logger<> ValueMaterializerLogger("value-materializer");
std::string aviFormatter(const llvm::APInt &Value);
inline bool isPhiLike(llvm::Value *V) {
return (llvm::isa<llvm::PHINode>(V) or llvm::isa<llvm::SelectInst>(V));
}
inline bool isMemory(llvm::Value *V) {
using namespace llvm;
V = skipCasts(V);
return not(isa<GlobalVariable>(V) or isa<AllocaInst>(V));
}