From 63505ad6b2d840c409bb92df460caed5cecf6447 Mon Sep 17 00:00:00 2001 From: Quinn Dawkins Date: Thu, 7 Dec 2023 13:08:17 -0500 Subject: [PATCH] [TorchToLinalg] Drop constexpr from ifs in argmin/max.dim (#2617) MSVC-19 does not support constexprs of lambda captured constexpr values like this: https://godbolt.org/z/ej65rMzdr Instead, this just drops the constexpr from the if statements. See the discussion in https://discord.com/channels/689900678990135345/1062405112292712499/1182338050664185999 --- lib/Conversion/TorchToLinalg/Reduction.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Conversion/TorchToLinalg/Reduction.cpp b/lib/Conversion/TorchToLinalg/Reduction.cpp index 80a77f66d..289851cd3 100644 --- a/lib/Conversion/TorchToLinalg/Reduction.cpp +++ b/lib/Conversion/TorchToLinalg/Reduction.cpp @@ -187,7 +187,7 @@ public: Value resultVal, predicate; if (inElementType.isa()) { arith::CmpFPredicate predType; - if constexpr (isMax) { + if (isMax) { predType = arith::CmpFPredicate::OGT; resultVal = rewriter.create( nestedLoc, newValue, oldValue); @@ -201,7 +201,7 @@ public: newValue, oldValue); } else { arith::CmpIPredicate predType; - if constexpr (isMax) { + if (isMax) { predType = arith::CmpIPredicate::sgt; resultVal = rewriter.create(nestedLoc, newValue, oldValue);