-
Notifications
You must be signed in to change notification settings - Fork 14
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
[AIE2P] Optimize G_PHI regbankselect for fifo/acc #314
base: aie-public
Are you sure you want to change the base?
Conversation
|
||
# Test 3: The instruction %19:_(p0) = G_PHI %0(p0), %bb.0, %27(p0), %bb.1 | ||
# should not be mapped to accregbank. The result of the PHI node is used by an instruction | ||
# that is considered an `accululator-use instruction` but the considered result is just a scalar |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit accumulator
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, did I really write this? Good catch!
436679d
to
785ff92
Compare
bb.2: | ||
PseudoRET implicit $lr | ||
|
||
... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Maybe add a test where a PHI is used both as a PHI and an ACC. I think we will favour the FIFO mapping at this point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean by both FIFO and ACC? Yes, we should favor the FIFO because we check it first. I hope we will not face this situation, according to the benchmarks I saw, what do you think?
785ff92
to
407735d
Compare
@@ -966,6 +976,36 @@ AIE2PRegisterBankInfo::getInstrMapping(const MachineInstr &MI) const { | |||
} | |||
return AIEBaseRegisterBankInfo::getInstrMapping(MI); | |||
} | |||
case TargetOpcode::G_PHI: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a really special-case to handle. If we map to vector reg bank, we may block optimal SWP scheduling's after. This is also a special case because one single PHI node may contain inputs mapped to fifo, accumulator and vector bank at the same time. The way it is mapped is also different, we handle only the output and inputs are related the inputs.
Observation: this PR should include more tests after merging more fifo intrinsics.