Skip to content

[Polly][DebugInfo] Use getStableDebugLoc to avoid intrinsic-dependent behaviour #81246

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions polly/lib/Analysis/ScopDetectionDiagnostic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ void getDebugLocations(const BBPair &P, DebugLoc &Begin, DebugLoc &End) {
continue;
Todo.append(succ_begin(BB), succ_end(BB));
for (const Instruction &Inst : *BB) {
DebugLoc DL = Inst.getDebugLoc();
DebugLoc DL = Inst.getStableDebugLoc();
if (!DL)
continue;

Expand Down Expand Up @@ -821,7 +821,7 @@ std::string ReportUnprofitable::getEndUserMessage() const {
const DebugLoc &ReportUnprofitable::getDebugLoc() const {
for (const BasicBlock *BB : R->blocks())
for (const Instruction &Inst : *BB)
if (const DebugLoc &DL = Inst.getDebugLoc())
if (const DebugLoc &DL = Inst.getStableDebugLoc())
return DL;

return R->getEntry()->getTerminator()->getDebugLoc();
Expand Down
2 changes: 1 addition & 1 deletion polly/lib/Support/ScopLocation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ void getDebugLocation(const Region *R, unsigned &LineBegin, unsigned &LineEnd,

for (const BasicBlock *BB : R->blocks())
for (const Instruction &Inst : *BB) {
DebugLoc DL = Inst.getDebugLoc();
DebugLoc DL = Inst.getStableDebugLoc();
if (!DL)
continue;

Expand Down
8 changes: 4 additions & 4 deletions polly/test/ScopDetectionDiagnostics/ReportLoopBound-01.ll
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,20 @@

; If we reject non-affine loops the non-affine loop bound will be reported:
;
; REJECTNONAFFINELOOPS: remark: ReportLoopBound-01.c:1:12: The following errors keep this region from being a Scop.
; REJECTNONAFFINELOOPS: remark: ReportLoopBound-01.c:2:8: The following errors keep this region from being a Scop.
; REJECTNONAFFINELOOPS: remark: ReportLoopBound-01.c:2:8: Failed to derive an affine function from the loop bounds.
; REJECTNONAFFINELOOPS: remark: ReportLoopBound-01.c:3:5: Invalid Scop candidate ends here.

; If we allow non-affine loops the non-affine access will be reported:
;
; ALLOWNONAFFINELOOPS: remark: ReportLoopBound-01.c:1:12: The following errors keep this region from being a Scop.
; ALLOWNONAFFINELOOPS: remark: ReportLoopBound-01.c:2:8: The following errors keep this region from being a Scop.
; ALLOWNONAFFINELOOPS: remark: ReportLoopBound-01.c:3:5: The array subscript of "A" is not affine
; ALLOWNONAFFINELOOPS: remark: ReportLoopBound-01.c:3:5: Invalid Scop candidate ends here.

; If we allow non-affine loops and non-affine accesses the region will be reported as not profitable:
;
; ALLOWNONAFFINEALL: remark: ReportLoopBound-01.c:1:12: The following errors keep this region from being a Scop.
; ALLOWNONAFFINEALL: remark: ReportLoopBound-01.c:1:12: No profitable polyhedral optimization found
; ALLOWNONAFFINEALL: remark: ReportLoopBound-01.c:2:8: The following errors keep this region from being a Scop.
; ALLOWNONAFFINEALL: remark: ReportLoopBound-01.c:2:8: No profitable polyhedral optimization found
; ALLOWNONAFFINEALL: remark: ReportLoopBound-01.c:3:5: Invalid Scop candidate ends here.

target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
;
; Derived from test-suite/MultiSource/Benchmarks/BitBench/uuencode/uuencode.c
;
; CHECK: remark: uuencode.c:75:18: The following errors keep this region from being a Scop.
; CHECK: remark: uuencode.c:76:13: The following errors keep this region from being a Scop.
; CHECK: remark: uuencode.c:83:3: Loop cannot be handled because it has multiple exits.
; CHECK: remark: uuencode.c:95:21: Invalid Scop candidate ends here.

Expand Down