mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-24 22:40:36 +00:00
[Alignment][NFC] MaybeAlign in GVNExpression
Summary: This is patch is part of a series to introduce an Alignment type. See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html See this patch for the introduction of the type: https://reviews.llvm.org/D64790 Reviewers: courbet Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D67922 llvm-svn: 373054
This commit is contained in:
parent
67cf4fb1cb
commit
7c8bc22ca6
@ -323,7 +323,7 @@ public:
|
||||
class LoadExpression final : public MemoryExpression {
|
||||
private:
|
||||
LoadInst *Load;
|
||||
unsigned Alignment;
|
||||
MaybeAlign Alignment;
|
||||
|
||||
public:
|
||||
LoadExpression(unsigned NumOperands, LoadInst *L,
|
||||
@ -333,7 +333,8 @@ public:
|
||||
LoadExpression(enum ExpressionType EType, unsigned NumOperands, LoadInst *L,
|
||||
const MemoryAccess *MemoryLeader)
|
||||
: MemoryExpression(NumOperands, EType, MemoryLeader), Load(L) {
|
||||
Alignment = L ? L->getAlignment() : 0;
|
||||
if (L)
|
||||
Alignment = MaybeAlign(L->getAlignment());
|
||||
}
|
||||
|
||||
LoadExpression() = delete;
|
||||
@ -348,8 +349,8 @@ public:
|
||||
LoadInst *getLoadInst() const { return Load; }
|
||||
void setLoadInst(LoadInst *L) { Load = L; }
|
||||
|
||||
unsigned getAlignment() const { return Alignment; }
|
||||
void setAlignment(unsigned Align) { Alignment = Align; }
|
||||
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 {
|
||||
|
@ -1332,7 +1332,7 @@ LoadExpression *NewGVN::createLoadExpression(Type *LoadType, Value *PointerOp,
|
||||
E->setOpcode(0);
|
||||
E->op_push_back(PointerOp);
|
||||
if (LI)
|
||||
E->setAlignment(LI->getAlignment());
|
||||
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user