xref: /netbsd-src/external/apache2/llvm/dist/llvm/lib/Target/PowerPC/PPCCCState.cpp (revision 82d56013d7b633d116a93943de88e08335357a7c)
1*7330f729Sjoerg //===---- PPCCCState.cpp - CCState with PowerPC specific extensions ---------===//
2*7330f729Sjoerg //
3*7330f729Sjoerg // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4*7330f729Sjoerg // See https://llvm.org/LICENSE.txt for license information.
5*7330f729Sjoerg // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6*7330f729Sjoerg //
7*7330f729Sjoerg //===----------------------------------------------------------------------===//
8*7330f729Sjoerg 
9*7330f729Sjoerg #include "PPCCCState.h"
10*7330f729Sjoerg #include "PPCSubtarget.h"
11*7330f729Sjoerg #include "llvm/IR/Module.h"
12*7330f729Sjoerg using namespace llvm;
13*7330f729Sjoerg 
14*7330f729Sjoerg // Identify lowered values that originated from ppcf128 arguments and record
15*7330f729Sjoerg // this.
PreAnalyzeCallOperands(const SmallVectorImpl<ISD::OutputArg> & Outs)16*7330f729Sjoerg void PPCCCState::PreAnalyzeCallOperands(
17*7330f729Sjoerg     const SmallVectorImpl<ISD::OutputArg> &Outs) {
18*7330f729Sjoerg   for (const auto &I : Outs) {
19*7330f729Sjoerg     if (I.ArgVT == llvm::MVT::ppcf128)
20*7330f729Sjoerg       OriginalArgWasPPCF128.push_back(true);
21*7330f729Sjoerg     else
22*7330f729Sjoerg       OriginalArgWasPPCF128.push_back(false);
23*7330f729Sjoerg   }
24*7330f729Sjoerg }
25*7330f729Sjoerg 
PreAnalyzeFormalArguments(const SmallVectorImpl<ISD::InputArg> & Ins)26*7330f729Sjoerg void PPCCCState::PreAnalyzeFormalArguments(
27*7330f729Sjoerg     const SmallVectorImpl<ISD::InputArg> &Ins) {
28*7330f729Sjoerg   for (const auto &I : Ins) {
29*7330f729Sjoerg     if (I.ArgVT == llvm::MVT::ppcf128) {
30*7330f729Sjoerg       OriginalArgWasPPCF128.push_back(true);
31*7330f729Sjoerg     } else {
32*7330f729Sjoerg       OriginalArgWasPPCF128.push_back(false);
33*7330f729Sjoerg     }
34*7330f729Sjoerg   }
35*7330f729Sjoerg }
36