[llvm] b999400 - [SCEV] Add operand methods to Cast and UDiv

Russell Gallop via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 24 02:00:17 PDT 2020


Hi Sam,

It looks like this is continuing to have build problems on Windows, even
after "e286c600e10d - [SCEV] Attempt to fix windows buildbots":
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/34251/steps/build-unified-tree/logs/stdio

Are you looking at this failure?

Thanks
Russ

On Mon, 24 Aug 2020 at 06:57, Sam Parker via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

>
> Author: Sam Parker
> Date: 2020-08-24T06:57:07+01:00
> New Revision: b999400a4fb645cab6d8abcb1ce9146775f69c64
>
> URL:
> https://github.com/llvm/llvm-project/commit/b999400a4fb645cab6d8abcb1ce9146775f69c64
> DIFF:
> https://github.com/llvm/llvm-project/commit/b999400a4fb645cab6d8abcb1ce9146775f69c64.diff
>
> LOG: [SCEV] Add operand methods to Cast and UDiv
>
> Add methods to access operands in a similar manner to NAryExpr.
>
> Differential Revision: https://reviews.llvm.org/D86083
>
> Added:
>
>
> Modified:
>     llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h
>
> Removed:
>
>
>
>
> ################################################################################
> diff  --git a/llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h
> b/llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h
> index 0076e02ae1bf..10fefa0272b1 100644
> --- a/llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h
> +++ b/llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h
> @@ -82,6 +82,16 @@ class Type;
>
>    public:
>      const SCEV *getOperand() const { return Op; }
> +    const SCEV *getOperand(unsigned i) const {
> +      assert(i == 0 && "Operand index out of range!");
> +      return Op;
> +    }
> +    using op_iterator = const SCEV *const *;
> +    using op_range = iterator_range<op_iterator>;
> +    op_range operands() const {
> +      return make_range(&Op, &Op + 1);
> +    }
> +    size_t getNumOperands() const { return 1; }
>      Type *getType() const { return Ty; }
>
>      /// Methods for support type inquiry through isa, cast, and dyn_cast:
> @@ -263,16 +273,28 @@ class Type;
>    class SCEVUDivExpr : public SCEV {
>      friend class ScalarEvolution;
>
> -    const SCEV *LHS;
> -    const SCEV *RHS;
> +    std::array<const SCEV*, 2> Operands;
>
>      SCEVUDivExpr(const FoldingSetNodeIDRef ID, const SCEV *lhs, const
> SCEV *rhs)
> -        : SCEV(ID, scUDivExpr, computeExpressionSize({lhs, rhs})),
> LHS(lhs),
> -          RHS(rhs) {}
> +        : SCEV(ID, scUDivExpr, computeExpressionSize({lhs, rhs})) {
> +        Operands[0] = lhs;
> +        Operands[1] = rhs;
> +      }
>
>    public:
> -    const SCEV *getLHS() const { return LHS; }
> -    const SCEV *getRHS() const { return RHS; }
> +    const SCEV *getLHS() const { return Operands[0]; }
> +    const SCEV *getRHS() const { return Operands[1]; }
> +    size_t getNumOperands() const { return 2; }
> +    const SCEV *getOperand(unsigned i) const {
> +      assert((i == 0 || i == 1) && "Operand index out of range!");
> +      return i == 0 ? getLHS() : getRHS();
> +    }
> +
> +    using op_iterator = const SCEV *const *;
> +    using op_range = iterator_range<op_iterator>;
> +    op_range operands() const {
> +      return make_range(Operands.begin(), Operands.end());
> +    }
>
>      Type *getType() const {
>        // In most cases the types of LHS and RHS will be the same, but in
> some
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200824/523f3f6d/attachment.html>


More information about the llvm-commits mailing list