about summary refs log tree commit diff
path: root/instrumentation/split-compares-pass.so.cc
diff options
context:
space:
mode:
Diffstat (limited to 'instrumentation/split-compares-pass.so.cc')
-rw-r--r--instrumentation/split-compares-pass.so.cc21
1 files changed, 20 insertions, 1 deletions
diff --git a/instrumentation/split-compares-pass.so.cc b/instrumentation/split-compares-pass.so.cc
index d7bb7aba..375de065 100644
--- a/instrumentation/split-compares-pass.so.cc
+++ b/instrumentation/split-compares-pass.so.cc
@@ -566,8 +566,17 @@ bool SplitComparesTransform::splitCompare(CmpInst *cmp_inst, Module &M,
     case CmpInst::ICMP_NE:
     case CmpInst::ICMP_UGT:
     case CmpInst::ICMP_ULT:
+    case CmpInst::ICMP_UGE:
+    case CmpInst::ICMP_ULE:
+    case CmpInst::ICMP_SGT:
+    case CmpInst::ICMP_SLT:
+    case CmpInst::ICMP_SGE:
+    case CmpInst::ICMP_SLE:
       break;
     default:
+      if (!be_quiet)
+        fprintf(stderr, "Error: split-compare: Unsupported predicate (%u)\n",
+                pred);
       // unsupported predicate!
       return false;
 
@@ -581,6 +590,7 @@ bool SplitComparesTransform::splitCompare(CmpInst *cmp_inst, Module &M,
   if (!intTyOp0) {
 
     // not an integer type
+    fprintf(stderr, "Error: split-compare: not an integer type\n");
     return false;
 
   }
@@ -675,6 +685,12 @@ bool SplitComparesTransform::splitCompare(CmpInst *cmp_inst, Module &M,
 
     }
 
+    case CmpInst::ICMP_SGE:
+    case CmpInst::ICMP_SLE:
+    case CmpInst::ICMP_SGT:
+    case CmpInst::ICMP_SLT:
+    case CmpInst::ICMP_UGE:
+    case CmpInst::ICMP_ULE:
     case CmpInst::ICMP_UGT:
     case CmpInst::ICMP_ULT: {
 
@@ -687,7 +703,8 @@ bool SplitComparesTransform::splitCompare(CmpInst *cmp_inst, Module &M,
       CmpInst *    icmp_inv_cmp = nullptr;
       BasicBlock * inv_cmp_bb =
           BasicBlock::Create(C, "inv_cmp", end_bb->getParent(), end_bb);
-      if (pred == CmpInst::ICMP_UGT) {
+      if (pred == CmpInst::ICMP_UGT || pred == CmpInst::ICMP_SGT ||
+          pred == CmpInst::ICMP_UGE || pred == CmpInst::ICMP_SGE) {
 
         icmp_inv_cmp = CmpInst::Create(Instruction::ICmp, CmpInst::ICMP_ULT,
                                        op0_high, op1_high);
@@ -729,6 +746,8 @@ bool SplitComparesTransform::splitCompare(CmpInst *cmp_inst, Module &M,
     }
 
     default:
+      if (!be_quiet)
+        fprintf(stderr, "Error: split-compare: should not happen\n");
       return false;
 
   }