[llvm] 16fbc45 - Revert "[AMDGPU] Cleanup hasUnwantedEffectsWhenEXECEmpty function (#70206)"
Christudasan Devadasan via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 26 04:37:19 PDT 2023
Author: Christudasan Devadasan
Date: 2023-10-26T17:04:28+05:30
New Revision: 16fbc45f48e895cc29b81fb36baa29f010d02881
URL: https://github.com/llvm/llvm-project/commit/16fbc45f48e895cc29b81fb36baa29f010d02881
DIFF: https://github.com/llvm/llvm-project/commit/16fbc45f48e895cc29b81fb36baa29f010d02881.diff
LOG: Revert "[AMDGPU] Cleanup hasUnwantedEffectsWhenEXECEmpty function (#70206)"
This reverts commit 7ce613fc77af092dd6e9db71ce3747b75bc5616e.
Added:
Modified:
llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
llvm/test/CodeGen/AMDGPU/remove-short-exec-branches-special-instructions.mir
Removed:
################################################################################
diff --git a/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp b/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
index 7046c37ef6efd20..ffcd415a66648df 100644
--- a/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
+++ b/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
@@ -4010,7 +4010,8 @@ bool SIInstrInfo::hasUnwantedEffectsWhenEXECEmpty(const MachineInstr &MI) const
//
// However, executing them with EXEC = 0 causes them to operate on undefined
// data, which we avoid by returning true here.
- if (Opcode == AMDGPU::V_READFIRSTLANE_B32)
+ if (Opcode == AMDGPU::V_READFIRSTLANE_B32 ||
+ Opcode == AMDGPU::V_READLANE_B32 || Opcode == AMDGPU::V_WRITELANE_B32)
return true;
return false;
diff --git a/llvm/test/CodeGen/AMDGPU/remove-short-exec-branches-special-instructions.mir b/llvm/test/CodeGen/AMDGPU/remove-short-exec-branches-special-instructions.mir
index 8f3f70ea6287ee9..fe4aa6a9aea68cb 100644
--- a/llvm/test/CodeGen/AMDGPU/remove-short-exec-branches-special-instructions.mir
+++ b/llvm/test/CodeGen/AMDGPU/remove-short-exec-branches-special-instructions.mir
@@ -130,12 +130,13 @@ body: |
---
-name: dont_skip_writelane_b32
+name: need_skip_writelane_b32
body: |
- ; CHECK-LABEL: name: dont_skip_writelane_b32
+ ; CHECK-LABEL: name: need_skip_writelane_b32
; CHECK: bb.0:
- ; CHECK-NEXT: successors: %bb.1(0x40000000)
+ ; CHECK-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
; CHECK-NEXT: {{ $}}
+ ; CHECK-NEXT: S_CBRANCH_EXECZ %bb.2, implicit $exec
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.1:
; CHECK-NEXT: successors: %bb.2(0x80000000)
@@ -159,12 +160,13 @@ body: |
...
---
-name: dont_skip_readlane_b32
+name: need_skip_readlane_b32
body: |
- ; CHECK-LABEL: name: dont_skip_readlane_b32
+ ; CHECK-LABEL: name: need_skip_readlane_b32
; CHECK: bb.0:
- ; CHECK-NEXT: successors: %bb.1(0x40000000)
+ ; CHECK-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
; CHECK-NEXT: {{ $}}
+ ; CHECK-NEXT: S_CBRANCH_EXECZ %bb.2, implicit $exec
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.1:
; CHECK-NEXT: successors: %bb.2(0x80000000)
More information about the llvm-commits
mailing list