-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Check containment for op3 for ternary instruction #116229
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
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
@dotnet/jit-contrib @saucecontrol |
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.
Pull Request Overview
This PR updates the containment logic for op3 in a ternary instruction to correctly account for memory load operations on hardware intrinsics, addressing issue #111835.
- Added a new conditional branch to check if op3 is a contained GT_HWINTRINSIC memory load and use the proper address use builder.
- Retains the previous behavior for RMW and non-contained cases using BuildDelayFreeUses and BuildOperandUses respectively.
if (op3->OperIs(GT_HWINTRINSIC) && op3->AsHWIntrinsic()->OperIsMemoryLoad() && op3->isContained()) | ||
{ | ||
srcCount += BuildAddrUses(op3->AsHWIntrinsic()->Op(1), op3RegCandidates); |
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.
Consider caching the result of op3->AsHWIntrinsic() in a local variable to improve readability and potentially reduce redundant method calls. For example, store the cast result in a variable and then reuse it within the conditional block.
if (op3->OperIs(GT_HWINTRINSIC) && op3->AsHWIntrinsic()->OperIsMemoryLoad() && op3->isContained()) | |
{ | |
srcCount += BuildAddrUses(op3->AsHWIntrinsic()->Op(1), op3RegCandidates); | |
auto op3HWIntrinsic = op3->AsHWIntrinsic(); | |
if (op3->OperIs(GT_HWINTRINSIC) && op3HWIntrinsic->OperIsMemoryLoad() && op3->isContained()) | |
{ | |
srcCount += BuildAddrUses(op3HWIntrinsic->Op(1), op3RegCandidates); |
Copilot uses AI. Check for mistakes.
@dotnet/jit-contrib ping |
Fixes: #111835