Switch member calls to isa/dyn_cast/cast/... to free function calls. (#89356)

This change cleans up call sites. Next step is to mark the member
functions deprecated.

See https://mlir.llvm.org/deprecation and
https://discourse.llvm.org/t/preferred-casting-style-going-forward.
This commit is contained in:
Christian Sigg
2024-04-19 15:58:27 +02:00
committed by GitHub
parent ce2f6423f0
commit a5757c5b65
80 changed files with 240 additions and 264 deletions

View File

@@ -476,8 +476,8 @@ private:
if (!sel)
return std::nullopt;
auto tVal = sel.getTrueValue().dyn_cast<BlockArgument>();
auto fVal = sel.getFalseValue().dyn_cast<BlockArgument>();
auto tVal = dyn_cast<BlockArgument>(sel.getTrueValue());
auto fVal = dyn_cast<BlockArgument>(sel.getFalseValue());
// TODO: For simplicity, we only handle cases where both true/false value
// are directly loaded the input tensor. We can probably admit more cases
// in theory.
@@ -487,7 +487,7 @@ private:
// Helper lambda to determine whether the value is loaded from a dense input
// or is a loop invariant.
auto isValFromDenseInputOrInvariant = [&op](Value v) -> bool {
if (auto bArg = v.dyn_cast<BlockArgument>();
if (auto bArg = dyn_cast<BlockArgument>(v);
bArg && !isSparseTensor(op.getDpsInputOperand(bArg.getArgNumber())))
return true;
// If the value is defined outside the loop, it is a loop invariant.