getTag :: Tag -> CG IR.Tag
getTag tag = do
  tagMap <- gets _sTagMap
  case Bimap.lookup tag tagMap of
    Just t  -> pure t
    Nothing -> do
      let t = IR.Tag . fromIntegral $ Bimap.size tagMap
      modify' $ \s -> s {_sTagMap = Bimap.insert tag t tagMap}
      pure t
getTag :: Tag -> CG IR.Tag
getTag tag = do
  tagMap <- gets _sTagMap
  case Bimap.lookup tag tagMap of
    Just t  -> pure t
    Nothing -> do
      let t = IR.Tag . fromIntegral $ Bimap.size tagMap
      modify' $ \s -> s {_sTagMap = Bimap.insert tag t tagMap}
      pure t
getTag tag = do
  tagMap <- gets _sTagMap
  case Bimap.lookup tag tagMap of
    Just t  -> pure t
    Nothing -> do
      let t = IR.Tag . fromIntegral $ Bimap.size tagMap
      modify' $ \s -> s {_sTagMap = Bimap.insert tag t tagMap}
      pure t