From c565ec08ac19f3afa573f93fd4beac7af05244ae Mon Sep 17 00:00:00 2001 From: jbrodman Date: Thu, 13 Nov 2014 07:23:00 -0800 Subject: [PATCH] Disable optimization to eliminate illegal results --- opt.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/opt.cpp b/opt.cpp index ed975921..9afbd11c 100644 --- a/opt.cpp +++ b/opt.cpp @@ -1210,7 +1210,11 @@ InstructionSimplifyPass::simplifyBoolVec(llvm::Value *value) { zext->getOperand(0)->getType() == LLVMTypes::Int1VectorType) return zext->getOperand(0); } - + /* + // This optimization has discernable benefit on the perf + // suite on latest LLVM versions. + // On 3.4+ (maybe even older), it can result in illegal + // operations, so it's being disabled. llvm::ICmpInst *icmp = llvm::dyn_cast(value); if (icmp != NULL) { // icmp(ne, {sext,zext}(foo), zeroinitializer) -> foo @@ -1226,7 +1230,9 @@ InstructionSimplifyPass::simplifyBoolVec(llvm::Value *value) { return zext->getOperand(0); } } + } + */ return NULL; }