-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
egraph opt rules: do
(icmp cc x x) == {0,1}
only for integer types. (…
…#5438) We could do these for vectors too, in theory, but for now let's fix the bug by applying the equivalence only for integer types. Fixes #5437.
- Loading branch information
Showing
2 changed files
with
51 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
test compile | ||
set use_egraphs=true | ||
target x86_64 | ||
target aarch64 | ||
target s390x | ||
|
||
function u0:0(i64 vmctx, i64) fast { | ||
gv0 = vmctx | ||
gv1 = load.i64 notrap aligned readonly gv0+8 | ||
gv2 = load.i64 notrap aligned gv1 | ||
sig0 = (i64 vmctx, i64) fast | ||
fn0 = colocated u0:2 sig0 | ||
jt0 = jump_table [block1] | ||
stack_limit = gv2 | ||
|
||
block0(v0: i64, v1: i64): | ||
@0019 v2 = vconst.i8x16 [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] | ||
@001b v3 = iconst.i32 0 | ||
@001d brz v3, block2 ; v3 = 0 | ||
@001d jump block3 | ||
|
||
block3: | ||
@001f trap unreachable | ||
|
||
block2: | ||
@0025 v4 = bitcast.i16x8 little v2 ; v2 = const0 | ||
@0025 v5 = bitcast.i16x8 little v2 ; v2 = const0 | ||
@0025 v6 = icmp ult v4, v5 | ||
@0027 v7 = bitcast.i32x4 little v6 | ||
@0027 v8 = vhigh_bits.i32 v7 | ||
@002a v9 = iconst.i32 0 | ||
@002c brnz v9, block1 ; v9 = 0 | ||
@002c jump block4 | ||
|
||
block4: | ||
@002e call fn0(v0, v0) | ||
@0030 br_table v8, block1, jt0 | ||
|
||
block1: | ||
@0036 return | ||
} |