[PATCH] D120786: [IRSim] Removing length check so first instruction in module is included

Jessica Paquette via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 2 11:10:47 PST 2022


paquette added a comment.

I measured myself and found that this actually exposes *another* bug.

This IR:

https://godbolt.org/z/Wxq5aEsGT

Compiled with this patch using

  ~/llvm-project/build/bin/opt -iroutliner /tmp/testcase.ll -o -

Gives us

  !dbg attachment points at wrong subprogram for function
  !12 = distinct !DISubprogram(name: "outlined_ir_func_0", linkageName: "outlined_ir_func_0", scope: !2, file: !2, type: !3, flags: DIFlagArtificial, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !5, retainedNodes: !4)
  i1 ()* @outlined_ir_func_0
    br i1 undef, label %bb5, label %bb13.exitStub, !llvm.loop !13
  !14 = !DILocation(line: 1655, column: 5, scope: !15)
  !15 = distinct !DISubprogram(name: "snork.outlined", linkageName: "snork.outlined", scope: null, file: !2, type: !3, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition | DISPFlagOptimized, unit: !5, retainedNodes: !4)
  !15 = distinct !DISubprogram(name: "snork.outlined", linkageName: "snork.outlined", scope: null, file: !2, type: !3, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition | DISPFlagOptimized, unit: !5, retainedNodes: !4)
  LLVM ERROR: Broken module found, compilation aborted!

I know this is a real bug because I saw it in a much more complex setting than the test suite. :) This change (thankfully?) exposes it. The bug ought to be independent of this patch.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D120786



More information about the llvm-commits mailing list