diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2022-03-20 11:40:34 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2022-05-14 11:43:05 +0000 |
commit | 349cc55c9796c4596a5b9904cd3281af295f878f (patch) | |
tree | 410c5a785075730a35f1272ca6a7adf72222ad03 /contrib/llvm-project/llvm/lib/CodeGen/Analysis.cpp | |
parent | cb2ae6163174b90e999326ecec3699ee093a5d43 (diff) | |
parent | c0981da47d5696fe36474fcf86b4ce03ae3ff818 (diff) |
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. |