diff options
author | Shan Huang <52285902006@stu.ecnu.edu.cn> | 2024-05-20 16:39:48 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-20 16:39:48 +0800 |
commit | f5211d79b9edf56c08143491ccde38d480b40ab8 (patch) | |
tree | d97a12e96c0c6eae2fa8c5a9f270854a16fa78ae /clang/lib/CodeGen/CoverageMappingGen.cpp | |
parent | b60e62896e2665e1a0ac51fc9942c1c4d31c0f53 (diff) | |
download | llvm-f5211d79b9edf56c08143491ccde38d480b40ab8.zip llvm-f5211d79b9edf56c08143491ccde38d480b40ab8.tar.gz llvm-f5211d79b9edf56c08143491ccde38d480b40ab8.tar.bz2 |
[DebugInfo][GVNSink] Fix #77415: GVNSink fails to optimize LLVM IR with debug info (#77602)
This PR fixes issue #77415 and is revised from PR #77419 .
PR #77419 breaks the newly added test in the same PR on windows, because
GVNSink is non-deterministic when sorting `BasicBlock*` pointers. This
is reflected in the failure report.
```
# | C:\src\llvm-project\llvm\test\Transforms\GVNSink\sink-ignore-dbg-intrinsics.ll:28:10: error: CHECK: expected string not found in input
# | ; CHECK: %a.sink = phi i32 [ %a, %if.then ], [ %b, %if.else ]
# | ^
# | <stdin>:24:8: note: scanning from here
# | if.end: ; preds = %if.else, %if.then
# | ^
# | <stdin>:25:2: note: possible intended match here
# | %b.sink = phi i32 [ %b, %if.else ], [ %a, %if.then ]
# | ^
# |
# | Input file: <stdin>
# | Check file: C:\src\llvm-project\llvm\test\Transforms\GVNSink\sink-ignore-dbg-intrinsics.ll
```
According to the report, what the CheckFile wants to match is the
`%a.sink`, however there is `%b.sink`. But this mismatch does not mean
that this commit is wrong, since the occurrence of either `%a.sink` or
`%b.sink` is correct. The root cause of this test failure is the strict
check rule in the regression test committed.
So I refined the regression test with a more general check rule to only
detect whether there is an instruction with suffix `.sink` in the
`if.end` block. Hope this won't fail the test. If this PR still fails to
build, I will close this PR and try to find another right way to fix
this.
Diffstat (limited to 'clang/lib/CodeGen/CoverageMappingGen.cpp')
0 files changed, 0 insertions, 0 deletions