|
LLVM
5.0.0
|
#include "MCTargetDesc/PPCMCTargetDesc.h"#include "MCTargetDesc/PPCPredicates.h"#include "PPC.h"#include "PPCISelLowering.h"#include "PPCMachineFunctionInfo.h"#include "PPCSubtarget.h"#include "PPCTargetMachine.h"#include "llvm/ADT/APInt.h"#include "llvm/ADT/DenseMap.h"#include "llvm/ADT/STLExtras.h"#include "llvm/ADT/SmallPtrSet.h"#include "llvm/ADT/SmallVector.h"#include "llvm/ADT/Statistic.h"#include "llvm/Analysis/BranchProbabilityInfo.h"#include "llvm/CodeGen/FunctionLoweringInfo.h"#include "llvm/CodeGen/ISDOpcodes.h"#include "llvm/CodeGen/MachineBasicBlock.h"#include "llvm/CodeGen/MachineFunction.h"#include "llvm/CodeGen/MachineInstrBuilder.h"#include "llvm/CodeGen/MachineRegisterInfo.h"#include "llvm/CodeGen/MachineValueType.h"#include "llvm/CodeGen/SelectionDAG.h"#include "llvm/CodeGen/SelectionDAGISel.h"#include "llvm/CodeGen/SelectionDAGNodes.h"#include "llvm/CodeGen/ValueTypes.h"#include "llvm/IR/BasicBlock.h"#include "llvm/IR/DebugLoc.h"#include "llvm/IR/Function.h"#include "llvm/IR/GlobalValue.h"#include "llvm/IR/InlineAsm.h"#include "llvm/IR/InstrTypes.h"#include "llvm/IR/Module.h"#include "llvm/Support/Casting.h"#include "llvm/Support/CodeGen.h"#include "llvm/Support/CommandLine.h"#include "llvm/Support/Compiler.h"#include "llvm/Support/Debug.h"#include "llvm/Support/ErrorHandling.h"#include "llvm/Support/KnownBits.h"#include "llvm/Support/MathExtras.h"#include "llvm/Support/raw_ostream.h"#include "llvm/Target/TargetInstrInfo.h"#include "llvm/Target/TargetRegisterInfo.h"#include <algorithm>#include <cassert>#include <cstdint>#include <iterator>#include <limits>#include <memory>#include <new>#include <tuple>#include <utility>#include "PPCGenDAGISel.inc"Go to the source code of this file.
Macros | |
| #define | DEBUG_TYPE "ppc-codegen" |
Functions | |
| STATISTIC (NumSextSetcc,"Number of (sext(setcc)) nodes expanded into GPR sequence.") | |
| STATISTIC (NumZextSetcc,"Number of (zext(setcc)) nodes expanded into GPR sequence.") | |
| STATISTIC (SignExtensionsAdded,"Number of sign extensions for compare inputs added.") | |
| STATISTIC (ZeroExtensionsAdded,"Number of zero extensions for compare inputs added.") | |
| STATISTIC (NumLogicOpsOnComparison,"Number of logical ops on i1 values calculated in GPR.") | |
| STATISTIC (OmittedForNonExtendUses,"Number of compares not eliminated as they have non-extending uses.") | |
| static bool | isInt32Immediate (SDNode *N, unsigned &Imm) |
| isInt32Immediate - This method tests to see if the node is a 32-bit constant operand. More... | |
| static bool | isInt64Immediate (SDNode *N, uint64_t &Imm) |
| isInt64Immediate - This method tests to see if the node is a 64-bit constant operand. More... | |
| static bool | isInt32Immediate (SDValue N, unsigned &Imm) |
| static unsigned | getBranchHint (unsigned PCC, FunctionLoweringInfo *FuncInfo, const SDValue &DestMBB) |
| static bool | isOpcWithIntImmediate (SDNode *N, unsigned Opc, unsigned &Imm) |
| static unsigned | getInt64CountDirect (int64_t Imm) |
| static uint64_t | Rot64 (uint64_t Imm, unsigned R) |
| static unsigned | getInt64Count (int64_t Imm) |
| static SDNode * | getInt64Direct (SelectionDAG *CurDAG, const SDLoc &dl, int64_t Imm) |
| static SDNode * | getInt64 (SelectionDAG *CurDAG, const SDLoc &dl, int64_t Imm) |
| static SDNode * | getInt64 (SelectionDAG *CurDAG, SDNode *N) |
| static PPC::Predicate | getPredicateForSetCC (ISD::CondCode CC) |
| static unsigned | getCRIdxForSetCC (ISD::CondCode CC, bool &Invert) |
| getCRIdxForSetCC - Return the index of the condition register field associated with the SetCC condition, and whether or not the field is treated as inverted. More... | |
| static unsigned int | getVCmpInst (MVT VecVT, ISD::CondCode CC, bool HasVSX, bool &Swap, bool &Negate) |
| static bool | isLogicOp (unsigned Opc) |
| static bool | allUsesExtend (SDValue Compare, SelectionDAG *CurDAG) |
| Does this SDValue have any uses for which keeping the value in a GPR is appropriate. More... | |
| static bool | PeepholePPC64ZExtGather (SDValue Op32, SmallPtrSetImpl< SDNode * > &ToPromote) |
Variables | |
| cl::opt< bool > | ANDIGlueBug ("expose-ppc-andi-glue-bug", cl::desc("expose the ANDI glue bug on PPC"), cl::Hidden) |
| static cl::opt< bool > | UseBitPermRewriter ("ppc-use-bit-perm-rewriter", cl::init(true), cl::desc("use aggressive ppc isel for bit permutations"), cl::Hidden) |
| static cl::opt< bool > | BPermRewriterNoMasking ("ppc-bit-perm-rewriter-stress-rotates", cl::desc("stress rotate selection in aggressive ppc isel for ""bit permutations"), cl::Hidden) |
| static cl::opt< bool > | EnableBranchHint ("ppc-use-branch-hint", cl::init(true), cl::desc("Enable static hinting of branches on ppc"), cl::Hidden) |
| #define DEBUG_TYPE "ppc-codegen" |
Definition at line 70 of file PPCISelDAGToDAG.cpp.
|
static |
Does this SDValue have any uses for which keeping the value in a GPR is appropriate.
This is meant to be used on values that have type i1 since it is somewhat meaningless to ask if values of other types can be kept in GPR's.
Definition at line 2933 of file PPCISelDAGToDAG.cpp.
References assert(), llvm::SDValue::getNode(), llvm::SDValue::getOpcode(), llvm::SDValue::hasOneUse(), isLogicOp(), llvm::ISD::SELECT, llvm::ISD::SETCC, llvm::ISD::SIGN_EXTEND, llvm::SDNode::uses(), and llvm::ISD::ZERO_EXTEND.
|
static |
Definition at line 453 of file PPCISelDAGToDAG.cpp.
References assert(), llvm::FunctionLoweringInfo::BPI, llvm::PPC::BR_NO_HINT, llvm::PPC::BR_NONTAKEN_HINT, llvm::PPC::BR_TAKEN_HINT, llvm::dbgs(), DEBUG, llvm::FunctionLoweringInfo::Fn, llvm::MachineBasicBlock::getBasicBlock(), llvm::BranchProbabilityInfo::getEdgeProbability(), llvm::Value::getName(), llvm::TerminatorInst::getNumSuccessors(), llvm::TerminatorInst::getSuccessor(), llvm::BasicBlock::getTerminator(), llvm::max(), llvm::FunctionLoweringInfo::MBB, fuzzer::min(), std::swap(), and Threshold.
|
static |
getCRIdxForSetCC - Return the index of the condition register field associated with the SetCC condition, and whether or not the field is treated as inverted.
That is, lt = 0; ge = 0 inverted.
Definition at line 2215 of file PPCISelDAGToDAG.cpp.
References llvm_unreachable(), llvm::ISD::SETEQ, llvm::ISD::SETGE, llvm::ISD::SETGT, llvm::ISD::SETLE, llvm::ISD::SETLT, llvm::ISD::SETNE, llvm::ISD::SETO, llvm::ISD::SETOEQ, llvm::ISD::SETOGE, llvm::ISD::SETOGT, llvm::ISD::SETOLE, llvm::ISD::SETOLT, llvm::ISD::SETONE, llvm::ISD::SETUEQ, llvm::ISD::SETUGE, llvm::ISD::SETUGT, llvm::ISD::SETULE, llvm::ISD::SETULT, llvm::ISD::SETUNE, and llvm::ISD::SETUO.
|
static |
Definition at line 828 of file PPCISelDAGToDAG.cpp.
References llvm::findLastSet(), getInt64CountDirect(), getInt64Direct(), llvm::SelectionDAG::getMachineNode(), llvm::SelectionDAG::getTargetConstant(), llvm::MVT::i32, llvm::MVT::i64, llvm::AArch64CC::LS, and Rot64().
Referenced by getInt64().
|
static |
Definition at line 888 of file PPCISelDAGToDAG.cpp.
References getInt64(), and N.
|
static |
Definition at line 715 of file PPCISelDAGToDAG.cpp.
References llvm::findLastSet(), getInt64CountDirect(), llvm::AArch64CC::LS, fuzzer::min(), and Rot64().
|
static |
Definition at line 647 of file PPCISelDAGToDAG.cpp.
References llvm::isInt< 16 >(), llvm::isInt< 32 >(), and llvm::MipsISD::Lo.
Referenced by getInt64(), and getInt64Count().
|
static |
Definition at line 745 of file PPCISelDAGToDAG.cpp.
References llvm::SelectionDAG::getMachineNode(), llvm::SelectionDAG::getTargetConstant(), llvm::MipsISD::Hi, llvm::MVT::i32, llvm::MVT::i64, llvm::isInt< 16 >(), llvm::isInt< 32 >(), and llvm::MipsISD::Lo.
Referenced by getInt64().
|
static |
Definition at line 2184 of file PPCISelDAGToDAG.cpp.
References llvm_unreachable(), llvm::PPC::PRED_EQ, llvm::PPC::PRED_GE, llvm::PPC::PRED_GT, llvm::PPC::PRED_LE, llvm::PPC::PRED_LT, llvm::PPC::PRED_NE, llvm::PPC::PRED_NU, llvm::PPC::PRED_UN, llvm::ISD::SETEQ, llvm::ISD::SETGE, llvm::ISD::SETGT, llvm::ISD::SETLE, llvm::ISD::SETLT, llvm::ISD::SETNE, llvm::ISD::SETO, llvm::ISD::SETOEQ, llvm::ISD::SETOGE, llvm::ISD::SETOGT, llvm::ISD::SETOLE, llvm::ISD::SETOLT, llvm::ISD::SETONE, llvm::ISD::SETUEQ, llvm::ISD::SETUGE, llvm::ISD::SETUGT, llvm::ISD::SETULE, llvm::ISD::SETULT, llvm::ISD::SETUNE, and llvm::ISD::SETUO.
|
static |
Definition at line 2247 of file PPCISelDAGToDAG.cpp.
References llvm::MVT::isFloatingPoint(), llvm_unreachable(), llvm::ISD::SETEQ, llvm::ISD::SETGE, llvm::ISD::SETGT, llvm::ISD::SETLE, llvm::ISD::SETLT, llvm::ISD::SETNE, llvm::ISD::SETOEQ, llvm::ISD::SETOGE, llvm::ISD::SETOGT, llvm::ISD::SETOLE, llvm::ISD::SETOLT, llvm::ISD::SETUEQ, llvm::ISD::SETUGE, llvm::ISD::SETUGT, llvm::ISD::SETULE, llvm::ISD::SETULT, llvm::ISD::SETUNE, llvm::MVT::v16i8, llvm::MVT::v2f64, llvm::MVT::v2i64, llvm::MVT::v4f32, llvm::MVT::v4i32, and llvm::MVT::v8i16.
isInt32Immediate - This method tests to see if the node is a 32-bit constant operand.
If so Imm will receive the 32-bit value.
Definition at line 429 of file PPCISelDAGToDAG.cpp.
References llvm::ISD::Constant, llvm::SDNode::getOpcode(), llvm::SDNode::getValueType(), llvm::MVT::i32, and N.
Referenced by isInt32Immediate(), and isOpcWithIntImmediate().
Definition at line 449 of file PPCISelDAGToDAG.cpp.
References llvm::SDValue::getNode(), and isInt32Immediate().
isInt64Immediate - This method tests to see if the node is a 64-bit constant operand.
If so Imm will receive the 64-bit value.
Definition at line 439 of file PPCISelDAGToDAG.cpp.
References llvm::ISD::Constant, llvm::SDNode::getOpcode(), llvm::SDNode::getValueType(), llvm::MVT::i64, and N.
Definition at line 2508 of file PPCISelDAGToDAG.cpp.
References llvm::ISD::AND, llvm::ISD::OR, and llvm::ISD::XOR.
Referenced by allUsesExtend().
Definition at line 506 of file PPCISelDAGToDAG.cpp.
References llvm::SDValue::getNode(), llvm::SDNode::getOpcode(), llvm::SDNode::getOperand(), and isInt32Immediate().
|
static |
Definition at line 4607 of file PPCISelDAGToDAG.cpp.
References llvm::ISD::AND, B, llvm::SmallPtrSetImpl< PtrType >::begin(), llvm::SmallPtrSetImpl< PtrType >::end(), llvm::SDValue::getConstantOperandVal(), llvm::SDValue::getMachineOpcode(), llvm::SDValue::getNode(), llvm::SDValue::getOperand(), llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::SDValue::isMachineOpcode(), and OR.
|
static |
Definition at line 711 of file PPCISelDAGToDAG.cpp.
Referenced by getInt64(), and getInt64Count().
| STATISTIC | ( | NumSextSetcc | , |
| "Number of (sext(setcc)) nodes expanded into GPR sequence." | |||
| ) |
| STATISTIC | ( | NumZextSetcc | , |
| "Number of (zext(setcc)) nodes expanded into GPR sequence." | |||
| ) |
| STATISTIC | ( | SignExtensionsAdded | , |
| "Number of sign extensions for compare inputs added." | |||
| ) |
| STATISTIC | ( | ZeroExtensionsAdded | , |
| "Number of zero extensions for compare inputs added." | |||
| ) |
| STATISTIC | ( | NumLogicOpsOnComparison | , |
| "Number of logical ops on i1 values calculated in GPR." | |||
| ) |
| STATISTIC | ( | OmittedForNonExtendUses | , |
| "Number of compares not eliminated as they have non-extending uses." | |||
| ) |
| cl::opt<bool> ANDIGlueBug("expose-ppc-andi-glue-bug", cl::desc("expose the ANDI glue bug on PPC"), cl::Hidden) |
Referenced by llvm::PPCTargetLowering::PPCTargetLowering().
|
static |
|
static |
1.8.6