- Notifications
You must be signed in to change notification settings - Fork 15.3k
Closed
Description
https://alive2.llvm.org/ce/z/mr3yq_
define i32 @src(i8 range(i8 0, 6) %arg) { switch i8 %arg, label %else [ i8 0, label %if i8 4, label %if i8 5, label %if ] if: ret i32 0 else: ret i32 1 } define i32 @tgt(i8 %arg) { %add = add i8 %arg, -1 %cmp2 = icmp ult i8 %add, 3 br i1 %cmp2, label %else, label %if if: ret i32 0 else: ret i32 1 }The known range here allows us to express the switch condition as a wrapping range check.