Skip to content
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

Add a pass to normalize address spaces before lowering to standard ops. #834

Merged
merged 2 commits into from
Dec 7, 2023
Merged
Changes from all commits
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
5 changes: 3 additions & 2 deletions python/compiler/aiecc/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@
import rich.progress as progress
import re

aie_opt_passes = ['--aie-normalize-address-spaces',
'--canonicalize',
aie_opt_passes = ['--canonicalize',
'--cse',
'--convert-vector-to-llvm',
'--expand-strided-metadata',
Expand Down Expand Up @@ -208,6 +207,7 @@ async def process_core(self, core):
if(not opts.unified):
file_core = self.tmpcorefile(core, "mlir")
await self.do_call(task, ['aie-opt', '--aie-localize-locks',
'--aie-normalize-address-spaces',
'--aie-standard-lowering=tilecol=%d tilerow=%d' % core[0:2],
'--aiex-standard-lowering',
self.file_with_addresses, '-o', file_core])
Expand Down Expand Up @@ -694,6 +694,7 @@ async def run_flow(self):
if(opts.unified):
self.file_opt_with_addresses = os.path.join(self.tmpdirname, 'input_opt_with_addresses.mlir')
await self.do_call(progress_bar.task, ['aie-opt', '--aie-localize-locks',
'--aie-normalize-address-spaces',
Copy link
Collaborator

@stephenneuendorffer stephenneuendorffer Dec 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this get removed from aie-opt-passes?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but it was suggested that this has to run before conversion to standard based on an error with handle address space 2

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, After your patch, I went back and actually processed what Jeff had indicated.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't make sense to me to run this pass twice... so I factored it out of aie_opt_passes

'--aie-standard-lowering',
'--aiex-standard-lowering',
*aie_opt_passes,
Expand Down