Fix build with LLVM 3.2 and generic-4 / examples/sse4.h target.
This commit is contained in:
@@ -2532,7 +2532,7 @@ static FORCEINLINE int16_t __reduce_add_int8(__vec4_i8 v) {
|
|||||||
// TODO: improve
|
// TODO: improve
|
||||||
int16_t ret = 0;
|
int16_t ret = 0;
|
||||||
for (int i = 0; i < 4; ++i)
|
for (int i = 0; i < 4; ++i)
|
||||||
ret += v.v[i];
|
ret += __extract_element(v, i);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2540,7 +2540,7 @@ static FORCEINLINE int32_t __reduce_add_int16(__vec4_i16 v) {
|
|||||||
// TODO: improve
|
// TODO: improve
|
||||||
int32_t ret = 0;
|
int32_t ret = 0;
|
||||||
for (int i = 0; i < 4; ++i)
|
for (int i = 0; i < 4; ++i)
|
||||||
ret += v.v[i];
|
ret += __extract_element(v, i);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
8
opt.cpp
8
opt.cpp
@@ -4556,7 +4556,7 @@ PeepholePass::PeepholePass()
|
|||||||
: BasicBlockPass(ID) {
|
: BasicBlockPass(ID) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef LLVM_3_1
|
#if !defined(LLVM_3_1) && !defined(LLVM_3_2)
|
||||||
|
|
||||||
using namespace llvm::PatternMatch;
|
using namespace llvm::PatternMatch;
|
||||||
|
|
||||||
@@ -4877,7 +4877,7 @@ lMatchAvgDownInt16(llvm::Value *inst) {
|
|||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
#endif // !LLVM_3_1
|
#endif // !LLVM_3_1 && !LLVM_3_2
|
||||||
|
|
||||||
bool
|
bool
|
||||||
PeepholePass::runOnBasicBlock(llvm::BasicBlock &bb) {
|
PeepholePass::runOnBasicBlock(llvm::BasicBlock &bb) {
|
||||||
@@ -4889,7 +4889,7 @@ PeepholePass::runOnBasicBlock(llvm::BasicBlock &bb) {
|
|||||||
llvm::Instruction *inst = &*iter;
|
llvm::Instruction *inst = &*iter;
|
||||||
|
|
||||||
llvm::Instruction *builtinCall = NULL;
|
llvm::Instruction *builtinCall = NULL;
|
||||||
#ifndef LLVM_3_1
|
#if !defined(LLVM_3_1) && !defined(LLVM_3_2)
|
||||||
if (!builtinCall)
|
if (!builtinCall)
|
||||||
builtinCall = lMatchAvgUpUInt8(inst);
|
builtinCall = lMatchAvgUpUInt8(inst);
|
||||||
if (!builtinCall)
|
if (!builtinCall)
|
||||||
@@ -4906,7 +4906,7 @@ PeepholePass::runOnBasicBlock(llvm::BasicBlock &bb) {
|
|||||||
builtinCall = lMatchAvgDownInt8(inst);
|
builtinCall = lMatchAvgDownInt8(inst);
|
||||||
if (!builtinCall)
|
if (!builtinCall)
|
||||||
builtinCall = lMatchAvgDownInt16(inst);
|
builtinCall = lMatchAvgDownInt16(inst);
|
||||||
#endif // LLVM_3_1
|
#endif // !LLVM_3_1 && !LLVM_3_2
|
||||||
if (builtinCall != NULL) {
|
if (builtinCall != NULL) {
|
||||||
llvm::ReplaceInstWithInst(inst, builtinCall);
|
llvm::ReplaceInstWithInst(inst, builtinCall);
|
||||||
modifiedAny = true;
|
modifiedAny = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user