From 0892a2245e9a7188e33c16444499c47942d1e56f Mon Sep 17 00:00:00 2001 From: vanhauser-thc Date: Mon, 13 May 2024 20:28:50 +0200 Subject: float laf check --- instrumentation/split-compares-pass.so.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/instrumentation/split-compares-pass.so.cc b/instrumentation/split-compares-pass.so.cc index 9b7bf256..effafe50 100644 --- a/instrumentation/split-compares-pass.so.cc +++ b/instrumentation/split-compares-pass.so.cc @@ -266,8 +266,11 @@ bool SplitComparesTransform::simplifyFPCompares(Module &M) { /* this is probably not needed but we do it anyway */ if (TyOp0 != TyOp1) { continue; } - if (TyOp0->isArrayTy() || TyOp0->isVectorTy()) { continue; } + int constants = 0; + if (llvm::isa(op0)) { ++constants; } + if (llvm::isa(op1)) { ++constants; } + if (constants != 1) { continue; } fcomps.push_back(selectcmpInst); -- cgit 1.4.1