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 adjustPassManager to run target specific passes #283

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft

Conversation

vchuravy
Copy link
Collaborator

Both opt and clang call TM->adjustPassManager(PMB) to add the target specific passes,
like NVVMReflect to the pass list.

@maleadt
Copy link
Owner

maleadt commented Jan 26, 2022

Right, that's the functionality I talked about. The problem is that this function doesn't take a pass manager, but a pass manager builder, which we don't use in GPUCompiler. The implementations of adjustPassManager register extension points, which is currently unusable to us (until we reimplement Julia's optimization pipeline as a PMB).

@vchuravy vchuravy marked this pull request as draft February 9, 2022 22:50
@jpsamaroo
Copy link
Collaborator

If we just wanted to feed in a Module and get access to target-specific passes after standard Julia optimizations, would this work? I'm thinking we could run it pretty close to ASM emission, since for AMDGPU, there are a ton of optimizations we miss out on because they're only exposed through this interface. We'd probably want to have simplified as many Julia-isms as possible before running those target-specific passes anyway, under the assumption that our unoptimized IR looks pretty different from what C++ would generate.

@maleadt
Copy link
Owner

maleadt commented Feb 6, 2023

I don't think so, as many passes are intended to be run at specific points during optimization, e.g., https://github.com/JuliaGPU/llvm-metal/blob/355123f9415581fa1f5fabb0f7e7227bfbc9f43d/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp#L584-L596. Running those close to ASM emission probably isn't going to result in the behavior you want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants