[PATCH] D92557: [MachineLICM] delete dead flag if the duplicated def outside of loop is dead.

ChenZheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 18 07:46:49 PST 2020


shchenz added inline comments.


================
Comment at: llvm/lib/CodeGen/MachineLICM.cpp:1470
+      // Clear Dup dead flag if any, we reuse it for Reg.
+      const_cast<MachineInstr *>(Dup)->getOperand(Idx).setIsDead(false);
     }
----------------
arsenm wrote:
> Really should not be using const_cast here
Thanks for your comments. Do you mean we should make `LookForDuplicate()` return `MachineInstr *` instead of return `const MachineInstr *`?


================
Comment at: llvm/test/CodeGen/PowerPC/machinelicm-cse-dead-flag.mir:4
+# RUN:   -verify-machineinstrs %s -o - | FileCheck %s
+---
+name: deadFlagAfterCSE
----------------
arsenm wrote:
> Add a comment explaining the test
will do this later.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D92557



More information about the llvm-commits mailing list