From ec737f3368e678cbee3a916d4ef6fb683ebfa1f0 Mon Sep 17 00:00:00 2001 From: vanhauser-thc Date: Thu, 4 Feb 2021 18:57:27 +0100 Subject: workaroung for llvm LTO bitcast bug --- instrumentation/cmplog-instructions-pass.cc | 23 ++--------------------- 1 file 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) { -- cgit 1.4.1