[llvm] [RISCVISel] Compute leading zeros for RISCVISD::VCPOP_VL node (PR #127705)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 18 14:18:52 PST 2025


================
@@ -100,7 +100,6 @@ define zeroext i1 @vreduce_or_v2i1(<2 x i1> %v) {
 ; CHECK:       # %bb.0:
 ; CHECK-NEXT:    vsetivli zero, 2, e8, mf8, ta, ma
 ; CHECK-NEXT:    vcpop.m a0, v0
----------------
topperc wrote:

The population count here is 0, 1, or 2. The return value must be 0 or 1. It's not legal to remove the snez since that would allow 2 to be returned.

https://github.com/llvm/llvm-project/pull/127705


More information about the llvm-commits mailing list