llvm-project
8e93deb4 - [RISCV][GISel] Make G_CTLZ legal with XTHeadBb (#237510)

Commit
11 days ago
[RISCV][GISel] Make G_CTLZ legal with XTHeadBb (#237510) XTHeadBb provides `th.ff1` and matches `G_CTLZ` semantics. The existing pattern `PatGpr<ctlz, TH_FF1>` is already imported by GlobalISel, but the legalizer always lowered `G_CTLZ` when Zbb was not available, so `th.ff1` was never selected. Part of https://github.com/llvm/llvm-project/issues/237492. I plan to address the whole problem with 3 patches to control patch size and ease review process: 1. This commit 2. Use the zero-poison semantics of `G_CTLZ_ZERO_POISON` for narrower widths. 3. Widen narrow `G_CTTZ` to XLEN before lowering.
Author
Parents
Loading