mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-23 21:26:06 +00:00

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.
18 lines
643 B
LLVM
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
|
|
}
|