From 810e95b8610ab3f83fdd0bde1ea29e8d7638aee2 Mon Sep 17 00:00:00 2001 From: Jacques Pienaar Date: Wed, 27 Mar 2019 11:36:36 -0700 Subject: [PATCH] Use dereference instead of implicit conversion for IndexedValue to Value*. Avoids ambiguous constructor error on some compilers. PiperOrigin-RevId: 240606838 --- mlir/include/mlir/EDSC/Helpers.h | 2 +- mlir/test/EDSC/builder-api-test.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mlir/include/mlir/EDSC/Helpers.h b/mlir/include/mlir/EDSC/Helpers.h index 8fc9072..5dfc959 100644 --- a/mlir/include/mlir/EDSC/Helpers.h +++ b/mlir/include/mlir/EDSC/Helpers.h @@ -157,7 +157,7 @@ template struct TemplatedIndexedValue { } /// Emits a `load` when converting to a Value*. - operator Value *() const { + Value *operator*(void)const { return Load(getBase(), {indices.begin(), indices.end()}).getValue(); } diff --git a/mlir/test/EDSC/builder-api-test.cpp b/mlir/test/EDSC/builder-api-test.cpp index 2306ac2..ec8ceb4 100644 --- a/mlir/test/EDSC/builder-api-test.cpp +++ b/mlir/test/EDSC/builder-api-test.cpp @@ -444,7 +444,7 @@ TEST_FUNC(select_op) { // Without it, one must force conversion to ValueHandle as such: // edsc::intrinsics::select( // i == zero, ValueHandle(A(zero, zero)), ValueHandle(ValueA(i, j))) - edsc::intrinsics::select(i == zero, A(zero, zero), A(i, j)) + edsc::intrinsics::select(i == zero, *A(zero, zero), *A(i, j)) }); // CHECK-LABEL: @select_op -- 2.7.4