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

Krishna Kariya via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 19 10:37:06 PDT 2021


Krishnakariya created this revision.
Herald added subscribers: hiraditya, arichardson.
Krishnakariya requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

In this patch, we focus on phi-node operands with inttoptr casts. 
We know that ptrtoint( inttoptr( ptrtoint x) ) is same as ptrtoint (x). 
So, we want to remove this roundtrip cast which goes through phi-node.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D106289

Files:
  llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp
  llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
  llvm/test/Transforms/InstCombine/phi-int2ptr-fold.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106289.359831.patch
Type: text/x-patch
Size: 6971 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210719/e6364e8f/attachment.bin>


More information about the llvm-commits mailing list