[llvm] [polly] [IR] Add CallBr intrinsics support (PR #133907)

Robert Imschweiler via llvm-commits llvm-commits at lists.llvm.org
Mon May 12 08:24:06 PDT 2025


ro-i wrote:

Alright, thanks! The region detection change was due to StructurizeCFG ripping callbr apart, e.g.
```llvm
*** IR Dump After Fixup each natural loop to have a single exit block (unify-loop-exits) ***
define void @foo(i32 %x) {
  callbr void asm "", "r,!i"(i32 %x)
          to label %UnifiedReturnBlock [label %indirect]

indirect:                                         ; preds = %0
  call void @llvm.amdgcn.unreachable()
  br label %UnifiedReturnBlock

UnifiedReturnBlock:                               ; preds = %0, %indirect
  ret void
}
*** IR Dump After Structurize control flow (structurizecfg) ***
  br i1 poison, label %indirect, label %UnifiedReturnBlock

indirect:                                         ; preds = %0
  call void @llvm.amdgcn.unreachable()
  br label %UnifiedReturnBlock
*** IR Dump After Structurize control flow (structurizecfg) ***
  br i1 poison, label %indirect, label %UnifiedReturnBlock

indirect:                                         ; preds = %0
  call void @llvm.amdgcn.unreachable()
  br label %UnifiedReturnBlock

UnifiedReturnBlock:                               ; preds = %indirect, %0
  ret void
```

https://github.com/llvm/llvm-project/pull/133907


More information about the llvm-commits mailing list