[PATCH] D106289: [InstCombine] Fold phi ( inttoptr/ptrtoint x ) to phi (x)

Krishna Kariya via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 3 03:26:59 PDT 2021


Krishnakariya added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp:307
+  // Check if all uses of phi are ptr2int.
+  for (User *U : PN.users()) {
+    if (!dyn_cast<PtrToIntInst>(U)) {
----------------
aqjune wrote:
> Perhaps there was llvm::all_of that can take this loop body as lambda. Let's use it to simplify this further.
Thanks, I have updated the patch.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D106289



More information about the llvm-commits mailing list