[llvm] [X86] Avoid shl->mul lowbit-isolate fold when BMI1/BMI2 are available (PR #217776)

via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 21 10:20:18 PDT 2026


zero318 wrote:

> Are you saying that Subtarget.hasBMI2() will still return true for a target-cpu that doesn't have BMI2?

No, `Subtarget.hasBMI2()` will return false for those and that's the issue. But the only reason to check for BMI2 here is to use `SHLX` instead of `SHL` due to Intel having slow shifts by CL, which doesn't apply to AMD CPUs.

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


More information about the llvm-commits mailing list