45 lines · plain
1; RUN: opt %loadNPMPolly '-passes=polly<no-default-opts>' -S < %s | FileCheck %s2;3; llvm.org/PR254394; Scalar reloads in the generated entering block were not recognized as5; dominating the subregion blocks when there were multiple entering nodes. This6; resulted in values defined in there (here: %cond used in subregionB_entry) not7; being copied. We check whether it is reusing the reloaded scalar.8;9; CHECK-LABEL: polly.stmt.subregionB_entry.exit:10; CHECK: store i1 %polly.cond, ptr %cond.s2a11;12; CHECK-LABEL: polly.stmt.subregionB_entry.entry:13; CHECK: %cond.s2a.reload = load i1, ptr %cond.s2a14;15; CHECK-LABEL: polly.stmt.subregionB_entry:16; CHECK: br i1 %cond.s2a.reload17 18define void @func(ptr %A) {19entry:20 br label %subregionA_entry21 22subregionA_entry:23 %cond = phi i1 [ false, %entry ], [ true, %subregionB_exit ]24 br i1 %cond, label %subregionA_if, label %subregionA_else25 26subregionA_if:27 br label %subregionB_entry28 29subregionA_else:30 br label %subregionB_entry31 32subregionB_entry:33 store i32 0, ptr %A34 br i1 %cond, label %subregionB_if, label %subregionB_exit35 36subregionB_if:37 br label %subregionB_exit38 39subregionB_exit:40 br i1 false, label %subregionA_entry, label %return41 42return:43 ret void44}45