Skip to content

Commit

Permalink
codegen-opt: fix stack alignment
Browse files Browse the repository at this point in the history
previously, stack-alignment of, for example, a 12-byte
allocation would be computed to be 16-bytes during codegen
(because of gc-alignment rounding up),
but 8-bytes here (because of this code rounding down)
  • Loading branch information
vtjnash committed Sep 26, 2017
1 parent 674e64b commit cafcd7c
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/llvm-alloc-opt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -715,10 +715,7 @@ bool AllocOpt::runOnFunction(Function &F)
sz += align;
}
else if (sz > 1) {
align = JL_SMALL_BYTE_ALIGNMENT;
while (sz < align) {
align = align / 2;
}
align = llvm::MinAlign(JL_SMALL_BYTE_ALIGNMENT, llvm::NextPowerOf2(sz));
}
// No debug info for prolog instructions
IRBuilder<> prolog_builder(&entry.front());
Expand Down

0 comments on commit cafcd7c

Please sign in to comment.