Removed dirty workaround that fixed 'soa-18.ispc' test. It broke badly in a different scenario

This commit is contained in:
Anton Mitrokhin
2015-09-30 17:20:38 +03:00
parent 8bf8911893
commit 68e686df9f

View File

@@ -4185,28 +4185,30 @@ void CWriter::visitCallInst(llvm::CallInst &I) {
if (Callee->getName() == "malloc" || if (Callee->getName() == "malloc" ||
Callee->getName() == "_aligned_malloc") Callee->getName() == "_aligned_malloc")
Out << "(uint8_t *)"; 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") { //if (Callee->getName() == "__masked_store_i64") {
llvm::CallSite CS(&I); // llvm::CallSite CS(&I);
llvm::CallSite::arg_iterator AI = CS.arg_begin(); // llvm::CallSite::arg_iterator AI = CS.arg_begin();
// if (is_vec16_i64_ty(llvm::cast<llvm::PointerType>((*AI)->getType())->getElementType())) {
if (is_vec16_i64_ty(llvm::cast<llvm::PointerType>((*AI)->getType())->getElementType())) { // Out << "/* Replacing store of vec16_i64 val into &vec16_i64 pointer with a simple copy */\n";
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
// 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
// It would be better to replace this instruction with a masked copy // if (llvm::isa<llvm::GetElementPtrInst>(*AI)) {
if (llvm::isa<llvm::GetElementPtrInst>(*AI)) { // writeOperandDeref(*AI);
writeOperandDeref(*AI); // Out << " = __select(";
Out << " = __select("; // writeOperand(*(AI+2));
writeOperand(*(AI+2)); // Out << ", ";
Out << ", "; // writeOperand(*(AI+1));
writeOperand(*(AI+1)); // Out << ", ";
Out << ", "; // writeOperandDeref(*AI);
writeOperandDeref(*AI); // Out << ")";
Out << ")"; // return;
return; // }
} // }
} //}
}
if (NeedsCast) { if (NeedsCast) {
// Ok, just cast the pointer type. // Ok, just cast the pointer type.