[PATCH] D78749: [CodeExtractor] Fix extraction of a value used only by intrinsics outside of region

Ehud Katz via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 24 10:16:52 PDT 2020


ekatz marked an inline comment as done.
ekatz added inline comments.


================
Comment at: llvm/test/Transforms/CodeExtractor/LoopExtractor_alloca.ll:2
+; RUN: opt -loop-extract -S < %s | FileCheck %s
+
+; This tests 2 cases:
----------------
vsk wrote:
> ekatz wrote:
> > vsk wrote:
> > > It looks like -loop-extract behaves like a ModulePass. If that's right, this test should pass if you add a RUN line like: `RUN: opt -debugify-each -loop-extract ... | FileCheck %s`.
> > > 
> > > This would just add synthetic debug uses before -loop-extract and strip them away afterwards, the final IR should look identical (if there are no bugs w.r.t handling debug uses).
> > Great suggestion!
> > Though, `-debugify-each` results with:
> > ```
> > ERROR: Instruction with empty DebugLoc in function test --  %lt.cast = bitcast i32* %v1 to i8*
> > ERROR: Instruction with empty DebugLoc in function test --  call void @llvm.lifetime.start.p0i8(i64 -1, i8* %lt.cast)
> > ERROR: Instruction with empty DebugLoc in function test --  br label %loop1.loop2_crit_edge
> > ERROR: Instruction with empty DebugLoc in function test --  br label %exit
> > ERROR: Instruction with empty DebugLoc in function test.loop2 --  ret void
> > ERROR: Instruction with empty DebugLoc in function test.loop1 --  ret void
> > WARNING: Missing line 9
> > WARNING: Missing variable 2
> > WARNING: Missing variable 4
> > CheckModuleDebugify [Extract loops into new functions]: FAIL
> > CheckFunctionDebugify [Module Verifier]: PASS
> > CheckFunctionDebugify [Module Verifier]: PASS
> > CheckFunctionDebugify [Module Verifier]: PASS
> > ```
> > This is probably a different bug that needs to be solved.
> > 
> > So, instead I'll just use `-debugify` and update the expected result to include the debug info.
> The empty DebugLoc diagnostics are interesting, but unrelated to this patch. You can use -debugify-quiet to suppress the diagnostics, create a separate test for debug info, or just use the -debugify mode. Those options all sound fine to me.
It won't hurt to keep the debug info, so I guess we can just leave it as it is.


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

https://reviews.llvm.org/D78749





More information about the llvm-commits mailing list