Fix silly bug in vector scale extraction optimization.
(Introduced in f20a2d2ee. How did this ever pass tests?)
This commit is contained in:
4
opt.cpp
4
opt.cpp
@@ -1443,7 +1443,7 @@ lExtract248Scale(llvm::Value *splatOperand, int splatValue,
|
|||||||
Assert(insertBefore != NULL);
|
Assert(insertBefore != NULL);
|
||||||
|
|
||||||
if ((splatValue % scale) == 0) {
|
if ((splatValue % scale) == 0) {
|
||||||
// *result = otherOperand + splatOperand / splatValue;
|
// *result = otherOperand * splatOperand / scale;
|
||||||
llvm::Value *splatScaleVec =
|
llvm::Value *splatScaleVec =
|
||||||
(splatOperand->getType() == LLVMTypes::Int32VectorType) ?
|
(splatOperand->getType() == LLVMTypes::Int32VectorType) ?
|
||||||
LLVMInt32Vector(scale) : LLVMInt64Vector(scale);
|
LLVMInt32Vector(scale) : LLVMInt64Vector(scale);
|
||||||
@@ -1452,7 +1452,7 @@ lExtract248Scale(llvm::Value *splatOperand, int splatValue,
|
|||||||
splatOperand, splatScaleVec,
|
splatOperand, splatScaleVec,
|
||||||
"div", insertBefore);
|
"div", insertBefore);
|
||||||
*result =
|
*result =
|
||||||
llvm::BinaryOperator::Create(llvm::Instruction::Add,
|
llvm::BinaryOperator::Create(llvm::Instruction::Mul,
|
||||||
splatDiv, otherOperand,
|
splatDiv, otherOperand,
|
||||||
"add", insertBefore);
|
"add", insertBefore);
|
||||||
return LLVMInt32(scale);
|
return LLVMInt32(scale);
|
||||||
|
|||||||
Reference in New Issue
Block a user