Remove an unnecessary switch from GenTree:TryGetUse#127632
Remove an unnecessary switch from GenTree:TryGetUse#127632tannergooding merged 2 commits intodotnet:mainfrom
Conversation
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
There was a problem hiding this comment.
Pull request overview
This PR refactors GenTree::TryGetUse to avoid a large opcode switch by leveraging existing operator classification helpers (OperIsLeaf, OperIsSpecial, unary/binary handling). As part of enabling that simplification, it reclassifies the ARM64 GT_SELECT_{INC,INV,NEG} nodes to be true conditional/special nodes.
Changes:
- Reclassify ARM64
GT_SELECT_{INC,INV,NEG}asGenTreeConditional/GTK_SPECIAL(instead of binaryGenTreeOp). - Add an instance
GenTree::OperIsSpecial()convenience helper ingentree.h. - Rewrite
GenTree::TryGetUseto use leaf/special classification and a unified unary/binary path; remove theTryGetUseBinOphelper.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/coreclr/jit/gtlist.h | Changes GT_SELECT_{INC,INV,NEG} node flavor/kind to be conditional/special. |
| src/coreclr/jit/gentree.h | Adds instance OperIsSpecial(); removes now-unneeded TryGetUseBinOp declaration. |
| src/coreclr/jit/gentree.cpp | Simplifies GenTree::TryGetUse logic and eliminates the dedicated binop helper. |
|
CC. @dotnet/jit-contrib, @EgorBo, @kg for review. Just a simple PR that cleans up I found that some of the Provides a small TP increase as well, more so on LLVM than MSVC: |
No description provided.