Skip to content

Commit

Permalink
use upstream function
Browse files Browse the repository at this point in the history
  • Loading branch information
newling committed Jan 24, 2025
1 parent 8919799 commit 504ca1a
Showing 1 changed file with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,9 @@ using namespace mlir;
using namespace mlir::iree_compiler::AMDAIE;

SmallVector<int64_t> fromOpFoldResults(SmallVector<OpFoldResult> ofrs) {
SmallVector<int64_t> vals;
for (auto ofr : ofrs) {
auto asInt = getConstantIntValue(ofr);
if (asInt.has_value())
vals.push_back(asInt.value());
else
assert(false && "expected integer");
}
return vals;
std::optional<SmallVector<int64_t>> vals = getConstantIntValues(ofrs);
assert(vals.has_value() && "expected constant values");
return vals.value();
}

//===----------------------------------------------------------------------===//
Expand Down

0 comments on commit 504ca1a

Please sign in to comment.