aboutsummaryrefslogtreecommitdiff
path: root/llvm_mode/split-compares-pass.so.cc
diff options
context:
space:
mode:
authorAndrea Fioraldi <andreafioraldi@gmail.com>2020-04-22 13:51:40 +0200
committerAndrea Fioraldi <andreafioraldi@gmail.com>2020-04-22 13:51:40 +0200
commitdf8a0e84184a408a463c29443cfa3ee9fa556896 (patch)
tree0257c84abe8b4f9859caf2f35244adc7146ee994 /llvm_mode/split-compares-pass.so.cc
parentb8a25063f678c8afe3c1390d6a6ba130b0500e26 (diff)
parent6df21f3489ea482362983eda7e51c040d06e56f1 (diff)
downloadafl++-df8a0e84184a408a463c29443cfa3ee9fa556896.tar.gz
Merge branch 'dev' of github.com:vanhauser-thc/AFLplusplus into dev
Diffstat (limited to 'llvm_mode/split-compares-pass.so.cc')
-rw-r--r--llvm_mode/split-compares-pass.so.cc41
1 files changed, 30 insertions, 11 deletions
diff --git a/llvm_mode/split-compares-pass.so.cc b/llvm_mode/split-compares-pass.so.cc
index f0615f85..7c657ebf 100644
--- a/llvm_mode/split-compares-pass.so.cc
+++ b/llvm_mode/split-compares-pass.so.cc
@@ -318,10 +318,18 @@ bool SplitComparesTransform::simplifyCompares(Module &M) {
CmpInst::Predicate new_pred;
switch (pred) {
- case CmpInst::ICMP_UGE: new_pred = CmpInst::ICMP_UGT; break;
- case CmpInst::ICMP_SGE: new_pred = CmpInst::ICMP_SGT; break;
- case CmpInst::ICMP_ULE: new_pred = CmpInst::ICMP_ULT; break;
- case CmpInst::ICMP_SLE: new_pred = CmpInst::ICMP_SLT; break;
+ case CmpInst::ICMP_UGE:
+ new_pred = CmpInst::ICMP_UGT;
+ break;
+ case CmpInst::ICMP_SGE:
+ new_pred = CmpInst::ICMP_SGT;
+ break;
+ case CmpInst::ICMP_ULE:
+ new_pred = CmpInst::ICMP_ULT;
+ break;
+ case CmpInst::ICMP_SLE:
+ new_pred = CmpInst::ICMP_SLT;
+ break;
default: // keep the compiler happy
continue;
@@ -384,10 +392,18 @@ bool SplitComparesTransform::simplifyCompares(Module &M) {
CmpInst::Predicate new_pred;
switch (pred) {
- case CmpInst::FCMP_UGE: new_pred = CmpInst::FCMP_UGT; break;
- case CmpInst::FCMP_OGE: new_pred = CmpInst::FCMP_OGT; break;
- case CmpInst::FCMP_ULE: new_pred = CmpInst::FCMP_ULT; break;
- case CmpInst::FCMP_OLE: new_pred = CmpInst::FCMP_OLT; break;
+ case CmpInst::FCMP_UGE:
+ new_pred = CmpInst::FCMP_UGT;
+ break;
+ case CmpInst::FCMP_OGE:
+ new_pred = CmpInst::FCMP_OGT;
+ break;
+ case CmpInst::FCMP_ULE:
+ new_pred = CmpInst::FCMP_ULT;
+ break;
+ case CmpInst::FCMP_OLE:
+ new_pred = CmpInst::FCMP_OLT;
+ break;
default: // keep the compiler happy
continue;
@@ -855,7 +871,8 @@ size_t SplitComparesTransform::splitFPCompares(Module &M) {
icmp_exponent_result =
BinaryOperator::Create(Instruction::Xor, icmp_exponent, t_s0);
break;
- default: continue;
+ default:
+ continue;
}
@@ -958,7 +975,8 @@ size_t SplitComparesTransform::splitFPCompares(Module &M) {
icmp_fraction_result =
BinaryOperator::Create(Instruction::Xor, icmp_fraction, t_s0);
break;
- default: continue;
+ default:
+ continue;
}
@@ -1004,7 +1022,8 @@ size_t SplitComparesTransform::splitFPCompares(Module &M) {
PN->addIncoming(icmp_exponent_result, signequal_bb);
PN->addIncoming(icmp_fraction_result, middle_bb);
break;
- default: continue;
+ default:
+ continue;
}