Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
merge main
Signed-off-by: Manjusaka <[email protected]>
  • Loading branch information
Zheaoli committed Jan 6, 2026
commit a439ed5bcc7ab8091e6cc7b46d5e12c8245f263c
274 changes: 138 additions & 136 deletions Include/internal/pycore_uop_ids.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions Include/internal/pycore_uop_metadata.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions Lib/test/test_capi/test_opt.py
Original file line number Diff line number Diff line change
Expand Up @@ -2952,6 +2952,25 @@ def f(n):
self.assertLessEqual(count_ops(ex, "_POP_TOP"), 3)
self.assertIn("_POP_TOP_NOP", uops)
Comment thread
Zheaoli marked this conversation as resolved.

def test_to_bool_always_true(self):
def testfunc(n):
class A:
pass

a = A()
for _ in range(n):
if not a:
return 0
return 1

res, ex = self._run_with_optimizer(testfunc, TIER2_THRESHOLD)
self.assertEqual(res, 1)
self.assertIsNotNone(ex)
uops = get_opnames(ex)
self.assertNotIn("_REPLACE_WITH_TRUE", uops)
self.assertIn("_INSERT_1_LOAD_CONST_INLINE_BORROW", uops)
self.assertEqual(count_ops(ex, "_POP_TOP_NOP"), 1)

def test_attr_promotion_failure(self):
# We're not testing for any specific uops here, just
# testing it doesn't crash.
Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.