diff options
author | Denis Antrushin <dantrushin@gmail.com> | 2021-01-14 22:35:18 +0300 |
---|---|---|
committer | Denis Antrushin <dantrushin@gmail.com> | 2021-01-18 15:20:54 +0300 |
commit | f7443905af1e06eaacda1e437fff8d54dc89c487 (patch) | |
tree | ff460cd48d42c315a01cb4c843d18164256f1393 /llvm/lib/CodeGen/StackMaps.cpp | |
parent | 689aaba7acf5778bfe96bfd7bc4f1f3ceed20dc8 (diff) | |
download | llvm-f7443905af1e06eaacda1e437fff8d54dc89c487.zip llvm-f7443905af1e06eaacda1e437fff8d54dc89c487.tar.gz llvm-f7443905af1e06eaacda1e437fff8d54dc89c487.tar.bz2 |
[Statepoint] Handle `undef` operands in statepoint.
Currently when spilling statepoint register operands in FixupStatepoints
we do not pay attention that it might be `undef`. We just generate a
spill, which may lead to verifier error because we have a use without def.
To handle it, let FixupStateponts ignore `undef` register operands
completely and change them to some constant value when generating
stack map. Use same value as used by ISel for this purpose (0xFEFEFEFE).
Reviewed By: reames
Differential Revision: https://reviews.llvm.org/D94703
Diffstat (limited to 'llvm/lib/CodeGen/StackMaps.cpp')
-rw-r--r-- | llvm/lib/CodeGen/StackMaps.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/StackMaps.cpp b/llvm/lib/CodeGen/StackMaps.cpp index 220e85f..faf07e9 100644 --- a/llvm/lib/CodeGen/StackMaps.cpp +++ b/llvm/lib/CodeGen/StackMaps.cpp @@ -234,6 +234,12 @@ StackMaps::parseOperand(MachineInstr::const_mop_iterator MOI, if (MOI->isImplicit()) return ++MOI; + if (MOI->isUndef()) { + // Record `undef` register as constant. Use same value as ISel uses. + Locs.emplace_back(Location::Constant, sizeof(int64_t), 0, 0xFEFEFEFE); + return ++MOI; + } + assert(Register::isPhysicalRegister(MOI->getReg()) && "Virtreg operands should have been rewritten before now."); const TargetRegisterClass *RC = TRI->getMinimalPhysRegClass(MOI->getReg()); |