changes in function LLVMFlattenInsertChain
This commit is contained in:
@@ -648,17 +648,20 @@ LLVMFlattenInsertChain(llvm::Value *inst, int vectorWidth,
|
|||||||
// They are not equal to each other so we should return NULL if compare
|
// They are not equal to each other so we should return NULL if compare
|
||||||
// and first element if we have it.
|
// and first element if we have it.
|
||||||
Assert(compare == true || elements[0] != NULL);
|
Assert(compare == true || elements[0] != NULL);
|
||||||
if (compare)
|
if (compare) {
|
||||||
return NULL;
|
return NULL;
|
||||||
else
|
}
|
||||||
|
else {
|
||||||
return elements[0];
|
return elements[0];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// TODO: Also, should we handle some other values like
|
// TODO: Also, should we handle some other values like
|
||||||
// ConstantDataVectors.
|
// ConstantDataVectors.
|
||||||
}
|
}
|
||||||
if (compare == false)
|
if (compare == false) {
|
||||||
//We simply want first element
|
//We simply want first element
|
||||||
return elements[0];
|
return elements[0];
|
||||||
|
}
|
||||||
|
|
||||||
int null_number = 0;
|
int null_number = 0;
|
||||||
int NonNull = 0;
|
int NonNull = 0;
|
||||||
|
|||||||
@@ -270,10 +270,9 @@ extern bool LLVMExtractVectorInts(llvm::Value *v, int64_t ret[], int *nElts);
|
|||||||
%broadcast.1 = shufflevector <4 x i32> %smear.0, <4 x i32> undef,
|
%broadcast.1 = shufflevector <4 x i32> %smear.0, <4 x i32> undef,
|
||||||
<4 x i32> zeroinitializer
|
<4 x i32> zeroinitializer
|
||||||
Function returns:
|
Function returns:
|
||||||
First element of array if compare is false,
|
Compare all elements and return one of them if all are equal, otherwise NULL.
|
||||||
NonNull element only if all elements are equal or NULL if compare is true,
|
If compare argument is false, don't do compare and return first element instead.
|
||||||
NonNull element only if all elements are equal if compare is true and undef is false,
|
If undef argument is true, ignore undef elements (but all undef yields NULL anyway).
|
||||||
NULL if all elements are NULLs
|
|
||||||
*/
|
*/
|
||||||
extern llvm::Value * LLVMFlattenInsertChain (llvm::Value *inst, int vectorWidth,
|
extern llvm::Value * LLVMFlattenInsertChain (llvm::Value *inst, int vectorWidth,
|
||||||
bool compare = true, bool undef = true);
|
bool compare = true, bool undef = true);
|
||||||
|
|||||||
Reference in New Issue
Block a user