24 return SubExpr::create(re->
index, base->
index) == offset;
44 offset = AddExpr::create(offset, strideExpr);
50 offset = AddExpr::create(offset, strideExpr);
54 return cast<ReadExpr>(e.
get());
65 !isa<ConstantExpr>(base->
index)) {
66 for (
const auto *un = base->
updates.
head.get(); un; un = un->next.get()) {
67 if (!isa<ConstantExpr>(un->index) || !isa<ConstantExpr>(un->value)) {
100 for (
const auto *un = re.
updates.
head.get(); un; un = un->next.get()) {
101 if (!isa<ConstantExpr>(un->index) || !isa<ConstantExpr>(un->value)) {
139 !isa<ConstantExpr>(re.
index)) {
175 if (isa<ConstantExpr>(e.getKid(0)))
177 else if (isa<ConstantExpr>(e.getKid(0)))
199 if (!isa<ConstantExpr>(re.
index)) {
206 bool hasConcreteValues =
false;
207 for (
const auto *un = re.
updates.
head.get(); un; un = un->next.get()) {
209 if (!isa<ConstantExpr>(un->index)) {
212 }
else if (!isa<ConstantExpr>(un->value)) {
217 isa<ConstantExpr>(un->value)) {
220 hasConcreteValues =
true;
226 if (hasConcreteValues)
236 reads.push_back(&re);
237 readInfo.emplace(&re, std::make_pair(hash, width));
static bool isReadExprAtOffset(ref< Expr > e, const ReadExpr *base, ref< Expr > offset)
static ReadExpr * hasOrderedReads(const ConcatExpr &ce)
std::map< const ReadExpr *, std::pair< ref< Expr >, Expr::Width > > & readInfo
Action visitConcat(const ConcatExpr &) override
Action inspectRead(ref< Expr > hash, Expr::Width width, const ReadExpr &)
std::vector< const ReadExpr * > & reads
Action visitRead(const ReadExpr &) override
Action visitConcat(const ConcatExpr &) override
Action visitRead(const ReadExpr &re) override
ExprHashMap< ref< Expr > > optimized
bool isConstantArray() const
bool isSymbolicArray() const
ref< Expr > getKid(unsigned i) const
Action visitConcat(const ConcatExpr &) override
Action visitRead(const ReadExpr &) override
std::unordered_set< unsigned > addedIndexes
static ref< ConstantExpr > create(uint64_t v, Width w)
static ref< ConstantExpr > alloc(const llvm::APInt &v)
static Action changeTo(const ref< Expr > &expr)
static Action doChildren()
static Action skipChildren()
ref< Expr > visit(const ref< Expr > &e)
static const Width InvalidWidth
virtual Kind getKind() const =0
virtual unsigned hash() const
Returns the pre-computed hash of the current expression.
virtual Width getWidth() const =0
unsigned Width
The type of an expression is simply its width, in bits.
virtual ref< Expr > getKid(unsigned i) const =0
Action visitRead(const ReadExpr &) override
Action visitURem(const URemExpr &) override
Action visitOr(const OrExpr &) override
Action visitSRem(const SRemExpr &) override
Class representing a one byte read from an array.
ref< UpdateNode > head
pointer to the most recent update node