diff options
| author | Nick Lewycky <nicholas@mxc.ca> | 2008-01-28 03:48:02 +0000 |
|---|---|---|
| committer | Nick Lewycky <nicholas@mxc.ca> | 2008-01-28 03:48:02 +0000 |
| commit | 4189a538e4ae10e6ed359b07cdcc96fd0822c811 (patch) | |
| tree | 7bec3284da2ad606d0a1fec9d5e75fd5db2bab30 /lib/VMCore | |
| parent | 25feae555d7c50c35a156373fa79ce50453746fd (diff) | |
| download | external_llvm-4189a538e4ae10e6ed359b07cdcc96fd0822c811.zip external_llvm-4189a538e4ae10e6ed359b07cdcc96fd0822c811.tar.gz external_llvm-4189a538e4ae10e6ed359b07cdcc96fd0822c811.tar.bz2 | |
Handle some more combinations of extend and icmp. Fixes PR1940.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46431 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
| -rw-r--r-- | lib/VMCore/Instructions.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/VMCore/Instructions.cpp b/lib/VMCore/Instructions.cpp index 156eff1..b945a5a 100644 --- a/lib/VMCore/Instructions.cpp +++ b/lib/VMCore/Instructions.cpp @@ -2429,6 +2429,19 @@ ICmpInst::Predicate ICmpInst::getSignedPredicate(Predicate pred) { } } +ICmpInst::Predicate ICmpInst::getUnsignedPredicate(Predicate pred) { + switch (pred) { + default: assert(! "Unknown icmp predicate!"); + case ICMP_EQ: case ICMP_NE: + case ICMP_UGT: case ICMP_ULT: case ICMP_UGE: case ICMP_ULE: + return pred; + case ICMP_SGT: return ICMP_UGT; + case ICMP_SLT: return ICMP_ULT; + case ICMP_SGE: return ICMP_UGE; + case ICMP_SLE: return ICMP_ULE; + } +} + bool ICmpInst::isSignedPredicate(Predicate pred) { switch (pred) { default: assert(! "Unknown icmp predicate!"); |
