[PATCH] D137700: [reg2mem]Skip token-producing Instructions

Zhang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 9 01:44:44 PST 2022


Naville created this revision.
Naville added reviewers: tammela, chandlerc.
Herald added a subscriber: hiraditya.
Herald added a project: All.
Naville requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This should fix https://github.com/llvm/llvm-project/issues/58890


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D137700

Files:
  llvm/lib/Transforms/Scalar/Reg2Mem.cpp


Index: llvm/lib/Transforms/Scalar/Reg2Mem.cpp
===================================================================
--- llvm/lib/Transforms/Scalar/Reg2Mem.cpp
+++ llvm/lib/Transforms/Scalar/Reg2Mem.cpp
@@ -40,6 +40,9 @@
 STATISTIC(NumPhisDemoted, "Number of phi-nodes demoted");
 
 static bool valueEscapes(const Instruction &Inst) {
+  if(Inst.getType()->isTokenTy()){
+    return false;
+  }
   const BasicBlock *BB = Inst.getParent();
   for (const User *U : Inst.users()) {
     const Instruction *UI = cast<Instruction>(U);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D137700.474194.patch
Type: text/x-patch
Size: 527 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221109/21e9d477/attachment.bin>


More information about the llvm-commits mailing list