[PATCH] D88865: [GISel] Add combine for constant G_PTR_ADD offsets.

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 6 07:45:30 PDT 2020


arsenm added inline comments.


================
Comment at: llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp:2027
+  LLT NewTy{LLT::scalar(PtrTy.getSizeInBits())};
+  Builder.setInstr(MI);
+  auto CstMIB = Builder.buildConstant(NewTy, NewCst);
----------------
setInstrAndDebugLoc


================
Comment at: llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp:2028
+  Builder.setInstr(MI);
+  auto CstMIB = Builder.buildConstant(NewTy, NewCst);
+  Builder.buildCast(Dst, CstMIB);
----------------
This can directly produce a pointer typed constant


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D88865



More information about the llvm-commits mailing list