From 68e686df9fb0426918effb52ce187dfd997b22e5 Mon Sep 17 00:00:00 2001 From: Anton Mitrokhin Date: Wed, 30 Sep 2015 17:20:38 +0300 Subject: [PATCH] Removed dirty workaround that fixed 'soa-18.ispc' test. It broke badly in a different scenario --- cbackend.cpp | 44 +++++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/cbackend.cpp b/cbackend.cpp index 7eaa7abe..8433fe6b 100644 --- a/cbackend.cpp +++ b/cbackend.cpp @@ -4185,28 +4185,30 @@ void CWriter::visitCallInst(llvm::CallInst &I) { if (Callee->getName() == "malloc" || Callee->getName() == "_aligned_malloc") Out << "(uint8_t *)"; + + // This 'if' will fix 'soa-18.ispc' test (fails with optimizations off) + // Yet the way the case is fixed is quite dirty and leads to many other fails - if (Callee->getName() == "__masked_store_i64") { - llvm::CallSite CS(&I); - llvm::CallSite::arg_iterator AI = CS.arg_begin(); - - if (is_vec16_i64_ty(llvm::cast((*AI)->getType())->getElementType())) { - Out << "/* Replacing store of vec16_i64 val into &vec16_i64 pointer with a simple copy */\n"; - // If we are trying to get a pointer to from a vec16_i64 var - // It would be better to replace this instruction with a masked copy - if (llvm::isa(*AI)) { - writeOperandDeref(*AI); - Out << " = __select("; - writeOperand(*(AI+2)); - Out << ", "; - writeOperand(*(AI+1)); - Out << ", "; - writeOperandDeref(*AI); - Out << ")"; - return; - } - } - } + //if (Callee->getName() == "__masked_store_i64") { + // llvm::CallSite CS(&I); + // llvm::CallSite::arg_iterator AI = CS.arg_begin(); + // if (is_vec16_i64_ty(llvm::cast((*AI)->getType())->getElementType())) { + // Out << "/* Replacing store of vec16_i64 val into &vec16_i64 pointer with a simple copy */\n"; + // // If we are trying to get a pointer to from a vec16_i64 var + // // It would be better to replace this instruction with a masked copy + // if (llvm::isa(*AI)) { + // writeOperandDeref(*AI); + // Out << " = __select("; + // writeOperand(*(AI+2)); + // Out << ", "; + // writeOperand(*(AI+1)); + // Out << ", "; + // writeOperandDeref(*AI); + // Out << ")"; + // return; + // } + // } + //} if (NeedsCast) { // Ok, just cast the pointer type.