-
Notifications
You must be signed in to change notification settings - Fork 14.3k
SPIRV: Set NoPHIs property after rewriting them #136327
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
Conversation
@llvm/pr-subscribers-backend-spir-v Author: Matt Arsenault (arsenm) ChangesThere should be no PHIs after selection, as OpPhi is used Full diff: https://github.com/llvm/llvm-project/pull/136327.diff 1 Files Affected:
diff --git a/llvm/lib/Target/SPIRV/SPIRVTargetMachine.cpp b/llvm/lib/Target/SPIRV/SPIRVTargetMachine.cpp
index 68286737b972f..f30578767a939 100644
--- a/llvm/lib/Target/SPIRV/SPIRVTargetMachine.cpp
+++ b/llvm/lib/Target/SPIRV/SPIRVTargetMachine.cpp
@@ -269,6 +269,12 @@ class SPIRVInstructionSelect : public InstructionSelect {
return InstructionSelect::getRequiredProperties().reset(
MachineFunctionProperties::Property::RegBankSelected);
}
+
+ MachineFunctionProperties getClearedProperties() const override {
+ // No generic Phis remain, replaced with OpPhi
+ return InstructionSelect::getClearedProperties().reset(
+ MachineFunctionProperties::Property::NoPHIs);
+ }
};
} // namespace
|
The errors mentioned in PR #135277 still happen if we apply the patch here without 1293477:
|
@arsenm We currently do not select OpPhi during the instruction selection pass, instead we keep PHI until the module layout finalization stage (introduced as one of improvements in #119202 -- https://github.com/VyacheslavLevytskyy/llvm-project/blob/3e74d2c6983af986b70060ca44e6e1fbcb34a554/llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp#L3354-L3369). |
829c364
to
090b461
Compare
There should be no PHIs after selection, as OpPhi is used instead. This hopefully avoids errors in llvm#135277.
There should be no PHIs after selection, as OpPhi is used instead. This hopefully avoids errors in llvm#135277.
There should be no PHIs after selection, as OpPhi is used instead. This hopefully avoids errors in llvm#135277.
There should be no PHIs after selection, as OpPhi is used instead. This hopefully avoids errors in llvm#135277.
There should be no PHIs after selection, as OpPhi is used
instead. This hopefully avoids errors in #135277.