[PATCH] D125504: [AArch64] Add `foldCSELOfCSEl` DAG combine

NAKAMURA Takumi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 19 16:22:22 PDT 2022


chapuni added a comment.

I was investigating this.

  (CSEL l r EQ (CMP (CSEL x y cc2 cond) x)) => (CSEL l r cc2 cond)

Could it be said as "Reduction of `(CMP(CSEL))`, regardless of outer `CSEL`"?

  // Where x and y are constants

I am dubious prerequisites. Is it sufficient?

  cc = ((cc2 ? x : y) == x)

This can be transformed to;

  cc = (cc2 || y == x)

I am afraid if correlation between x and y would be missed.
I think such a transformation may be applied to `(CMP(CSEL(CMP)))`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D125504



More information about the llvm-commits mailing list