diff --git a/enzyme/Enzyme/JLInstSimplify.cpp b/enzyme/Enzyme/JLInstSimplify.cpp index 4df7ca2d3ec..18e8b386d31 100644 --- a/enzyme/Enzyme/JLInstSimplify.cpp +++ b/enzyme/Enzyme/JLInstSimplify.cpp @@ -224,8 +224,9 @@ bool jlInstSimplify(llvm::Function &F, TargetLibraryInfo &TLI, } auto llhs = dyn_cast(lhs); auto lrhs = dyn_cast(rhs); - if (llhs && lrhs && isa(llhs->getType()) && - isa(lrhs->getType())) { + if (llhs && lrhs && + (isa(llhs->getType()) || isa(llhs->getType())) && + (isa(lrhs->getType()) || isa(lrhs->getType()))) { auto lhsv = getBaseObject(llhs->getOperand(0), /*offsetAllowed*/ false); auto rhsv =