[all-commits] [llvm/llvm-project] 2328ca: [X86] Prevent LowerSELECT from causing suboptimal ...

topperc via All-commits all-commits at lists.llvm.org
Mon Jun 8 11:47:59 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 2328cab16ccd8f17fee782c29fb844662c089fbb
      https://github.com/llvm/llvm-project/commit/2328cab16ccd8f17fee782c29fb844662c089fbb
  Author: Craig Topper <craig.topper at intel.com>
  Date:   2020-06-08 (Mon, 08 Jun 2020)

  Changed paths:
    M llvm/lib/Target/X86/X86ISelLowering.cpp
    M llvm/test/CodeGen/X86/dagcombine-select.ll

  Log Message:
  -----------
  [X86] Prevent LowerSELECT from causing suboptimal codegen for __builtin_ffs(X) - 1.

LowerSELECT sees the CMP with 0 and wants to use a trick with SUB
and SBB. But we can use the flags from the BSF/TZCNT.

Fixes PR46203.

Differential Revision: https://reviews.llvm.org/D81312




More information about the All-commits mailing list