Merge pull request #653 from jbrodman/master
Fix for Visual Studio compilation error.
This commit is contained in:
3
opt.cpp
3
opt.cpp
@@ -4982,7 +4982,7 @@ ReplaceStdlibShiftPass::runOnBasicBlock(llvm::BasicBlock &bb) {
|
|||||||
llvm::Value *shiftAmt = ci->getArgOperand(1);
|
llvm::Value *shiftAmt = ci->getArgOperand(1);
|
||||||
if (llvm::isa<llvm::Constant>(shiftAmt)) {
|
if (llvm::isa<llvm::Constant>(shiftAmt)) {
|
||||||
int vectorWidth = g->target->getVectorWidth();
|
int vectorWidth = g->target->getVectorWidth();
|
||||||
int shuffleVals[vectorWidth];
|
int * shuffleVals = new int[vectorWidth];
|
||||||
int shiftInt = lGetIntValue(shiftAmt);
|
int shiftInt = lGetIntValue(shiftAmt);
|
||||||
for (int i = 0; i < vectorWidth; i++) {
|
for (int i = 0; i < vectorWidth; i++) {
|
||||||
int s = i + shiftInt;
|
int s = i + shiftInt;
|
||||||
@@ -4996,6 +4996,7 @@ ReplaceStdlibShiftPass::runOnBasicBlock(llvm::BasicBlock &bb) {
|
|||||||
shuffleIdxs, "vecShift", ci);
|
shuffleIdxs, "vecShift", ci);
|
||||||
ci->replaceAllUsesWith(shuffle);
|
ci->replaceAllUsesWith(shuffle);
|
||||||
modifiedAny = true;
|
modifiedAny = true;
|
||||||
|
delete [] shuffleVals;
|
||||||
} else {
|
} else {
|
||||||
PerformanceWarning(SourcePos(), "Stdlib shift() called without constant shift amount.");
|
PerformanceWarning(SourcePos(), "Stdlib shift() called without constant shift amount.");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user