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

@@ -2979,9 +2979,7 @@ void CWriter::visitBinaryOperator(Instruction &I) {
if ((I.getOpcode() == Instruction::Shl ||
I.getOpcode() == Instruction::LShr ||
I.getOpcode() == Instruction::AShr)) {
std::vector<PHINode *> phis;
if (LLVMVectorValuesAllEqual(I.getOperand(1),
vectorWidth, phis)) {
if (LLVMVectorValuesAllEqual(I.getOperand(1))) {
Out << "__extract_element(";
writeOperand(I.getOperand(1));
Out << ", 0) ";