[PATCH] D153349: [AMDGPU] Preserve dom-tree analysis in atomic optimizer.
Pravin Jagtap via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 21 05:04:14 PDT 2023
This revision was automatically updated to reflect the committed changes.
Closed by commit rG8e1e871e2ff1: [AMDGPU] Preserve dom-tree analysis in atomic optimizer. (authored by pravinjagtap).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D153349/new/
https://reviews.llvm.org/D153349
Files:
llvm/lib/Target/AMDGPU/AMDGPUAtomicOptimizer.cpp
llvm/test/CodeGen/AMDGPU/global-atomic-scan.ll
Index: llvm/test/CodeGen/AMDGPU/global-atomic-scan.ll
===================================================================
--- llvm/test/CodeGen/AMDGPU/global-atomic-scan.ll
+++ llvm/test/CodeGen/AMDGPU/global-atomic-scan.ll
@@ -1,5 +1,5 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
-; RUN: opt -S -mtriple=amdgcn-- -passes=amdgpu-atomic-optimizer %s | FileCheck -check-prefix=IR %s
+; RUN: opt -S -mtriple=amdgcn-- -passes='amdgpu-atomic-optimizer,verify<domtree>' %s | FileCheck -check-prefix=IR %s
define amdgpu_kernel void @atomic_add_i32_offset(ptr addrspace(1) %out, i32 %in) {
; IR-LABEL: @atomic_add_i32_offset(
Index: llvm/lib/Target/AMDGPU/AMDGPUAtomicOptimizer.cpp
===================================================================
--- llvm/lib/Target/AMDGPU/AMDGPUAtomicOptimizer.cpp
+++ llvm/lib/Target/AMDGPU/AMDGPUAtomicOptimizer.cpp
@@ -145,10 +145,17 @@
bool IsPixelShader = F.getCallingConv() == CallingConv::AMDGPU_PS;
- return AMDGPUAtomicOptimizerImpl(UA, DL, DTU, ST, IsPixelShader, ScanImpl)
- .run(F)
- ? PreservedAnalyses::none()
- : PreservedAnalyses::all();
+ bool IsChanged =
+ AMDGPUAtomicOptimizerImpl(UA, DL, DTU, ST, IsPixelShader, ScanImpl)
+ .run(F);
+
+ if (!IsChanged) {
+ return PreservedAnalyses::all();
+ }
+
+ PreservedAnalyses PA;
+ PA.preserve<DominatorTreeAnalysis>();
+ return PA;
}
bool AMDGPUAtomicOptimizerImpl::run(Function &F) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D153349.533217.patch
Type: text/x-patch
Size: 1492 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230621/4a194ff2/attachment.bin>
More information about the llvm-commits
mailing list