[dynamo 3.11] support new jump opcodes (#93986)

Pull Request resolved: https://github.com/pytorch/pytorch/pull/93986
Approved by: https://github.com/jansel, https://github.com/albanD, https://github.com/malfet, https://github.com/voznesenskym
This commit is contained in:
William Wen
2023-02-14 00:43:41 +00:00
committed by PyTorch MergeBot
parent 3faa636196
commit d4d13d99e4
5 changed files with 223 additions and 23 deletions

View File

@ -16,6 +16,7 @@ if sys.version_info >= (3, 11):
else:
TERMINAL_OPCODES.add(dis.opmap["JUMP_ABSOLUTE"])
JUMP_OPCODES = set(dis.hasjrel + dis.hasjabs)
JUMP_OPNAMES = {dis.opname[opcode] for opcode in JUMP_OPCODES}
HASLOCAL = set(dis.haslocal)
HASFREE = set(dis.hasfree)