Issue 123938
Summary [X86] Use X86ISD::BSF/BSR fall through operands to be used for general values
Labels backend:X86
Assignees
Reporter RKSimon
    Followup to #123623 which added a fall through operand to X86ISD::BSF/BSR nodes to handle 'src is zero' behavior on supported CPUs.

We can use the fall through for other cases than the bitwidth constant values which we currently handle.

There are a couple of gotchas to address:

- [ ] Must still be limited to CPUs that support fall through on BSF/BSR instructions
- [ ] The "REP BSF" -> TZCNT performance hack in X86MCInstLower::Lower will need adjusting to only work for undef / correct constants
- [ ] Additional tests (both for constant and variable fall through values) will be necessary as we can't guarantee that 32-bit BSR/BSF instructions correctly zero the upper 32-bits of a register
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to