about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--instrumentation/cmplog-instructions-pass.cc23
1 files changed, 2 insertions, 21 deletions
diff --git a/instrumentation/cmplog-instructions-pass.cc b/instrumentation/cmplog-instructions-pass.cc
index d4bc0b38..b5cc1882 100644
--- a/instrumentation/cmplog-instructions-pass.cc
+++ b/instrumentation/cmplog-instructions-pass.cc
@@ -265,7 +265,7 @@ bool CmpLogInstructions::hookInstrs(Module &M) {
       unsigned int  max_size = Val->getType()->getIntegerBitWidth(), cast_size;
       unsigned char do_cast = 0;
 
-      if (!SI->getNumCases() || max_size <= 8) {
+      if (!SI->getNumCases() || max_size < 16 || max_size % 8) {
 
         // if (!be_quiet) errs() << "skip trivial switch..\n";
         continue;
@@ -275,17 +275,6 @@ bool CmpLogInstructions::hookInstrs(Module &M) {
       IRBuilder<> IRB(SI->getParent());
       IRB.SetInsertPoint(SI);
 
-      if (max_size % 8) {
-
-        // bitcast from i6 to i8 panics llvm, so ...
-        continue;
-        /*
-                max_size = (((max_size / 8) + 1) * 8);
-                do_cast = 1;
-        */
-
-      }
-
       if (max_size > 128) {
 
         if (!be_quiet) {
@@ -551,15 +540,7 @@ bool CmpLogInstructions::hookInstrs(Module &M) {
 
       }
 
-      if (!max_size) { continue; }
-
-      // _ExtInt() with non-8th values
-      if (max_size % 8) {
-
-        max_size = (((max_size / 8) + 1) * 8);
-        do_cast = 1;
-
-      }
+      if (!max_size || max_size % 8 || max_size < 16) { continue; }
 
       if (max_size > 128) {