[llvm] [DebugInfo][RemoveDIs] Maintain DPValues on skipped instrs in CGP (PR #74602)

Orlando Cazalet-Hyams via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 6 09:01:23 PST 2023


================
@@ -6986,6 +6987,11 @@ bool CodeGenPrepare::optimizeSelectInst(SelectInst *SI) {
   // Increment the current iterator to skip all the rest of select instructions
   // because they will be either "not lowered" or "all lowered" to branch.
   CurInstIterator = std::next(LastSI->getIterator());
+  // Examine any debug-info attached to those instructions, which won't be seen
+  // elsewhere. But only do it once we return and have potentially rewritten
+  // valeus.
+  for (SelectInst *SI : ArrayRef(ASI).drop_front())
----------------
OCHyams wrote:

(new version sounds good, thanks)

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


More information about the llvm-commits mailing list