diff options
| author | Sanjay Patel <spatel@rotateright.com> | 2018-12-04 18:53:27 +0000 |
|---|---|---|
| committer | Sanjay Patel <spatel@rotateright.com> | 2018-12-04 18:53:27 +0000 |
| commit | 3d5bb15a1dd26adacd155369363e96b96e61eefd (patch) | |
| tree | 9e85fcb2d5c6308a2c6f7eeb84f8cd26beafe46b /llvm/lib/Analysis | |
| parent | a592aeb35a4fc4d52dcb1a67d410dc756f12d3ea (diff) | |
| download | bcm5719-llvm-3d5bb15a1dd26adacd155369363e96b96e61eefd.tar.gz bcm5719-llvm-3d5bb15a1dd26adacd155369363e96b96e61eefd.zip | |
[CmpInstAnalysis] fix function signature for ICmp code to predicate; NFC
The old function underspecified the return type, took an unused parameter,
and had a misleading name.
llvm-svn: 348292
Diffstat (limited to 'llvm/lib/Analysis')
| -rw-r--r-- | llvm/lib/Analysis/CmpInstAnalysis.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/llvm/lib/Analysis/CmpInstAnalysis.cpp b/llvm/lib/Analysis/CmpInstAnalysis.cpp index 42471fe0f14..27071babec5 100644 --- a/llvm/lib/Analysis/CmpInstAnalysis.cpp +++ b/llvm/lib/Analysis/CmpInstAnalysis.cpp @@ -40,20 +40,20 @@ unsigned llvm::getICmpCode(const ICmpInst *ICI, bool InvertPred) { } } -Value *llvm::getICmpValue(bool Sign, unsigned Code, Value *LHS, Value *RHS, - CmpInst::Predicate &NewICmpPred) { +Constant *llvm::getPredForICmpCode(unsigned Code, bool Sign, Type *OpTy, + CmpInst::Predicate &Pred) { switch (Code) { default: llvm_unreachable("Illegal ICmp code!"); case 0: // False. - return ConstantInt::get(CmpInst::makeCmpResultType(LHS->getType()), 0); - case 1: NewICmpPred = Sign ? ICmpInst::ICMP_SGT : ICmpInst::ICMP_UGT; break; - case 2: NewICmpPred = ICmpInst::ICMP_EQ; break; - case 3: NewICmpPred = Sign ? ICmpInst::ICMP_SGE : ICmpInst::ICMP_UGE; break; - case 4: NewICmpPred = Sign ? ICmpInst::ICMP_SLT : ICmpInst::ICMP_ULT; break; - case 5: NewICmpPred = ICmpInst::ICMP_NE; break; - case 6: NewICmpPred = Sign ? ICmpInst::ICMP_SLE : ICmpInst::ICMP_ULE; break; + return ConstantInt::get(CmpInst::makeCmpResultType(OpTy), 0); + case 1: Pred = Sign ? ICmpInst::ICMP_SGT : ICmpInst::ICMP_UGT; break; + case 2: Pred = ICmpInst::ICMP_EQ; break; + case 3: Pred = Sign ? ICmpInst::ICMP_SGE : ICmpInst::ICMP_UGE; break; + case 4: Pred = Sign ? ICmpInst::ICMP_SLT : ICmpInst::ICMP_ULT; break; + case 5: Pred = ICmpInst::ICMP_NE; break; + case 6: Pred = Sign ? ICmpInst::ICMP_SLE : ICmpInst::ICMP_ULE; break; case 7: // True. - return ConstantInt::get(CmpInst::makeCmpResultType(LHS->getType()), 1); + return ConstantInt::get(CmpInst::makeCmpResultType(OpTy), 1); } return nullptr; } |

