File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed
filetests/filetests/egraph Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change 47
47
(if-let d (u64_checked_div k1 k2))
48
48
(iconst ty (imm64_masked ty d)))
49
49
50
+ (rule (simplify_skeleton
51
+ (urem (iconst_u ty k1)
52
+ (iconst_u ty k2)))
53
+ (if-let d (u64_checked_rem k1 k2))
54
+ (iconst ty (imm64_masked ty d)))
55
+
50
56
(rule (simplify
51
57
(bor (fits_in_64 ty)
52
58
(iconst ty (u64_from_imm64 k1))
Original file line number Diff line number Diff line change @@ -95,6 +95,21 @@ block0:
95
95
; return v18 ; v18 = 1
96
96
; }
97
97
98
+ function %cprop_urem() -> i32 {
99
+ block0:
100
+ v0 = iconst.i32 13
101
+ v1 = iconst.i32 7
102
+ v2 = urem v0, v1
103
+ return v2
104
+ }
105
+
106
+ ; function %cprop_urem() -> i32 fast {
107
+ ; block0:
108
+ ; v37 = iconst.i32 6
109
+ ; v2 -> v37
110
+ ; return v37 ; v37 = 6
111
+ ; }
112
+
98
113
function %cprop_sdiv() -> i32 {
99
114
block0:
100
115
v0 = iconst.i32 -7
You can’t perform that action at this time.
0 commit comments