[PATCH] D76434: [SCEV] Query expanded immediate cost at minsize
Roman Lebedev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 10 01:01:04 PDT 2020
lebedev.ri added inline comments.
================
Comment at: llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp:2192-2193
+ unsigned Opcode;
+ size_t MinIdx;
+ size_t MaxIdx;
+ };
----------------
samparker wrote:
> lebedev.ri wrote:
> > `SCEVOperand::OperandIdx` is `int`
> But when we enumerate the SCEV operands, the index is size_t and the types need to be compatible for std::max and min.
```
int MinIdx = std::max((int)SCEVOp.index(), CostOp.MinIdx);
int OpIdx = std::min(MinIdx, CostOp.MaxIdx);
```
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D76434/new/
https://reviews.llvm.org/D76434
More information about the llvm-commits
mailing list