From f65a20c700a68e3d716f1bd4bdae964d0504dbb0 Mon Sep 17 00:00:00 2001 From: Matt Pharr Date: Wed, 31 Aug 2011 18:06:29 -0700 Subject: [PATCH] AVX bugfix: when replacing 'all on' masked store with a store, the rvalue is operand 2, not operand 1 (which is the mask!) --- opt.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opt.cpp b/opt.cpp index 05109806..e8a04b3e 100644 --- a/opt.cpp +++ b/opt.cpp @@ -630,7 +630,7 @@ IntrinsicsOpt::runOnBasicBlock(llvm::BasicBlock &bb) { } else if (mask == 0xff) { // all lanes storing, so replace with a regular store - llvm::Value *rvalue = callInst->getArgOperand(1); + llvm::Value *rvalue = callInst->getArgOperand(2); llvm::Type *storeType = rvalue->getType(); llvm::Value *castPtr = new llvm::BitCastInst(callInst->getArgOperand(0),