File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -232,6 +232,12 @@ struct Vacuum : public WalkerPass<PostWalker<Vacuum>> {
232232 replaceCurrent (child);
233233 return ;
234234 }
235+ // if the condition is unreachable, just return it
236+ if (curr->condition ->type == unreachable) {
237+ replaceCurrent (curr->condition );
238+ return ;
239+ }
240+ // from here on, we can assume the condition executed
235241 if (curr->ifFalse ) {
236242 if (curr->ifFalse ->is <Nop>()) {
237243 curr->ifFalse = nullptr ;
Original file line number Diff line number Diff line change 273273 )
274274 )
275275 )
276+ (func $unreachable-if-with-nop-arm-that-leaves-a-concrete-value-if-nop-is-removed (type $0)
277+ (block $label$0
278+ (loop $label$1
279+ (br_if $label$0
280+ (i32.load8_s
281+ (i32.const 1634541608)
282+ )
283+ (loop $label$9
284+ (br $label$9)
285+ )
286+ )
287+ )
288+ )
289+ )
276290)
Original file line number Diff line number Diff line change 593593 )
594594 )
595595 )
596+ (func $unreachable-if-with-nop-arm-that-leaves-a-concrete-value-if-nop-is-removed
597+ (block $label$0
598+ (loop $label$1
599+ (if
600+ (br_if $label$0
601+ (i32.load8_s
602+ (i32.const 1634541608 )
603+ )
604+ (loop $label$9
605+ (br $label$9 )
606+ )
607+ )
608+ (nop )
609+ (i32.const 1920103026 )
610+ )
611+ )
612+ )
613+ )
596614)
You can’t perform that action at this time.
0 commit comments