File tree Expand file tree Collapse file tree
cranelift/codegen/src/opts Expand file tree Collapse file tree Original file line number Diff line number Diff line change 120120(rule (truthy (rotr _ x _)) x)
121121(rule (truthy (select _ x (iconst _ (u64_from_imm64 (u64_nonzero _))) (iconst _ (u64_from_imm64 0)))) x)
122122(rule (truthy (ne _ x (iconst _ (u64_from_imm64 0)))) x)
123+ (rule (truthy (ne _ (iconst _ (u64_from_imm64 0)) x)) x)
123124
124125;; All of these expressions don't care about their input as long as it is truthy.
125126;; so we can remove expressions that preserve that property from the input.
126127(rule (simplify (bmask ty v)) (if-let x (truthy v)) (bmask ty x))
127128(rule (simplify (select ty v lhs rhs)) (if-let c (truthy v)) (select ty c lhs rhs))
128129(rule (simplify (ne ty v zero @ (iconst _ (u64_from_imm64 0)))) (if-let c (truthy v)) (ne ty c zero))
130+ (rule (simplify (ne ty zero @ (iconst _ (u64_from_imm64 0)) v)) (if-let c (truthy v)) (ne ty c zero))
129131
130132
131133;; (sextend (bmask x)) can be replaced with (bmask x) since bmask
You can’t perform that action at this time.
0 commit comments