diff options
| author | Tim Northover <tnorthover@apple.com> | 2017-02-08 17:57:20 +0000 |
|---|---|---|
| committer | Tim Northover <tnorthover@apple.com> | 2017-02-08 17:57:20 +0000 |
| commit | f19d467ff6c7c14af97b0bdc52f1980488fca0e3 (patch) | |
| tree | f3756bb377092a26251a082249080b32e7d41ce1 /llvm/lib/CodeGen | |
| parent | 3bceebb0e0644e97e4c0f181c2be5dc1554004cf (diff) | |
| download | bcm5719-llvm-f19d467ff6c7c14af97b0bdc52f1980488fca0e3.tar.gz bcm5719-llvm-f19d467ff6c7c14af97b0bdc52f1980488fca0e3.zip | |
GlobalISel: translate @llvm.va_start intrinsic.
Because we need to preserve the memory access being performed we need a
separate instruction to represent this.
llvm-svn: 294492
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp b/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp index eee78ea8cbc..8b06f4dc234 100644 --- a/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp +++ b/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp @@ -583,6 +583,17 @@ bool IRTranslator::translateKnownIntrinsic(const CallInst &CI, Intrinsic::ID ID, // No target I know of cares about va_end. Certainly no in-tree target // does. Simplest intrinsic ever! return true; + case Intrinsic::vastart: { + auto &TLI = *MF->getSubtarget().getTargetLowering(); + Value *Ptr = CI.getArgOperand(0); + unsigned ListSize = TLI.getVaListSizeInBits(*DL) / 8; + + MIRBuilder.buildInstr(TargetOpcode::G_VASTART) + .addUse(getOrCreateVReg(*Ptr)) + .addMemOperand(MF->getMachineMemOperand( + MachinePointerInfo(Ptr), MachineMemOperand::MOStore, ListSize, 0)); + return true; + } case Intrinsic::dbg_value: { // This form of DBG_VALUE is target-independent. const DbgValueInst &DI = cast<DbgValueInst>(CI); |

