[llvm] [AMDGPU][llvm-split] Fix division by zero (PR #98888)

Pierre van Houtryve via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 15 04:48:46 PDT 2024


================
@@ -256,11 +256,12 @@ calculateFunctionCosts(SplitModuleLogger &SML, GetTTIFn GetTTI, Module &M,
   }
 
   CostType FnCost = (ModuleCost - KernelCost);
+  CostType ModuleCostOr1 = ModuleCost ? ModuleCost : 1;
----------------
Pierre-vh wrote:

Detecting this earlier than just early-retun the pass would be better but this works as a temporary fix.
The pass is going to be rewritten very soon anyway, I'll make sure this is handled in the rewrite.

https://github.com/llvm/llvm-project/pull/98888


More information about the llvm-commits mailing list