diff options
author | Amara Emerson <aemerson@apple.com> | 2019-08-24 02:25:56 +0000 |
---|---|---|
committer | Amara Emerson <aemerson@apple.com> | 2019-08-24 02:25:56 +0000 |
commit | 3f6dd0c588726b2303986c4a669451ae61b34c1e (patch) | |
tree | 52aa81bb09670d67e1ebc9f05265c577495da1fd /llvm/lib/CodeGen/MachineVerifier.cpp | |
parent | a39e6490af0f768996b1c462afeeec0346541fde (diff) | |
download | bcm5719-llvm-3f6dd0c588726b2303986c4a669451ae61b34c1e.tar.gz bcm5719-llvm-3f6dd0c588726b2303986c4a669451ae61b34c1e.zip |
[GlobalISel] Introduce a G_DYN_STACKALLOC opcode to represent dynamic allocas.
This just adds the opcode and verifier, it will be used to replace existing
dynamic alloca handling in a subsequent patch.
Differential Revision: https://reviews.llvm.org/D66677
llvm-svn: 369833
Diffstat (limited to 'llvm/lib/CodeGen/MachineVerifier.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineVerifier.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineVerifier.cpp b/llvm/lib/CodeGen/MachineVerifier.cpp index c0c5a70fac8..727ce0af029 100644 --- a/llvm/lib/CodeGen/MachineVerifier.cpp +++ b/llvm/lib/CodeGen/MachineVerifier.cpp @@ -1437,6 +1437,27 @@ void MachineVerifier::verifyPreISelGenericInstruction(const MachineInstr *MI) { break; } + case TargetOpcode::G_DYN_STACKALLOC: { + const MachineOperand &DstOp = MI->getOperand(0); + const MachineOperand &AllocOp = MI->getOperand(1); + const MachineOperand &AlignOp = MI->getOperand(2); + + if (!DstOp.isReg() || !MRI->getType(DstOp.getReg()).isPointer()) { + report("dst operand 0 must be a pointer type", MI); + break; + } + + if (!AllocOp.isReg() || !MRI->getType(AllocOp.getReg()).isScalar()) { + report("src operand 1 must be a scalar reg type", MI); + break; + } + + if (!AlignOp.isImm()) { + report("src operand 2 must be an immediate type", MI); + break; + } + break; + } default: break; } |