[PATCH] D75173: [Transform][MemCpyOpt] Add missing DebugLoc to %tmpbitcast

Vedant Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 26 08:32:54 PST 2020


vsk added inline comments.


================
Comment at: llvm/test/Transforms/MemCpyOpt/pr37967.ll:4
+; CHECK: CheckFunctionDebugify [MemCpy Optimization]: PASS
+; CHECK-NOT: ERROR: Instruction with empty DebugLoc in function _Z3bar3FooS_RiS_ --  %tmpcast = bitcast i8* %1 to %struct.Foo*
+
----------------
vsk wrote:
> Could you change this to a positive test? e.g.
> 
> ```
> ; CHECK-LABEL: define {{.*}} @_Z3bar3FooS_RiS_
> ; CHECK: [[firstAlloca:%.*]] = alloca %struct.Foo
> ; CHECK: bitcast i8* [[firstAlloca]] to %struct.Foo*, !dbg
> ```
> 
> As-written, it might stop being a useful test if the structure of the IR emitted by the pass changes slightly (seems likely, as the bitcast is a no-op?), or if (for some reason) the -check-debugify output changes.
Ah, oops. %1 has a different type after 'opt' runs, so the check line for 'firstAlloca' needs to be fixed up.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D75173





More information about the llvm-commits mailing list