From b2aaa5da427c78ad14a82ce07c4e8bcd4032af86 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Sat, 1 Apr 2017 21:50:03 +0000 Subject: [PATCH] [APInt] Implement AndAssignSlowCase using tcAnd. Do the same for Or and Xor. NFCI llvm-svn: 299317 --- llvm/lib/Support/APInt.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/llvm/lib/Support/APInt.cpp b/llvm/lib/Support/APInt.cpp index 0d4255da7f00..4275e3918c6c 100644 --- a/llvm/lib/Support/APInt.cpp +++ b/llvm/lib/Support/APInt.cpp @@ -407,23 +407,17 @@ APInt& APInt::operator*=(const APInt& RHS) { } APInt& APInt::AndAssignSlowCase(const APInt& RHS) { - unsigned numWords = getNumWords(); - for (unsigned i = 0; i < numWords; ++i) - pVal[i] &= RHS.pVal[i]; + tcAnd(pVal, RHS.pVal, getNumWords()); return *this; } APInt& APInt::OrAssignSlowCase(const APInt& RHS) { - unsigned numWords = getNumWords(); - for (unsigned i = 0; i < numWords; ++i) - pVal[i] |= RHS.pVal[i]; + tcOr(pVal, RHS.pVal, getNumWords()); return *this; } APInt& APInt::XorAssignSlowCase(const APInt& RHS) { - unsigned numWords = getNumWords(); - for (unsigned i = 0; i < numWords; ++i) - pVal[i] ^= RHS.pVal[i]; + tcXor(pVal, RHS.pVal, getNumWords()); return *this; }