[PATCH] D137862: InstCombine: Fold some identities for canonicalize

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 18 11:06:17 PST 2022


arsenm added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp:7109
+    if (CanonLHS == Op1) {
+      // (canonicalize(x) == x) => (x == x)
+      return new FCmpInst(Pred, Op1, Op1, "", &I);
----------------
spatel wrote:
> Need to handle/test the commuted pattern too? 
>   fcmp Pred x, canonical(x)
Have that, canonicalize_oeq_arg_f32 and canonicalize_oeq_arg_f32_commute


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

https://reviews.llvm.org/D137862



More information about the llvm-commits mailing list