[PATCH] D152691: [LICM] Sunk instructions with invalid source location.
Carlos Alberto Enciso via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 13 03:01:45 PDT 2023
CarlosAlbertoEnciso added a comment.
In D152691#4414653 <https://reviews.llvm.org/D152691#4414653>, @fdeazeve wrote:
> I think we can greatly simplify the test to make it easier for readers to understand what's going on. I left some inline comments, and the test itself could start along these lines:
>
> ; CHECK-LABEL: for.end:
> ; CHECK: tail call noundef i32 @foo0({{.*}}), !dbg ![[DBG:[0-9]+]]
> ; CHECK-DAG: ![[DBG]] = !DILocation(line: 0, scope: ![[SCOPE:[0-9]+]]
> ; CHECK-DAG: ![[SCOPE]] = distinct !DISubprogram(name: "bounce",
>
> define noundef i32 @foo0(i32 noundef %Idx) #0 !dbg !9 {
> ret i32 2, !dbg !14
> }
> define noundef i32 @foo1(i32 noundef %Idx) #0 !dbg !15 {
> ret i32 4, !dbg !16
> }
>
> define i32 @foo2() !dbg !17 {
> entry:
> br label %for.body, !dbg !20
>
> ... rest of the test here ...
Thanks very much for outlining a simplified test and the inline comments.
================
Comment at: llvm/test/Transforms/LICM/sink-instruction-invalid-location.ll:30
+; CHECK-LABEL: for.end:
+; CHECK: %call1.le = tail call noundef i32 @"?getInOrder@@YAHH at Z"(i32 noundef %I.07.lcssa), !dbg ![[DBG:[0-9]+]]
+; CHECK-DAG: ![[DBG]] = !DILocation(line: 0, scope: ![[SCOPE:[0-9]+]]
----------------
fdeazeve wrote:
> We shouldn't hardcode the name of SSA values, these are not guaranteed to be preserved by opt.
>
> I believe the same apply for the names of BBs (which are also SSA values)
Removed the hardcoded SSA and BBs names.
================
Comment at: llvm/test/Transforms/LICM/sink-instruction-invalid-location.ll:35
+@"?InOrder@?1??getInOrder@@YAHH at Z@4PAHA" = internal unnamed_addr constant [2 x i32] [i32 0, i32 1], align 4
+@"?RandVars@?1??getRandVar@@YAHH at Z@4PAHA" = internal unnamed_addr constant [2 x i32] [i32 4, i32 4], align 4
+
----------------
fdeazeve wrote:
> I believe this variable is not used anywhere?
Good point. Removed.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D152691/new/
https://reviews.llvm.org/D152691
More information about the llvm-commits
mailing list