[PATCH] D124321: [InstSimplify] Use canReplacePointersIfEqual to conditionally simplify '(ptr1 == ptr2) ? a : b'

Juneyoung Lee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 23 01:25:24 PDT 2022


aqjune added inline comments.


================
Comment at: llvm/lib/Analysis/InstructionSimplify.cpp:4348
+                                            MaxRecurse) == TrueVal))
       return FalseVal;
+    if ((CanReplaceLWithR && simplifyWithOpReplaced(TrueVal, CmpLHS, CmpRHS, Q,
----------------
Refinement must not be used in this case; `AreEqual` is used instead therefore.


================
Comment at: llvm/test/Transforms/InstSimplify/select-ptr-eq.ll:44
   ret ptr %res
 }
 
----------------
case3 and case4 are kept optimized.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D124321



More information about the llvm-commits mailing list