[llvm] ff1210e - [NewGVN] Remove alignment from LoadExpression (NFC)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Sat Jun 6 02:50:48 PDT 2020
Author: Nikita Popov
Date: 2020-06-06T11:49:20+02:00
New Revision: ff1210edb69ea6e073b9037ad3ecef399e11a1f9
URL: https://github.com/llvm/llvm-project/commit/ff1210edb69ea6e073b9037ad3ecef399e11a1f9
DIFF: https://github.com/llvm/llvm-project/commit/ff1210edb69ea6e073b9037ad3ecef399e11a1f9.diff
LOG: [NewGVN] Remove alignment from LoadExpression (NFC)
The alignment is not actually used.
Added:
Modified:
llvm/include/llvm/Transforms/Scalar/GVNExpression.h
llvm/lib/Transforms/Scalar/NewGVN.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/Transforms/Scalar/GVNExpression.h b/llvm/include/llvm/Transforms/Scalar/GVNExpression.h
index 1600d1af3242..c4a04877a1ff 100644
--- a/llvm/include/llvm/Transforms/Scalar/GVNExpression.h
+++ b/llvm/include/llvm/Transforms/Scalar/GVNExpression.h
@@ -323,7 +323,6 @@ class CallExpression final : public MemoryExpression {
class LoadExpression final : public MemoryExpression {
private:
LoadInst *Load;
- MaybeAlign Alignment;
public:
LoadExpression(unsigned NumOperands, LoadInst *L,
@@ -332,10 +331,7 @@ class LoadExpression final : public MemoryExpression {
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;
@@ -349,9 +345,6 @@ class LoadExpression final : public MemoryExpression {
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) &&
diff --git a/llvm/lib/Transforms/Scalar/NewGVN.cpp b/llvm/lib/Transforms/Scalar/NewGVN.cpp
index 348c717ca84a..576d40f0e0ff 100644
--- a/llvm/lib/Transforms/Scalar/NewGVN.cpp
+++ b/llvm/lib/Transforms/Scalar/NewGVN.cpp
@@ -1336,8 +1336,6 @@ LoadExpression *NewGVN::createLoadExpression(Type *LoadType, Value *PointerOp,
// 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
More information about the llvm-commits
mailing list