mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-11 02:16:50 +00:00
AMDGPU: Don't crash when trying to fold implicit operands
llvm-svn: 324550
This commit is contained in:
parent
321b443ef6
commit
c908e3f77a
@ -345,6 +345,7 @@ void SIFoldOperands::foldOperand(
|
|||||||
// Don't fold into target independent nodes. Target independent opcodes
|
// Don't fold into target independent nodes. Target independent opcodes
|
||||||
// don't have defined register classes.
|
// don't have defined register classes.
|
||||||
if (UseDesc.isVariadic() ||
|
if (UseDesc.isVariadic() ||
|
||||||
|
UseOp.isImplicit() ||
|
||||||
UseDesc.OpInfo[UseOpIdx].RegClass == -1)
|
UseDesc.OpInfo[UseOpIdx].RegClass == -1)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
14
llvm/test/CodeGen/AMDGPU/fold-implicit-operand.mir
Normal file
14
llvm/test/CodeGen/AMDGPU/fold-implicit-operand.mir
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
# RUN: llc -march=amdgcn -run-pass si-fold-operands -verify-machineinstrs -o - %s | FileCheck %s
|
||||||
|
---
|
||||||
|
# Make sure there is no crash when trying to fold an immediate into an
|
||||||
|
# implicit use
|
||||||
|
|
||||||
|
# CHECK: %0:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
|
||||||
|
# CHECK-NEXT: S_ENDPGM implicit %0
|
||||||
|
name: fold_imm_implicit_operand
|
||||||
|
body: |
|
||||||
|
bb.0:
|
||||||
|
%0:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
|
||||||
|
S_ENDPGM implicit %0
|
||||||
|
|
||||||
|
...
|
Loading…
x
Reference in New Issue
Block a user