cranelift-codegen 0.112.2

Low-level code generator library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
;; Rewrites for `select_spectre_guard`. Check these rules carefully! This
;; instruction prohibits all speculation on the controlling value when
;; determining which input to use as the result. Rewrites must respect that
;; requirement.

;; If we statically know which value will be the result, it's safe to just use
;; that value. No speculation on the controlling value is possible if we simply
;; don't depend on that value at all.
(rule (simplify (select_spectre_guard _ _ x x))
      (subsume x))
(rule (simplify (select_spectre_guard _ (iconst_u _ (u64_nonzero _)) x _))
      (subsume x))
(rule (simplify (select_spectre_guard _ (iconst_u _ 0) _ y))
      (subsume y))