From 504ca1afbdaab30439c35effbb17edeec9106164 Mon Sep 17 00:00:00 2001 From: James Newling Date: Fri, 24 Jan 2025 13:33:28 -0800 Subject: [PATCH] use upstream function --- .../Transforms/test/AMDAIEDmaUtilsTest.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/compiler/plugins/target/AMD-AIE/iree-amd-aie/Transforms/test/AMDAIEDmaUtilsTest.cpp b/compiler/plugins/target/AMD-AIE/iree-amd-aie/Transforms/test/AMDAIEDmaUtilsTest.cpp index dd873647a..c0ffbcd00 100644 --- a/compiler/plugins/target/AMD-AIE/iree-amd-aie/Transforms/test/AMDAIEDmaUtilsTest.cpp +++ b/compiler/plugins/target/AMD-AIE/iree-amd-aie/Transforms/test/AMDAIEDmaUtilsTest.cpp @@ -16,15 +16,9 @@ using namespace mlir; using namespace mlir::iree_compiler::AMDAIE; SmallVector fromOpFoldResults(SmallVector ofrs) { - SmallVector 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> vals = getConstantIntValues(ofrs); + assert(vals.has_value() && "expected constant values"); + return vals.value(); } //===----------------------------------------------------------------------===//