[PATCH] D84909: [GISel] Add combiners for G_INTTOPTR and G_PTRTOINT

Michael Kitzan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 29 20:52:57 PDT 2020


mkitzan created this revision.
mkitzan added reviewers: aditya_nandakumar, dsanders, arsenm, paquette, volkan.
Herald added subscribers: llvm-commits, hiraditya, kristof.beyls.
Herald added a project: LLVM.
mkitzan requested review of this revision.
Herald added a subscriber: wdng.

Patch adds two new `GICombinerRule`s, one for `G_INTTOPTR` and one for `G_PTRTOINT`. The `G_INTTOPTR` elides `ptr2int(int2ptr(x))` to a copy of `x`, if the cast is within the same address space. The `G_PTRTOINT` elides `int2ptr(ptr2int(x))` to a copy of `x`. Patch additionally adds new combiner tests for the AArch64 target to test these new combiner rules.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D84909

Files:
  llvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h
  llvm/include/llvm/Target/GlobalISel/Combine.td
  llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
  llvm/test/CodeGen/AArch64/GlobalISel/combine-inttoptr-ptrtoint.mir
  llvm/test/CodeGen/AArch64/GlobalISel/combine-ptrtoint.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D84909.281790.patch
Type: text/x-patch
Size: 6776 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200730/6fc1984c/attachment.bin>


More information about the llvm-commits mailing list