Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmoses committed Jan 9, 2024
1 parent e536b82 commit fe1ed67
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions enzyme/Enzyme/FunctionUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3029,8 +3029,7 @@ std::optional<std::string> fixSparse_inner(Instruction *cur, llvm::Function &F,
}

// mul (mul a, const1), const2 -> mul a, (mul const1, const2)
if (cur->getOpcode() == Instruction::FMul | cur->getOpcode() == Instruction::Mul)
if (cur->isFast())
if ((cur->getOpcode() == Instruction::FMul && cur->isFast()) || cur->getOpcode() == Instruction::Mul)
for (auto i1 = 0; i1 < 2; i1++)
if (auto mul1 = dyn_cast<Instruction>(cur->getOperand(i1)))
if (((mul1->getOpcode() == Instruction::FMul && mul1->isFast())) || mul1->getOpcode() == Instruction::FMul)
Expand Down Expand Up @@ -5907,9 +5906,13 @@ void fixSparseIndices(llvm::Function &F, llvm::FunctionAnalysisManager &FAM,
}
}
}
EmitFailure("NoSparsification", I->getDebugLoc(), I, " No sparsification: not sparse solvable(icmp): ", *sub1);
EmitFailure("NoSparsification", I->getDebugLoc(), I, " No sparsification: not sparse solvable(scev): ", *sub1);
legal = false;
return Constraints::all();
}
EmitFailure("NoSparsification", I->getDebugLoc(), I, " No sparsification: not sparse solvable(icmp): ", *sub1);
legal = false;
return Constraints::all();
}

// cmp x, 1.0 -> false/true
Expand Down

0 comments on commit fe1ed67

Please sign in to comment.