mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-02-11 04:06:20 +00:00
![Tobias Grosser](/assets/img/avatar_default.png)
This patch makes sure that in case a loop is not fully contained within a region that later forms a SCoP, none of the loop backedges are allowed to be part of the region. We currently do not support the situation where only some of a loops backedges are part of a scop. Today, this can break both scop modeling and code generation. One such breaking test case is for example test/ScopDetectionDiagnostics/loop_partially_in_scop-2.ll, where we totally forgot to code generate some of the backedges. Fortunately, it is commonly not necessary to support these partial loops, it is way more common that either no backedge is included in a region or all loop backedge are included. This fixes a recent miscompile in MultiSource/Benchmarks/MiBench/consumer-typeset which was exposed after r306477. llvm-svn: 308113
25 lines
710 B
LLVM
25 lines
710 B
LLVM
; RUN: opt %loadPolly -analyze -polly-detect \
|
|
; RUN: -pass-remarks-missed="polly-detect" \
|
|
; RUN: < %s 2>&1| FileCheck %s
|
|
|
|
; CHECK: remark: <unknown>:0:0: Loop cannot be handled because not all latches are part of loop region.
|
|
|
|
define void @foo(i8* %str0) {
|
|
if.end32:
|
|
br label %while.cond
|
|
|
|
while.cond:
|
|
%str.1 = phi i8* [%str0, %if.end32], [%incdec.ptr58364, %lor.end], [%incdec.ptr58364, %while.cond]
|
|
%tmp5 = load i8, i8* %str.1, align 1
|
|
%.off367 = add i8 %tmp5, -48
|
|
%tmp6 = icmp ult i8 %.off367, 10
|
|
%incdec.ptr58364 = getelementptr inbounds i8, i8* %str.1, i64 1
|
|
br i1 %tmp6, label %while.cond, label %lor.end
|
|
|
|
lor.end:
|
|
br i1 false, label %exit, label %while.cond
|
|
|
|
exit:
|
|
ret void
|
|
}
|