Skip to content

Commit

Permalink
inline: Round word-size cost estimates up
Browse files Browse the repository at this point in the history
  • Loading branch information
tmiasko committed Jan 15, 2021
1 parent 18ec4a9 commit a65c050
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/rustc_mir/src/transform/inline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ impl Inliner<'tcx> {
// Cost of the var is the size in machine-words, if we know
// it.
if let Some(size) = type_size_of(tcx, self.param_env, ty) {
cost += (size / ptr_size) as usize;
cost += ((size + ptr_size - 1) / ptr_size) as usize;
} else {
cost += UNKNOWN_SIZE_COST;
}
Expand Down

0 comments on commit a65c050

Please sign in to comment.