From abe881d565c30cb28c950a83a6311eebf9d4da1d Mon Sep 17 00:00:00 2001 From: Nicolas Vasilache Date: Thu, 28 Mar 2019 15:12:18 -0700 Subject: [PATCH] NFC - Handle IndexedValue corner case Implicit conversion don't play nicely in expressions such as: `C() = A(i) * B(i)`. Make `C()` return an IndexedValue instead of casting to ValueHandle. This prevents double capture errors and is useful for the tutorial. PiperOrigin-RevId: 240863223 --- mlir/include/mlir/EDSC/Helpers.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mlir/include/mlir/EDSC/Helpers.h b/mlir/include/mlir/EDSC/Helpers.h index c0aa0fe..41d8dd8 100644 --- a/mlir/include/mlir/EDSC/Helpers.h +++ b/mlir/include/mlir/EDSC/Helpers.h @@ -121,7 +121,7 @@ template struct TemplatedIndexedValue { TemplatedIndexedValue(const TemplatedIndexedValue &rhs) = default; - ValueHandle operator()() { return ValueHandle(*this); } + TemplatedIndexedValue operator()() { return *this; } /// Returns a new `TemplatedIndexedValue`. TemplatedIndexedValue operator()(ValueHandle index) { TemplatedIndexedValue res(base); -- 2.7.4