combine ISD::SETCC by custom routine

hi,

i have a backend that want to do custom combine on SETCC nodes.

but some time SETCC was combined into BR_CC before i can visit it to
do my own combine, because DAGCombiner always do its own combine
before custom combine. so, is there anyway to prevent it being
combined without changing the logic of DAGCombiner?

thank you very much

--ether

If BR_CC isn't legal on your target, you shouldn't end up with any in
the DAG. Otherwise, no, there isn't any way, but I don't see the
difficulty in making your custom combine work on both SETCC and BR_CC.

-Eli

hi Eli,

thanks for reply :slight_smile:

i am currently decompose the BR_CC node to a target SETCC node and a
target BRCOND node, but since BR_CC node sometimes is combine from a
BRCOND node and SETCC node, so i just wondering if theres any better
way :slight_smile:

regards
--ether

If your target doesn't need BR_CC, just mark it as "Expand" and the
DAGCombiner will avoid generating them; it looks something like the
following:

  setOperationAction(ISD::BR_CC, MVT::Other, Expand);

-Eli