[llvm] 2e194fe - [SCEV] Still trying to fix windows buildbots

Sam Parker via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 24 02:29:51 PDT 2020


Author: Sam Parker
Date: 2020-08-24T10:26:48+01:00
New Revision: 2e194fe73b6fe639aaf1f71a3cd6bd7eeb894656

URL: https://github.com/llvm/llvm-project/commit/2e194fe73b6fe639aaf1f71a3cd6bd7eeb894656
DIFF: https://github.com/llvm/llvm-project/commit/2e194fe73b6fe639aaf1f71a3cd6bd7eeb894656.diff

LOG: [SCEV] Still trying to fix windows buildbots

Added: 
    

Modified: 
    llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h
    llvm/lib/Analysis/ScalarEvolution.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h b/llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h
index 41df158f5de7..0327dc1b9fb0 100644
--- a/llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h
+++ b/llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h
@@ -74,25 +74,23 @@ class Type;
   /// This is the base class for unary cast operator classes.
   class SCEVCastExpr : public SCEV {
   protected:
-    const SCEV *const Op;
+    std::array<const SCEV *, 1> Operands;
     Type *Ty;
 
     SCEVCastExpr(const FoldingSetNodeIDRef ID,
                  unsigned SCEVTy, const SCEV *op, Type *ty);
 
   public:
-    const SCEV *getOperand() const { return Op; }
+    const SCEV *getOperand() const { return Operands[0]; }
     const SCEV *getOperand(unsigned i) const {
       assert(i == 0 && "Operand index out of range!");
-      return Op;
+      return Operands[0];
     }
     using op_iterator = const SCEV *const *;
     using op_range = iterator_range<op_iterator>;
 
-    op_iterator op_begin() const { return &Op; }
-    op_iterator op_end() const { return &Op + 1; }
     op_range operands() const {
-      return make_range(op_begin(), op_end());
+      return make_range(Operands.begin(), Operands.end());
     }
     size_t getNumOperands() const { return 1; }
     Type *getType() const { return Ty; }

diff  --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp
index 75d2d39e7114..9c9b9c53c939 100644
--- a/llvm/lib/Analysis/ScalarEvolution.cpp
+++ b/llvm/lib/Analysis/ScalarEvolution.cpp
@@ -447,26 +447,28 @@ ScalarEvolution::getConstant(Type *Ty, uint64_t V, bool isSigned) {
 
 SCEVCastExpr::SCEVCastExpr(const FoldingSetNodeIDRef ID,
                            unsigned SCEVTy, const SCEV *op, Type *ty)
-  : SCEV(ID, SCEVTy, computeExpressionSize(op)), Op(op), Ty(ty) {}
+  : SCEV(ID, SCEVTy, computeExpressionSize(op)), Ty(ty) {
+    Operands[0] = op;
+}
 
 SCEVTruncateExpr::SCEVTruncateExpr(const FoldingSetNodeIDRef ID,
                                    const SCEV *op, Type *ty)
   : SCEVCastExpr(ID, scTruncate, op, ty) {
-  assert(Op->getType()->isIntOrPtrTy() && Ty->isIntOrPtrTy() &&
+  assert(getOperand()->getType()->isIntOrPtrTy() && Ty->isIntOrPtrTy() &&
          "Cannot truncate non-integer value!");
 }
 
 SCEVZeroExtendExpr::SCEVZeroExtendExpr(const FoldingSetNodeIDRef ID,
                                        const SCEV *op, Type *ty)
   : SCEVCastExpr(ID, scZeroExtend, op, ty) {
-  assert(Op->getType()->isIntOrPtrTy() && Ty->isIntOrPtrTy() &&
+  assert(getOperand()->getType()->isIntOrPtrTy() && Ty->isIntOrPtrTy() &&
          "Cannot zero extend non-integer value!");
 }
 
 SCEVSignExtendExpr::SCEVSignExtendExpr(const FoldingSetNodeIDRef ID,
                                        const SCEV *op, Type *ty)
   : SCEVCastExpr(ID, scSignExtend, op, ty) {
-  assert(Op->getType()->isIntOrPtrTy() && Ty->isIntOrPtrTy() &&
+  assert(getOperand()->getType()->isIntOrPtrTy() && Ty->isIntOrPtrTy() &&
          "Cannot sign extend non-integer value!");
 }
 


        


More information about the llvm-commits mailing list