[llvm] [CodeGen] Refactor DeadMIElim isDead and GISel isTriviallyDead (PR #105956)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 29 01:32:14 PDT 2024


================
@@ -1337,10 +1337,7 @@ bool MachineInstr::wouldBeTriviallyDead() const {
   // If we can move an instruction, we can remove it.  Otherwise, it has
   // a side-effect of some sort.
   bool SawStore = false;
-  if (!isSafeToMove(SawStore) && !isPHI())
-    return false;
-
-  return true;
+  return isSafeToMove(SawStore) || isPHI();
----------------
arsenm wrote:

isPHI first 

https://github.com/llvm/llvm-project/pull/105956


More information about the llvm-commits mailing list