[llvm] [LoopUnroll] Remove redundant debug instructions after blocks have been merged (PR #91246)

via llvm-commits llvm-commits at lists.llvm.org
Wed May 8 20:02:04 PDT 2024


coderchenlin wrote:

> we should call `RemoveRedundantDbgInstrs` on C once we see we can't merge C->D, and then we call `RemoveRedundantDbgInstrs` on F when we're done (and we saw that F did indeed have a block merged into it)

Thanks for your advice, @aeubanks , I put the process in `simplifyLoopAfterUnroll`, It seems this position is more suitable after loop-unroll is finished.  The result on the case `A->B->C`, A firstly merge B, and then, merge C.

Before:
 after A merge B, then call `RemoveredundantDbginstrs`, after A merge C, continue call  `RemoveredundantDbginstrs`.

Now:
  after A merge B, and A merge C, finally, call  `RemoveredundantDbginstrs`. Only call once, 





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


More information about the llvm-commits mailing list