Fix lone isplit, when the corresponding iconcat will be created later during legalization

This commit is contained in:
bjorn3
2019-06-29 17:17:02 +02:00
committed by Dan Gohman
parent 0d5b87038a
commit dce521fa1c
2 changed files with 26 additions and 2 deletions

View File

@@ -174,8 +174,8 @@ pub fn legalize_function(func: &mut ir::Function, cfg: &mut ControlFlowGraph, is
// Try legalizing `isplit` and `vsplit` instructions, which could not previously be legalized.
for inst in pending_splits {
//pos.goto_inst(inst);
//legalize_inst(inst, &mut pos, cfg, isa);
pos.goto_inst(inst);
legalize_inst(inst, &mut pos, cfg, isa);
}
// Now that we've lowered all br_tables, we don't need the jump tables anymore.

View File

@@ -0,0 +1,24 @@
test compile
target x86_64
function u0:0(i128) -> i64, i64 fast {
; check: ebb0(v4: i64 [%rdi], v5: i64 [%rsi], v8: i64 [%rbp]):
ebb0(v0: i128):
jump ebb2
ebb1:
; When this `isplit` is legalized, the bnot below is not yet legalized,
; so there isn't a corresponding `iconcat` yet. We should try legalization
; for this `isplit` again once all instrucions have been legalized.
v2, v3 = isplit.i128 v1
; return v6, v7
return v2, v3
ebb2:
; check: v6 = bnot.i64 v4
; check: v2 -> v6
; check: v7 = bnot.i64 v5
; check: v3 -> v7
v1 = bnot.i128 v0
jump ebb1
}