[llvm] 699adde - [AMDGPU] Use verify<domtree> instead of intra-pass asserts.
Pravin Jagtap via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 20 06:53:24 PDT 2023
Author: Pravin Jagtap
Date: 2023-06-20T09:52:58-04:00
New Revision: 699addeff03515928b5e655b45199cda172a7893
URL: https://github.com/llvm/llvm-project/commit/699addeff03515928b5e655b45199cda172a7893
DIFF: https://github.com/llvm/llvm-project/commit/699addeff03515928b5e655b45199cda172a7893.diff
LOG: [AMDGPU] Use verify<domtree> instead of intra-pass asserts.
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
Added:
Modified:
llvm/lib/Target/AMDGPU/AMDGPUAtomicOptimizer.cpp
llvm/test/CodeGen/AMDGPU/global_atomics_iterative_scan.ll
Removed:
################################################################################
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUAtomicOptimizer.cpp b/llvm/lib/Target/AMDGPU/AMDGPUAtomicOptimizer.cpp
index 04a9b651d9a81..21696ace0aab7 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUAtomicOptimizer.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUAtomicOptimizer.cpp
@@ -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
@@ -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 {
diff --git a/llvm/test/CodeGen/AMDGPU/global_atomics_iterative_scan.ll b/llvm/test/CodeGen/AMDGPU/global_atomics_iterative_scan.ll
index 229c3aaff6f5a..f5ba59b616d71 100644
--- a/llvm/test/CodeGen/AMDGPU/global_atomics_iterative_scan.ll
+++ b/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(
More information about the llvm-commits
mailing list