diff options
Diffstat (limited to 'contrib/llvm-project/llvm/lib/Target/AMDGPU/SIPeepholeSDWA.cpp')
| -rw-r--r-- | contrib/llvm-project/llvm/lib/Target/AMDGPU/SIPeepholeSDWA.cpp | 12 | 
1 files changed, 8 insertions, 4 deletions
diff --git a/contrib/llvm-project/llvm/lib/Target/AMDGPU/SIPeepholeSDWA.cpp b/contrib/llvm-project/llvm/lib/Target/AMDGPU/SIPeepholeSDWA.cpp index 97b3161c7f98..53fc2c068624 100644 --- a/contrib/llvm-project/llvm/lib/Target/AMDGPU/SIPeepholeSDWA.cpp +++ b/contrib/llvm-project/llvm/lib/Target/AMDGPU/SIPeepholeSDWA.cpp @@ -546,7 +546,8 @@ SIPeepholeSDWA::matchSDWAOperand(MachineInstr &MI) {      MachineOperand *Src1 = TII->getNamedOperand(MI, AMDGPU::OpName::src1);      MachineOperand *Dst = TII->getNamedOperand(MI, AMDGPU::OpName::vdst); -    if (Src1->getReg().isPhysical() || Dst->getReg().isPhysical()) +    if (!Src1->isReg() || Src1->getReg().isPhysical() || +        Dst->getReg().isPhysical())        break;      if (Opcode == AMDGPU::V_LSHLREV_B32_e32 || @@ -584,7 +585,8 @@ SIPeepholeSDWA::matchSDWAOperand(MachineInstr &MI) {      MachineOperand *Src1 = TII->getNamedOperand(MI, AMDGPU::OpName::src1);      MachineOperand *Dst = TII->getNamedOperand(MI, AMDGPU::OpName::vdst); -    if (Src1->getReg().isPhysical() || Dst->getReg().isPhysical()) +    if (!Src1->isReg() || Src1->getReg().isPhysical() || +        Dst->getReg().isPhysical())        break;      if (Opcode == AMDGPU::V_LSHLREV_B16_e32 || @@ -647,7 +649,8 @@ SIPeepholeSDWA::matchSDWAOperand(MachineInstr &MI) {      MachineOperand *Src0 = TII->getNamedOperand(MI, AMDGPU::OpName::src0);      MachineOperand *Dst = TII->getNamedOperand(MI, AMDGPU::OpName::vdst); -    if (Src0->getReg().isPhysical() || Dst->getReg().isPhysical()) +    if (!Src0->isReg() || Src0->getReg().isPhysical() || +        Dst->getReg().isPhysical())        break;      return std::make_unique<SDWASrcOperand>( @@ -675,7 +678,8 @@ SIPeepholeSDWA::matchSDWAOperand(MachineInstr &MI) {      MachineOperand *Dst = TII->getNamedOperand(MI, AMDGPU::OpName::vdst); -    if (ValSrc->getReg().isPhysical() || Dst->getReg().isPhysical()) +    if (!ValSrc->isReg() || ValSrc->getReg().isPhysical() || +        Dst->getReg().isPhysical())        break;      return std::make_unique<SDWASrcOperand>(  | 
