[NewGVN] Remove alignment from LoadExpression (NFC)
authorNikita Popov <nikita.ppv@gmail.com>
Sat, 6 Jun 2020 09:49:20 +0000 (11:49 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Sat, 6 Jun 2020 09:49:20 +0000 (11:49 +0200)
The alignment is not actually used.

llvm/include/llvm/Transforms/Scalar/GVNExpression.h
llvm/lib/Transforms/Scalar/NewGVN.cpp

index 1600d1a..c4a0487 100644 (file)
@@ -323,7 +323,6 @@ public:
 class LoadExpression final : public MemoryExpression {
 private:
   LoadInst *Load;
-  MaybeAlign Alignment;
 
 public:
   LoadExpression(unsigned NumOperands, LoadInst *L,
@@ -332,10 +331,7 @@ public:
 
   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 @@ public:
   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) &&
index 348c717..576d40f 100644 (file)
@@ -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