code: def test_invalid_if():
      cond = relay.var("cond", dtype="bool", shape=())
      shared = relay.var("shared")
      true_branch = shared
      false_branch = relay.add(shared, shared)
      body = relay.If(cond, true_branch, false_branch)
      """
      The program below violates basic block normal form, as the scope of %shared
      is ambiguous and should not be in that of true branch.
  
      free_var %cond: bool
      if (%cond) {
        free_var %shared
        %shared
      } else {
        add(%shared, %shared)
      }
      """
      check_basic_block_normal_form(body)
  
file_path: tvm/tests/python/relay/test_analysis_basic_block_normal_form.py
imports: import pytest
  import tvm
  from tvm import relay
  from tvm.relay.analysis import check_basic_block_normal_form
label_desc: Use image node_id 3 for calling a global function with example usage: test_invalid_if() without return types