codeGenM :: Exp -> CG (AbstractProgram, SharingMapping)
codeGenM e = do
  HPT.codeGenM e
  shReg <- newReg
  sharingCodeGen shReg e
  (prg, hptMapping) <- HPT.mkAbstractProgramM
  let mapping = SharingMapping
        { _shRegName  = shReg
        , _hptMapping = hptMapping
        }
  pure (prg, mapping)
codeGenM :: Exp -> CG (AbstractProgram, SharingMapping)
codeGenM e = do
  HPT.codeGenM e
  shReg <- newReg
  sharingCodeGen shReg e
  (prg, hptMapping) <- HPT.mkAbstractProgramM
  let mapping = SharingMapping
        { _shRegName  = shReg
        , _hptMapping = hptMapping
        }
  pure (prg, mapping)
codeGenM e = do
  HPT.codeGenM e
  shReg <- newReg
  sharingCodeGen shReg e
  (prg, hptMapping) <- HPT.mkAbstractProgramM
  let mapping = SharingMapping
        { _shRegName  = shReg
        , _hptMapping = hptMapping
        }
  pure (prg, mapping)