summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ir/cost.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ir/cost.h b/src/ir/cost.h
index 7c18a8200..0463d3310 100644
--- a/src/ir/cost.h
+++ b/src/ir/cost.h
@@ -253,7 +253,7 @@ struct CostAnalyzer : public OverriddenVisitor<CostAnalyzer, CostType> {
case DivUInt32:
case RemSInt32:
case RemUInt32:
- ret = 3;
+ ret = curr->right->is<Const>() ? 2 : 3;
break;
case AndInt32:
case OrInt32:
@@ -274,7 +274,7 @@ struct CostAnalyzer : public OverriddenVisitor<CostAnalyzer, CostType> {
case DivUInt64:
case RemSInt64:
case RemUInt64:
- ret = 3;
+ ret = curr->right->is<Const>() ? 3 : 4;
break;
case AndInt64:
case OrInt64: