Files
RedBear-OS/local/recipes/dev/libclc/source/polly/test/CodeGen/non-affine-phi-node-expansion-4.ll
T
vasilito cb424d7448 build: static patch-sanity linter (shift-left the malformed-patch class)
verify-patch-sanity.py validates every active recipe .patch has internally-
consistent hunk line counts — catching the 'malformed patch at line N' failure
at commit/CI/preflight time instead of hours into a cook. This cycle hit that
class three times (qtwaylandscanner, sddm, xwayland), each only discovered when
cookbook tried to apply the patch.

Running it across the repo found 29 latent malformed patches (validated against
GNU patch: e.g. relibc/P3-sysv-ipc reproduces 'malformed patch at line 22').
They were harmless only because they sit in vendored recipes (baked, not re-
applied) — but would fail on any version-bump re-derivation. --fix recounts the
hunk headers (body untouched) and repaired all 29.

Wired into build-preflight.sh (Phase 1.0D) and redbear-ci.yml, with a unit test
(test-patch-sanity.sh). Skips archived/legacy trees and unvalidatable formats
(empty placeholders, bare-@@ git hunks).
2026-08-01 05:13:02 +03:00

50 lines
1.5 KiB
LLVM

; RUN: opt %loadNPMPolly -passes=polly-codegen \
; RUN: -S < %s | FileCheck %s
define void @foo(ptr %A, i1 %cond0, i1 %cond1) {
entry:
br label %loop
loop:
%indvar = phi i64 [0, %entry], [%indvar.next, %backedge]
%val0 = fadd float 1.0, 2.0
%val1 = fadd float 1.0, 2.0
br i1 %cond0, label %branch1, label %backedge
; CHECK-LABEL: polly.stmt.loop:
; CHECK-NEXT: %p_val0 = fadd float 1.000000e+00, 2.000000e+00
; CHECK-NEXT: %p_val1 = fadd float 1.000000e+00, 2.000000e+00
; CHECK-NEXT: br i1
; The interesting instruction here is %val2, which does not dominate the exit of
; the non-affine region. Care needs to be taken when code-generating this write.
; Specifically, at some point we modeled this scalar write, which we tried to
; code generate in the exit block of the non-affine region.
branch1:
%val2 = fadd float 1.0, 2.0
br i1 %cond1, label %branch2, label %backedge
; CHECK-LABEL: polly.stmt.branch1:
; CHECK-NEXT: %p_val2 = fadd float 1.000000e+00, 2.000000e+00
; CHECK-NEXT: br i1
branch2:
br label %backedge
; CHECK-LABEL: polly.stmt.branch2:
; CHECK-NEXT: br label
; CHECK-LABEL: polly.stmt.backedge.exit:
; CHECK: %polly.merge = phi float [ %p_val0, %polly.stmt.loop ], [ %p_val1, %polly.stmt.branch1 ], [ %p_val2, %polly.stmt.branch2 ]
backedge:
%merge = phi float [%val0, %loop], [%val1, %branch1], [%val2, %branch2]
%indvar.next = add i64 %indvar, 1
store float %merge, ptr %A
%cmp = icmp sle i64 %indvar.next, 100
br i1 %cmp, label %loop, label %exit
exit:
ret void
}