diff --git a/llvm/lib/Target/AMDGPU/AMDGPUSplitModule.cpp b/llvm/lib/Target/AMDGPU/AMDGPUSplitModule.cpp index 5d7aff1c5092c..6f1c45d92c8cb 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPUSplitModule.cpp +++ b/llvm/lib/Target/AMDGPU/AMDGPUSplitModule.cpp @@ -1100,10 +1100,10 @@ void RecursiveSearchSplitting::pickPartition(unsigned Depth, unsigned Idx, if (Entry.CostExcludingGraphEntryPoints > LargeClusterThreshold) { // Check if the amount of code in common makes it worth it. assert(SimilarDepsCost && Entry.CostExcludingGraphEntryPoints); - const double Ratio = - SimilarDepsCost / Entry.CostExcludingGraphEntryPoints; + const double Ratio = static_cast(SimilarDepsCost) / + Entry.CostExcludingGraphEntryPoints; assert(Ratio >= 0.0 && Ratio <= 1.0); - if (LargeFnOverlapForMerge > Ratio) { + if (Ratio > LargeFnOverlapForMerge) { // For debug, just print "L", so we'll see "L3=P3" for instance, which // will mean we reached max depth and chose P3 based on this // heuristic.