diff options
| author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2021-12-13 16:26:02 -0500 |
|---|---|---|
| committer | Matt Arsenault <Matthew.Arsenault@amd.com> | 2022-01-12 19:44:26 -0500 |
| commit | 1adeebc2cf3e1081310a56acb813e480f6731324 (patch) | |
| tree | 9f4a54b27c916c87029d36370e5ef265ceb6e766 /llvm/lib/Target/AMDGPU/SIAnnotateControlFlow.cpp | |
| parent | d043822daab9b4e7176a48c6794cb454e7398ec0 (diff) | |
AMDGPU: Fix assert on function argument as loop condition
Diffstat (limited to 'llvm/lib/Target/AMDGPU/SIAnnotateControlFlow.cpp')
| -rw-r--r-- | llvm/lib/Target/AMDGPU/SIAnnotateControlFlow.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Target/AMDGPU/SIAnnotateControlFlow.cpp b/llvm/lib/Target/AMDGPU/SIAnnotateControlFlow.cpp index 397b2f873515..b81fac36fc95 100644 --- a/llvm/lib/Target/AMDGPU/SIAnnotateControlFlow.cpp +++ b/llvm/lib/Target/AMDGPU/SIAnnotateControlFlow.cpp @@ -245,6 +245,12 @@ Value *SIAnnotateControlFlow::handleLoopCondition( return CallInst::Create(IfBreak, Args, "", Insert); } + if (isa<Argument>(Cond)) { + Instruction *Insert = L->getHeader()->getFirstNonPHIOrDbgOrLifetime(); + Value *Args[] = { Cond, Broken }; + return CallInst::Create(IfBreak, Args, "", Insert); + } + llvm_unreachable("Unhandled loop condition!"); } |
