Fixing MIC performance issue, which showed up when we switched to

LLVM 3.4 (due to more aggressive optimizations): vector of *the same*
constants should be generated as scalar value in cpp file, instead of
__extract_element(splat(value), 0).
I.e. <2,2,2,2> should appear in cpp as 2, but not
__extract_element(splat(2), 0);
This commit is contained in:
Dmitry Babokin
2014-04-17 21:03:42 +04:00
parent 94467fdb70
commit 096546f888
3 changed files with 39 additions and 14 deletions

View File

@@ -228,7 +228,8 @@ extern llvm::Constant *LLVMMaskAllOff;
/** Tests to see if all of the elements of the vector in the 'v' parameter
are equal. Like lValuesAreEqual(), this is a conservative test and may
return false for arrays where the values are actually all equal. */
extern bool LLVMVectorValuesAllEqual(llvm::Value *v);
extern bool LLVMVectorValuesAllEqual(llvm::Value *v,
llvm::Value **splat = NULL);
/** Given vector of integer-typed values, this function returns true if it
can determine that the elements of the vector have a step of 'stride'