llvm-project/polly/test/ScopDetect/detect-full-functions.ll
Karthika Devi C 4cb7170199
[polly] Add nullptr check to fix #113772 (#114206)
The patch adds a nullptr check before accessing the loop blocks in
'hasPossiblyDistributableLoop' function. The existing check for the
loop’s containment in the region does not capture nullptr cases when the
region covers the entire function. Therefore, it’s better to exit if the
basic block isn’t part of any loop

Fixes #113772.
2024-11-01 11:15:24 +05:30

18 lines
643 B
LLVM

; RUN: opt %loadNPMPolly '-passes=print<polly-detect>' -polly-process-unprofitable=false -disable-output -polly-detect-full-functions < %s 2>&1 | FileCheck %s
; Verify if a simple function with basic block not part of loop doesn't crash with polly-process-unprofitable=false and polly-detect-full-functions flags.
; CHECK: Detected Scops in Function foo
define void @foo() {
br label %1
1: ; preds = %1, %0
br i1 false, label %2, label %1
2: ; preds = %1
%3 = load ptr, ptr null, align 8
store ptr null, ptr null, align 8
ret void
}