https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125907

Hongtao Liu <liuhongt at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |liuhongt at gcc dot gnu.org

--- Comment #2 from Hongtao Liu <liuhongt at gcc dot gnu.org> ---
we already have splitter for cmov + bt
;; Help combine recognize bt followed by cmov
(define_split
  [(set (match_operand:SWI248 0 "register_operand")
        (if_then_else:SWI248
         (match_operator 5 "bt_comparison_operator"
          [(zero_extract:SWI48
            (match_operand:SWI48 1 "nonimmediate_operand")
            (const_int 1)
            (match_operand:QI 2 "register_operand"))
           (const_int 0)])
         (match_operand:SWI248 3 "nonimmediate_operand")
         (match_operand:SWI248 4 "nonimmediate_operand")))]
  "TARGET_USE_BT && TARGET_CMOVE
   && !(MEM_P (operands[3]) && MEM_P (operands[4]))
   && ix86_pre_reload_split ()"
  [(set (reg:CCC FLAGS_REG)
        (compare:CCC
         (const_int 0)
         (zero_extract:SWI48 (match_dup 1) (const_int 1) (match_dup 2))))
   (set (match_dup 0)
        (if_then_else:SWI248 (ltu (reg:CCC FLAGS_REG) (const_int 0))
                             (match_dup 3)
                             (match_dup 4)))]
{
  if (GET_CODE (operands[5]) == EQ)
    std::swap (operands[3], operands[4]);
})


But it only accepts nonimmediate_operand, but here for the testcase in the PR,
it's const_int 0

Failed to match this instruction:
(set (reg:SI 99 [ <retval> ])
    (if_then_else:SI (ne (and:SI (reg:SI 103 [ _1 ])
                (const_int 1 [0x1]))
            (const_int 0 [0]))
        (reg:SI 107 [ c ])
        (const_int 0 [0])))

Reply via email to