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

Pierre van Houtryve via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 27 01:33:10 PST 2020


Pierre-vh marked 2 inline comments as done.
Pierre-vh 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:
> 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.
I can't write the test like that as the resulting line looks like this:


```
  %tmpcast = bitcast i8* %1 to %struct.Foo*
```

It doesn't have a `!dbg` attribute (but, since debugify doesn't complain, it seems to have a non-null DebugLoc node, my guess is just that it's empty)


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

https://reviews.llvm.org/D75173





More information about the llvm-commits mailing list