[PATCH] D144534: [DAGCombine] Fold SETCC_OEQ(x, Inf) into IS_FPCLASS

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 27 15:04:34 PDT 2023


arsenm added inline comments.


================
Comment at: llvm/test/CodeGen/AMDGPU/fp-classify.ll:616
+; SI-NEXT:    v_cvt_f32_f16_e64 v1, |s0|
+; SI-NEXT:    v_cmp_class_f32_e32 vcc, v1, v0
 ; SI-NEXT:    v_cndmask_b32_e64 v0, 0, 1, vcc
----------------
qiucf wrote:
> arsenm wrote:
> > The result is the same but I’d somewhat prefer to keep the original isa. The infinity constant is more likely reusable with other uses in the program 
> Fpclass checks are be better if the constant is used one or more times only in such comparison, I think?
These have identical code size and cycles. I think an infinity constant is more likely to appear from unrelated function uses. Plus fcmp is a better canonical form. You should avoid this if you base on only doing the transform if the constant is illegal


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D144534



More information about the llvm-commits mailing list