From 0bb27d839aba96282bb247b859810fc2e24a7354 Mon Sep 17 00:00:00 2001 From: Anton Mitrokhin Date: Fri, 13 Feb 2015 15:47:41 +0300 Subject: [PATCH 1/2] i32/64 to <1xi32/64> bitcast --- cbackend.cpp | 54 +++++----------------------------------------------- 1 file changed, 5 insertions(+), 49 deletions(-) diff --git a/cbackend.cpp b/cbackend.cpp index 8ae8c260..8b9d3f32 100644 --- a/cbackend.cpp +++ b/cbackend.cpp @@ -3628,6 +3628,11 @@ void CWriter::visitCastInst(llvm::CastInst &I) { return; } + if ((llvm::isa(DstTy)) && (!llvm::isa(SrcTy))) { + writeOperand(I.getOperand(0)); + return; + } + Out << '('; bool closeParen = printCast(I.getOpcode(), SrcTy, DstTy); @@ -4703,54 +4708,6 @@ SmearCleanupPass::runOnBasicBlock(llvm::BasicBlock &bb) { } -/////////////////////////////////////////////////////////////////////////// -// BitcastCleanupPass - -class BitcastCleanupPass : public llvm::BasicBlockPass { -public: - BitcastCleanupPass() - : BasicBlockPass(ID) { } - - const char *getPassName() const { return "Bitcast Cleanup Pass"; } - bool runOnBasicBlock(llvm::BasicBlock &BB); - - static char ID; -}; - -char BitcastCleanupPass::ID = 0; - -bool -BitcastCleanupPass::runOnBasicBlock(llvm::BasicBlock &bb) { - bool modifiedAny = false; - - restart: - for (llvm::BasicBlock::iterator iter = bb.begin(), e = bb.end(); iter != e; ++iter) { - llvm::BitCastInst *bc = llvm::dyn_cast(&*iter); - if (bc == NULL) - continue; - - // We only care about bitcasts from integer types to vector types - if (!llvm::isa(bc->getType())) - continue; - - llvm::Value *Op = bc->getOperand(0); - if (llvm::isa(Op->getType())) - continue; - - llvm::BitCastInst *opBc = llvm::dyn_cast(Op); - if (opBc == NULL) Op->dump(); - assert(opBc != NULL); - - assert(llvm::isa(opBc->getOperand(0)->getType())); - llvm::Instruction *newBitCast = new llvm::BitCastInst(opBc->getOperand(0), bc->getType(), - "replacement_bc", (llvm::Instruction *)NULL); - ReplaceInstWithInst(iter, newBitCast); - modifiedAny = true; - goto restart; - } - return modifiedAny; -} - /////////////////////////////////////////////////////////////////////////// // AndCmpCleanupPass @@ -5059,7 +5016,6 @@ WriteCXXFile(llvm::Module *module, const char *fn, int vectorWidth, pm.add(llvm::createLowerInvokePass()); pm.add(llvm::createCFGSimplificationPass()); // clean up after lower invoke. pm.add(new SmearCleanupPass(module, vectorWidth)); - pm.add(new BitcastCleanupPass()); pm.add(new AndCmpCleanupPass()); pm.add(new MaskOpsCleanupPass(module)); pm.add(llvm::createDeadCodeEliminationPass()); // clean up after smear pass From 33d47c2b53c289efeda1348279c0dc9bdc3c1c13 Mon Sep 17 00:00:00 2001 From: Anton Mitrokhin Date: Fri, 13 Feb 2015 16:15:07 +0300 Subject: [PATCH 2/2] update fail_db.txt --- fail_db.txt | 40 ---------------------------------------- 1 file changed, 40 deletions(-) diff --git a/fail_db.txt b/fail_db.txt index 58383450..1cc46294 100644 --- a/fail_db.txt +++ b/fail_db.txt @@ -469,25 +469,15 @@ ./tests/aossoa-6.ispc compfail x86-64 knc Linux LLVM 3.4 icpc13.1 -O0 * ./tests/aossoa-7.ispc compfail x86-64 knc Linux LLVM 3.4 icpc13.1 -O0 * ./tests/aossoa-8.ispc compfail x86-64 knc Linux LLVM 3.4 icpc13.1 -O0 * -./tests/atomics-1.ispc compfail x86-64 knc Linux LLVM 3.4 icpc15.0 -O0 * ./tests/atomics-1.ispc compfail x86-64 knc Linux LLVM 3.4 icpc13.1 -O0 * -./tests/atomics-10.ispc compfail x86-64 knc Linux LLVM 3.4 icpc15.0 -O0 * ./tests/atomics-10.ispc compfail x86-64 knc Linux LLVM 3.4 icpc13.1 -O0 * -./tests/atomics-11.ispc compfail x86-64 knc Linux LLVM 3.4 icpc15.0 -O0 * ./tests/atomics-11.ispc compfail x86-64 knc Linux LLVM 3.4 icpc13.1 -O0 * -./tests/atomics-12.ispc compfail x86-64 knc Linux LLVM 3.4 icpc15.0 -O0 * ./tests/atomics-12.ispc compfail x86-64 knc Linux LLVM 3.4 icpc13.1 -O0 * -./tests/atomics-13.ispc compfail x86-64 knc Linux LLVM 3.4 icpc15.0 -O0 * ./tests/atomics-13.ispc compfail x86-64 knc Linux LLVM 3.4 icpc13.1 -O0 * -./tests/atomics-14.ispc compfail x86-64 knc Linux LLVM 3.4 icpc15.0 -O0 * ./tests/atomics-14.ispc compfail x86-64 knc Linux LLVM 3.4 icpc13.1 -O0 * -./tests/atomics-2.ispc compfail x86-64 knc Linux LLVM 3.4 icpc15.0 -O0 * ./tests/atomics-2.ispc compfail x86-64 knc Linux LLVM 3.4 icpc13.1 -O0 * -./tests/atomics-3.ispc compfail x86-64 knc Linux LLVM 3.4 icpc15.0 -O0 * ./tests/atomics-3.ispc compfail x86-64 knc Linux LLVM 3.4 icpc13.1 -O0 * -./tests/atomics-4.ispc compfail x86-64 knc Linux LLVM 3.4 icpc15.0 -O0 * ./tests/atomics-4.ispc compfail x86-64 knc Linux LLVM 3.4 icpc13.1 -O0 * -./tests/atomics-9.ispc compfail x86-64 knc Linux LLVM 3.4 icpc15.0 -O0 * ./tests/atomics-9.ispc compfail x86-64 knc Linux LLVM 3.4 icpc13.1 -O0 * ./tests/exclusive-scan-add-1.ispc compfail x86-64 knc Linux LLVM 3.4 icpc13.1 -O0 * ./tests/exclusive-scan-add-10.ispc compfail x86-64 knc Linux LLVM 3.4 icpc13.1 -O0 * @@ -630,26 +620,16 @@ ./tests/aossoa-6.ispc compfail x86-64 knc Linux LLVM 3.5 icpc13.1 -O0 * ./tests/aossoa-7.ispc compfail x86-64 knc Linux LLVM 3.5 icpc13.1 -O0 * ./tests/aossoa-8.ispc compfail x86-64 knc Linux LLVM 3.5 icpc13.1 -O0 * -./tests/atomics-1.ispc compfail x86-64 knc Linux LLVM 3.5 icpc15.0 -O0 * ./tests/atomics-1.ispc compfail x86-64 knc Linux LLVM 3.5 icpc13.1 -O0 * -./tests/atomics-10.ispc compfail x86-64 knc Linux LLVM 3.5 icpc15.0 -O0 * ./tests/atomics-10.ispc compfail x86-64 knc Linux LLVM 3.5 icpc13.1 -O0 * -./tests/atomics-11.ispc compfail x86-64 knc Linux LLVM 3.5 icpc15.0 -O0 * ./tests/atomics-11.ispc compfail x86-64 knc Linux LLVM 3.5 icpc13.1 -O0 * -./tests/atomics-12.ispc compfail x86-64 knc Linux LLVM 3.5 icpc15.0 -O0 * ./tests/atomics-12.ispc compfail x86-64 knc Linux LLVM 3.5 icpc13.1 -O0 * -./tests/atomics-13.ispc compfail x86-64 knc Linux LLVM 3.5 icpc15.0 -O0 * ./tests/atomics-13.ispc compfail x86-64 knc Linux LLVM 3.5 icpc13.1 -O0 * -./tests/atomics-14.ispc compfail x86-64 knc Linux LLVM 3.5 icpc15.0 -O0 * ./tests/atomics-14.ispc compfail x86-64 knc Linux LLVM 3.5 icpc13.1 -O0 * -./tests/atomics-2.ispc compfail x86-64 knc Linux LLVM 3.5 icpc15.0 -O0 * ./tests/atomics-2.ispc compfail x86-64 knc Linux LLVM 3.5 icpc13.1 -O0 * -./tests/atomics-3.ispc compfail x86-64 knc Linux LLVM 3.5 icpc15.0 -O0 * ./tests/atomics-3.ispc compfail x86-64 knc Linux LLVM 3.5 icpc13.1 -O0 * -./tests/atomics-4.ispc compfail x86-64 knc Linux LLVM 3.5 icpc15.0 -O0 * ./tests/atomics-4.ispc compfail x86-64 knc Linux LLVM 3.5 icpc13.1 -O0 * ./tests/atomics-6.ispc compfail x86-64 knc Linux LLVM 3.5 icpc13.1 -O0 * -./tests/atomics-9.ispc compfail x86-64 knc Linux LLVM 3.5 icpc15.0 -O0 * ./tests/atomics-9.ispc compfail x86-64 knc Linux LLVM 3.5 icpc13.1 -O0 * ./tests/atomics-uniform-8.ispc compfail x86-64 knc Linux LLVM 3.5 icpc13.1 -O0 * ./tests/atomics-uniform-9.ispc compfail x86-64 knc Linux LLVM 3.5 icpc13.1 -O0 * @@ -794,26 +774,16 @@ ./tests/aossoa-6.ispc compfail x86-64 knc Linux LLVM 3.6 icpc13.1 -O0 * ./tests/aossoa-7.ispc compfail x86-64 knc Linux LLVM 3.6 icpc13.1 -O0 * ./tests/aossoa-8.ispc compfail x86-64 knc Linux LLVM 3.6 icpc13.1 -O0 * -./tests/atomics-1.ispc compfail x86-64 knc Linux LLVM 3.6 icpc15.0 -O0 * ./tests/atomics-1.ispc compfail x86-64 knc Linux LLVM 3.6 icpc13.1 -O0 * -./tests/atomics-10.ispc compfail x86-64 knc Linux LLVM 3.6 icpc15.0 -O0 * ./tests/atomics-10.ispc compfail x86-64 knc Linux LLVM 3.6 icpc13.1 -O0 * -./tests/atomics-11.ispc compfail x86-64 knc Linux LLVM 3.6 icpc15.0 -O0 * ./tests/atomics-11.ispc compfail x86-64 knc Linux LLVM 3.6 icpc13.1 -O0 * -./tests/atomics-12.ispc compfail x86-64 knc Linux LLVM 3.6 icpc15.0 -O0 * ./tests/atomics-12.ispc compfail x86-64 knc Linux LLVM 3.6 icpc13.1 -O0 * -./tests/atomics-13.ispc compfail x86-64 knc Linux LLVM 3.6 icpc15.0 -O0 * ./tests/atomics-13.ispc compfail x86-64 knc Linux LLVM 3.6 icpc13.1 -O0 * -./tests/atomics-14.ispc compfail x86-64 knc Linux LLVM 3.6 icpc15.0 -O0 * ./tests/atomics-14.ispc compfail x86-64 knc Linux LLVM 3.6 icpc13.1 -O0 * -./tests/atomics-2.ispc compfail x86-64 knc Linux LLVM 3.6 icpc15.0 -O0 * ./tests/atomics-2.ispc compfail x86-64 knc Linux LLVM 3.6 icpc13.1 -O0 * -./tests/atomics-3.ispc compfail x86-64 knc Linux LLVM 3.6 icpc15.0 -O0 * ./tests/atomics-3.ispc compfail x86-64 knc Linux LLVM 3.6 icpc13.1 -O0 * -./tests/atomics-4.ispc compfail x86-64 knc Linux LLVM 3.6 icpc15.0 -O0 * ./tests/atomics-4.ispc compfail x86-64 knc Linux LLVM 3.6 icpc13.1 -O0 * ./tests/atomics-6.ispc compfail x86-64 knc Linux LLVM 3.6 icpc13.1 -O0 * -./tests/atomics-9.ispc compfail x86-64 knc Linux LLVM 3.6 icpc15.0 -O0 * ./tests/atomics-9.ispc compfail x86-64 knc Linux LLVM 3.6 icpc13.1 -O0 * ./tests/atomics-uniform-8.ispc compfail x86-64 knc Linux LLVM 3.6 icpc13.1 -O0 * ./tests/atomics-uniform-9.ispc compfail x86-64 knc Linux LLVM 3.6 icpc13.1 -O0 * @@ -1018,13 +988,3 @@ ./tests/funcptr-varying-7.ispc runfail x86-64 knc Linux LLVM 3.7 icpc15.0 -O0 * ./tests/funcptr-varying-8.ispc runfail x86-64 knc Linux LLVM 3.7 icpc15.0 -O0 * ./tests/soa-18.ispc runfail x86-64 knc Linux LLVM 3.7 icpc15.0 -O0 * -./tests/atomics-1.ispc compfail x86-64 knc Linux LLVM 3.7 icpc15.0 -O0 * -./tests/atomics-10.ispc compfail x86-64 knc Linux LLVM 3.7 icpc15.0 -O0 * -./tests/atomics-11.ispc compfail x86-64 knc Linux LLVM 3.7 icpc15.0 -O0 * -./tests/atomics-12.ispc compfail x86-64 knc Linux LLVM 3.7 icpc15.0 -O0 * -./tests/atomics-13.ispc compfail x86-64 knc Linux LLVM 3.7 icpc15.0 -O0 * -./tests/atomics-14.ispc compfail x86-64 knc Linux LLVM 3.7 icpc15.0 -O0 * -./tests/atomics-2.ispc compfail x86-64 knc Linux LLVM 3.7 icpc15.0 -O0 * -./tests/atomics-3.ispc compfail x86-64 knc Linux LLVM 3.7 icpc15.0 -O0 * -./tests/atomics-4.ispc compfail x86-64 knc Linux LLVM 3.7 icpc15.0 -O0 * -./tests/atomics-9.ispc compfail x86-64 knc Linux LLVM 3.7 icpc15.0 -O0 *