diff options
Diffstat (limited to 'contrib/llvm-project/llvm/lib/CodeGen/Analysis.cpp')
| -rw-r--r-- | contrib/llvm-project/llvm/lib/CodeGen/Analysis.cpp | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/contrib/llvm-project/llvm/lib/CodeGen/Analysis.cpp b/contrib/llvm-project/llvm/lib/CodeGen/Analysis.cpp index e5d576d879b5..7d8a73e12d3a 100644 --- a/contrib/llvm-project/llvm/lib/CodeGen/Analysis.cpp +++ b/contrib/llvm-project/llvm/lib/CodeGen/Analysis.cpp @@ -221,9 +221,6 @@ ISD::CondCode llvm::getFCmpCodeWithoutNaN(ISD::CondCode CC) { } } -/// getICmpCondCode - Return the ISD condition code corresponding to -/// the given LLVM IR integer condition code. -/// ISD::CondCode llvm::getICmpCondCode(ICmpInst::Predicate Pred) { switch (Pred) { case ICmpInst::ICMP_EQ: return ISD::SETEQ; @@ -241,6 +238,33 @@ ISD::CondCode llvm::getICmpCondCode(ICmpInst::Predicate Pred) { } } +ICmpInst::Predicate llvm::getICmpCondCode(ISD::CondCode Pred) { + switch (Pred) { + case ISD::SETEQ: + return ICmpInst::ICMP_EQ; + case ISD::SETNE: + return ICmpInst::ICMP_NE; + case ISD::SETLE: + return ICmpInst::ICMP_SLE; + case ISD::SETULE: + return ICmpInst::ICMP_ULE; + case ISD::SETGE: + return ICmpInst::ICMP_SGE; + case ISD::SETUGE: + return ICmpInst::ICMP_UGE; + case ISD::SETLT: + return ICmpInst::ICMP_SLT; + case ISD::SETULT: + return ICmpInst::ICMP_ULT; + case ISD::SETGT: + return ICmpInst::ICMP_SGT; + case ISD::SETUGT: + return ICmpInst::ICMP_UGT; + default: + llvm_unreachable("Invalid ISD integer condition code!"); + } +} + static bool isNoopBitcast(Type *T1, Type *T2, const TargetLoweringBase& TLI) { return T1 == T2 || (T1->isPointerTy() && T2->isPointerTy()) || @@ -524,10 +548,8 @@ bool llvm::isInTailCallPosition(const CallBase &Call, const TargetMachine &TM) { if (&*BBI == &Call) break; // Debug info intrinsics do not get in the way of tail call optimization. - if (isa<DbgInfoIntrinsic>(BBI)) - continue; // Pseudo probe intrinsics do not block tail call optimization either. - if (isa<PseudoProbeInst>(BBI)) + if (BBI->isDebugOrPseudoInst()) continue; // A lifetime end, assume or noalias.decl intrinsic should not stop tail // call optimization. |
