mirror of
https://github.com/mii443/wasmer.git
synced 2025-08-24 17:29:26 +00:00
NFC. Don't re-lookup frame. It can't have changed, simply reorder operations.
This commit is contained in:
@ -1609,14 +1609,13 @@ impl<'ctx, 'a> LLVMFunctionCodeGenerator<'ctx, 'a> {
|
||||
let current_block = self.builder.get_insert_block().ok_or_else(|| {
|
||||
CompileError::Codegen("not currently in a block".to_string())
|
||||
})?;
|
||||
self.builder.build_unconditional_branch(*frame.code_after());
|
||||
|
||||
for phi in frame.phis().to_vec().iter().rev() {
|
||||
let (value, info) = self.state.pop1_extra()?;
|
||||
let value = self.apply_pending_canonicalization(value, info);
|
||||
phi.add_incoming(&[(&value, current_block)])
|
||||
}
|
||||
let frame = self.state.frame_at_depth(0)?;
|
||||
self.builder.build_unconditional_branch(*frame.code_after());
|
||||
}
|
||||
|
||||
let (if_else_block, if_else_state) = if let ControlFrame::IfElse {
|
||||
@ -1701,15 +1700,13 @@ impl<'ctx, 'a> LLVMFunctionCodeGenerator<'ctx, 'a> {
|
||||
.ok_or_else(|| CompileError::Codegen("not currently in a block".to_string()))?;
|
||||
|
||||
let frame = self.state.outermost_frame()?;
|
||||
self.builder.build_unconditional_branch(*frame.br_dest());
|
||||
for phi in frame.phis().to_vec().iter().rev() {
|
||||
let (arg, info) = self.state.pop1_extra()?;
|
||||
let arg = self.apply_pending_canonicalization(arg, info);
|
||||
phi.add_incoming(&[(&arg, current_block)]);
|
||||
}
|
||||
|
||||
let frame = self.state.outermost_frame()?;
|
||||
self.builder.build_unconditional_branch(*frame.br_dest());
|
||||
|
||||
self.state.reachable = false;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user