Capture the ambient scope used in a secret.generic
For each value used in the body of a
secret.generic op, which is defined
in the ambient scope outside the
generic, add it to the argument list of
generic ops through their bodies.
generic ops whose region contains many ops into smaller
sequences of generic ops whose regions contain a single op, dropping the
generic part from any resulting
generic ops that have no
secret.secret inputs. If the op has associated regions, and the operands
are not secret, then the generic is distributed recursively through the
op’s regions as well.
This pass is intended to be used as part of a front-end pipeline, where a
program that operates on a secret type annotates the input to a region as
secret, and then wraps the contents of the region in a single large
secret.generic, then uses this pass to simplify it.
distribute-through option allows one to specify a comma-separated
list of op names (e.g.,
limits the distribution to only pass through those ops. If unset, all ops
are distributed through when possible.
-distribute-through : comma-separated list of ops that should be distributed through
Convert secret types to standard types
secret<...> type from the IR, replacing it with the contained
type and the corresponding cleartext computation.
Copy constants into a secret.generic body
For each constant value used in the body of a
secret.generic op, which is
defined in the ambient scope outside the
generic, add it’s definition into
Merge two adjacent generics into a single generic
This pass merges two immedaitely sequential generics into a single generic. Useful as a sub-operation in some passes, and extracted into its own pass for testing purposes.