Skip to content

Instantly share code, notes, and snippets.

@flaub
Created June 29, 2018 22:00
Show Gist options
  • Save flaub/d1cad41397fe3db4763cab6c4391fd57 to your computer and use it in GitHub Desktop.
Save flaub/d1cad41397fe3db4763cab6c4391fd57 to your computer and use it in GitHub Desktop.
Compiler passes
  • BindProgram
    • TypeCheck
      • ApplyDefines (pre-processor expansion)
      • foreach Input
        • Check Input is bound
        • Ensure shapes match
        • foreach Dim
          • Add/Lookup binding
      • foreach Op
        • Add const bindings
        • Handle 'simple_reduce()'
        • foreach Input
          • Ensure bound
      • Compute output type
      • Set output type
        • Contraction case
          • foreach TensorSpec
            • Evaluate IndexSpec
              • Evaluate dims
              • Evaluate polynomials
          • foreach Constraint
            • Evaluate Constraint
        • Elementwise case
          • assert_
          • cmp
          • gather
          • scatter
          • tuple
          • element
          • shape
          • reshape
          • prng_step
          • prng_state
          • as_
          • index
          • Constant propagation
          • Perform broadcast
          • Bind output
    • foreach output
      • Perform broadcast
    • OptimizeProgram
      • Determine first def
      • Eliminate duplicate defs
  • Compute UseDef
  • foreach Op
    • Handle Contraction
      • Compile FlatContraction
      • Unify compatible elementwise ops
      • Generate code
    • Handle special functions
      • Generate special code
    • Handle Elementwise
      • Construct FlatContraction
      • Unify compatible elementwise ops
      • Generate code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment