Skip to content

[Strings] Add a string-builtins feature, and lift/lower automatically when enabled #7601

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

Open
wants to merge 26 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

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
fix unit test
  • Loading branch information
kripken committed May 19, 2025
commit 123b8795a4e8a36db515cc7ec23bad111e2f723d
4 changes: 2 additions & 2 deletions test/unit/test_passes.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ def test_string_builtins(self):
# only do each once even if there are multiple -O2 operations.
passes = self.get_passes_run(['-O2', '-O2', '-all'])
self.assertEqual(passes.count('string-lifting'), 1)
self.assertEqual(passes.count('string-lowering'), 1)
self.assertEqual(passes.count('string-lowering-magic-imports'), 1)

# Other passes appear twice, when -O2 is repeated
self.assertEqual(passes.count('directize'), 2)

# Without the feature, we do not lift or lower.
passes = self.get_passes_run(['-O2', '-O2', '-all', '--disable-string-builtins'])
self.assertEqual(passes.count('string-lifting'), 0)
self.assertEqual(passes.count('string-lowering'), 0)
self.assertEqual(passes.count('string-lowering-magic-imports'), 0)
Loading