-
-
Notifications
You must be signed in to change notification settings - Fork 30.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gh-106529: Make FOR_ITER a viable uop #112134
Changes from 9 commits
a08909d
4c2914b
053a0a2
b838435
b28effa
de8f199
5c5d8bd
36e9ada
def1830
ce19637
7096818
5852105
4ac68b3
95b1a01
4c72028
14aea56
88c1701
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Enable translating unspecialized ``FOR_ITER`` to Tier 2. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,7 +53,7 @@ | |
|
||
def makes_escaping_api_call(instr: parsing.InstDef) -> bool: | ||
if "CALL_INTRINSIC" in instr.name: | ||
return True; | ||
return True | ||
tkns = iter(instr.tokens) | ||
for tkn in tkns: | ||
if tkn.kind != lx.IDENTIFIER: | ||
|
@@ -79,6 +79,7 @@ def makes_escaping_api_call(instr: parsing.InstDef) -> bool: | |
return True | ||
return False | ||
|
||
|
||
@dataclasses.dataclass | ||
class InstructionFlags: | ||
"""Construct and manipulate instruction flags""" | ||
|
@@ -124,9 +125,7 @@ def fromInstruction(instr: parsing.InstDef) -> "InstructionFlags": | |
or variable_used(instr, "exception_unwind") | ||
or variable_used(instr, "resume_with_error") | ||
), | ||
HAS_ESCAPES_FLAG=( | ||
makes_escaping_api_call(instr) | ||
), | ||
HAS_ESCAPES_FLAG=makes_escaping_api_call(instr), | ||
) | ||
|
||
@staticmethod | ||
|
@@ -176,7 +175,7 @@ def variable_used_unspecialized(node: parsing.Node, name: str) -> bool: | |
tokens: list[lx.Token] = [] | ||
skipping = False | ||
for i, token in enumerate(node.tokens): | ||
if token.kind == "MACRO": | ||
if token.kind == "CMACRO": | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. NOTE: This fix resulted in |
||
text = "".join(token.text.split()) | ||
# TODO: Handle nested #if | ||
if text == "#if": | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No hacks, please 🙂
The code should look like this:
The trace generator can adjust the target, so it points after the
END_FOR
.