[PATCH] D98401: [CodeGen] Fix backward copy propagation with -g

Orlando Cazalet-Hyams via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 12 04:33:20 PST 2021


Orlando added inline comments.


================
Comment at: llvm/test/CodeGen/X86/machine-cp-clobbers.mir:10-11
+    ; CHECK: renamable $rbx = LEA64r $rax, 1, $noreg, 8, $noreg
+    ; CHECK: DBG_VALUE $rbp, $noreg
+    ; CHECK: DBG_VALUE $noreg, $noreg
+    renamable $rbx = LEA64r $rax, 1, $noreg, 8, $noreg
----------------
Just to check I understand, `renamable $rbx = COPY killed renamable $rbp` should be removed by this pass (with your patch applied) because it's a redundant copy, right?

I think these should be `CHECK-NEXT` directives (see https://llvm.org/docs/CommandGuide/FileCheck.html#the-check-next-directive). Otherwise the test will pass even if `renamable $rbx = COPY killed renamable $rbp` is not removed.


================
Comment at: llvm/test/CodeGen/X86/machine-cp-clobbers.mir:15
+    renamable $rbx = COPY killed renamable $rbp
+    DBG_VALUE $noreg, $noreg
+
----------------
Please can you update the test to show that @yshui's concern (https://reviews.llvm.org/D98401?vs=329886&id=330206#2619087) has been addressed?

For example, if you change this line to `DBG_VALUE $rbx, $noreg` and update the final CHECK directive to `CHECK: DBG_VALUE $rbp, $noreg` to show that the DBG_VALUE's register gets updated when the COPY is removed, does the test still pass?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98401



More information about the llvm-commits mailing list