From b1a25318186ca237058e638bc693812c468736bc Mon Sep 17 00:00:00 2001 From: "William S. Moses" Date: Sun, 29 Sep 2024 00:08:13 -0400 Subject: [PATCH] Fix subnull --- enzyme/Enzyme/GradientUtils.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/enzyme/Enzyme/GradientUtils.cpp b/enzyme/Enzyme/GradientUtils.cpp index 7f8cb482e4a..a6d39a28731 100644 --- a/enzyme/Enzyme/GradientUtils.cpp +++ b/enzyme/Enzyme/GradientUtils.cpp @@ -5743,10 +5743,11 @@ Value *GradientUtils::invertPointerM(Value *const oval, IRBuilder<> &BuilderM, Value *ivops[2] = {nullptr, nullptr}; for (int i = 0; i < 2; i++) { auto op = arg->getOperand(i); + bool subnull = nullShadow; if (!runtimeActivity && !isa(op)) { - + auto vd = TR.query(op); + if (!TR.anyFloat(op)) subnull = false; if (isConstantValue(op)) { - auto vd = TR.query(op); if (TR.anyPointer(op) && vd[{-1, -1}] != BaseType::Integer) { if (!isa(op) && !isa(op)) { std::string str; @@ -5764,7 +5765,7 @@ Value *GradientUtils::invertPointerM(Value *const oval, IRBuilder<> &BuilderM, } } if (!ivops[i]) { - ivops[i] = invertPointerM(op, bb, nullShadow); + ivops[i] = invertPointerM(op, bb, subnull); } }