Skip to content

Commit

Permalink
[AMDGPU] Use verify<domtree> instead of intra-pass asserts.
Browse files Browse the repository at this point in the history
Verifying dominator tree is expensive using intra-pass
asserts. Asserts added during D147408 are
increasing the build time of libc significantly. This change
does the verification after the atomic optimizer pass
and should fix the regression reported in D153232.

Reviewed By: arsenm, #amdgpu

Differential Revision: https://reviews.llvm.org/D153261
  • Loading branch information
Pravin Jagtap authored and Pravin Jagtap committed Jun 20, 2023
1 parent 1f1385d commit 699adde
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
4 changes: 0 additions & 4 deletions llvm/lib/Target/AMDGPU/AMDGPUAtomicOptimizer.cpp
Expand Up @@ -770,9 +770,6 @@ void AMDGPUAtomicOptimizerImpl::optimizeAtomic(Instruction &I,
Instruction *const SingleLaneTerminator =
SplitBlockAndInsertIfThen(Cond, &I, false, nullptr, &DTU, nullptr);

// Control flow is changed here after splitting I's block
assert(DTU.getDomTree().verify(DominatorTree::VerificationLevel::Full));

// At this point, we have split the I's block to allow one lane in wavefront
// to update the precomputed reduced value. Also, completed the codegen for
// new control flow i.e. iterative loop which perform reduction and scan using
Expand All @@ -799,7 +796,6 @@ void AMDGPUAtomicOptimizerImpl::optimizeAtomic(Instruction &I,
{{DominatorTree::Insert, EntryBB, ComputeLoop},
{DominatorTree::Insert, ComputeLoop, ComputeEnd},
{DominatorTree::Delete, EntryBB, SingleLaneTerminator->getParent()}});
assert(DTU.getDomTree().verify(DominatorTree::VerificationLevel::Full));

Predecessor = ComputeEnd;
} else {
Expand Down
2 changes: 1 addition & 1 deletion llvm/test/CodeGen/AMDGPU/global_atomics_iterative_scan.ll
@@ -1,5 +1,5 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -S -mtriple=amdgcn-- -amdgpu-atomic-optimizer-strategy=Iterative -passes=amdgpu-atomic-optimizer %s | FileCheck -check-prefix=IR %s
; RUN: opt -S -mtriple=amdgcn-- -amdgpu-atomic-optimizer-strategy=Iterative -passes='amdgpu-atomic-optimizer,verify<domtree>' %s | FileCheck -check-prefix=IR %s

define amdgpu_kernel void @uniform_value(ptr addrspace(1) , ptr addrspace(1) %val) #0 {
; IR-LABEL: @uniform_value(
Expand Down

0 comments on commit 699adde

Please sign in to comment.