summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/AMDGPU/SIShrinkInstructions.cpp
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2019-10-30 12:39:55 -0700
committerMatt Arsenault <arsenm2@gmail.com>2019-10-30 14:40:56 -0700
commitedca9ac0de3a5c10a21ef0c725501ea35791006a (patch)
treea142be965cd0a820c3efe2b48df99218f5fc70be /llvm/lib/Target/AMDGPU/SIShrinkInstructions.cpp
parent0202fa3a47b2eea06d43a6257ebfe5498fb7835b (diff)
downloadbcm5719-llvm-edca9ac0de3a5c10a21ef0c725501ea35791006a.tar.gz
bcm5719-llvm-edca9ac0de3a5c10a21ef0c725501ea35791006a.zip
AMDGPU: Don't fold S_NOPs with implicit operands
Diffstat (limited to 'llvm/lib/Target/AMDGPU/SIShrinkInstructions.cpp')
-rw-r--r--llvm/lib/Target/AMDGPU/SIShrinkInstructions.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Target/AMDGPU/SIShrinkInstructions.cpp b/llvm/lib/Target/AMDGPU/SIShrinkInstructions.cpp
index 8afca2cdc32..3986ca6dfa8 100644
--- a/llvm/lib/Target/AMDGPU/SIShrinkInstructions.cpp
+++ b/llvm/lib/Target/AMDGPU/SIShrinkInstructions.cpp
@@ -603,8 +603,10 @@ bool SIShrinkInstructions::runOnMachineFunction(MachineFunction &MF) {
// =>
// s_nop (N + M)
if (MI.getOpcode() == AMDGPU::S_NOP &&
+ MI.getNumOperands() == 1 && // Don't merge with implicit operands
Next != MBB.end() &&
- (*Next).getOpcode() == AMDGPU::S_NOP) {
+ (*Next).getOpcode() == AMDGPU::S_NOP &&
+ (*Next).getNumOperands() == 1) {
MachineInstr &NextMI = *Next;
// The instruction encodes the amount to wait with an offset of 1,
OpenPOWER on IntegriCloud