[PATCH] D152430: [DAG] Peek through freeze when deciding whether we should convert setcc to math or not.

Amaury SECHET via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 9 06:02:17 PDT 2023


deadalnix added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:12251
   // =>
   //   FREEZE(SETCC(X, CONST, Cond))
   // This is correct if FREEZE(X) has one use and SETCC(FREEZE(X), CONST, Cond)
----------------
RKSimon wrote:
> Is this fold the underlying problem? Every other freeze fold we have tries to push the freeze upward through the DAG, but this pulling it down?
I'm not sure it is the underlying problem, but it is indeed part of the loop.

The underlying problem is that we want to combine setcc to math, unless the setcc is used in a brcond. The math is turned back into a setcc by the brcond in that case, which created an infinite loop and this is why `PreferSetCC` was introduced in the first place.

As to pushing the freeze up or down, I don't really have an opinion on the matter.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D152430/new/

https://reviews.llvm.org/D152430



More information about the llvm-commits mailing list