LLVMVectorValuesAllEqual() improvements.

Clean up the API, so the caller doesn't have to pass in a vector so
the function can track PHI nodes (do that internally instead.)

Handle casts in lValuesAreEqual().
This commit is contained in:
Matt Pharr
2012-03-19 11:54:18 -07:00
parent 0664f5a724
commit e264d95019
4 changed files with 53 additions and 26 deletions

View File

@@ -228,8 +228,7 @@ 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, int vectorLength,
std::vector<llvm::PHINode *> &seenPhis);
extern bool LLVMVectorValuesAllEqual(llvm::Value *v);
/** Given a vector-typed value v, if the vector is a vector with constant
element values, this function extracts those element values into the