class LoadExpression final : public MemoryExpression {
private:
LoadInst *Load;
- MaybeAlign Alignment;
public:
LoadExpression(unsigned NumOperands, LoadInst *L,
LoadExpression(enum ExpressionType EType, unsigned NumOperands, LoadInst *L,
const MemoryAccess *MemoryLeader)
- : MemoryExpression(NumOperands, EType, MemoryLeader), Load(L) {
- if (L)
- Alignment = MaybeAlign(L->getAlignment());
- }
+ : MemoryExpression(NumOperands, EType, MemoryLeader), Load(L) {}
LoadExpression() = delete;
LoadExpression(const LoadExpression &) = delete;
LoadInst *getLoadInst() const { return Load; }
void setLoadInst(LoadInst *L) { Load = L; }
- MaybeAlign getAlignment() const { return Alignment; }
- void setAlignment(MaybeAlign Align) { Alignment = Align; }
-
bool equals(const Expression &Other) const override;
bool exactlyEquals(const Expression &Other) const override {
return Expression::exactlyEquals(Other) &&
// Give store and loads same opcode so they value number together.
E->setOpcode(0);
E->op_push_back(PointerOp);
- if (LI)
- E->setAlignment(MaybeAlign(LI->getAlignment()));
// TODO: Value number heap versions. We may be able to discover
// things alias analysis can't on it's own (IE that a store and a