[WebAssembly] Update calls to computeKnownBits after the changes from r301620.

I didn't realize WebAssembly wasn't a default build target so I missed that changes were needed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301629 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Craig Topper 2017-04-28 08:15:33 +00:00
parent f3cedbee5b
commit 0542dc78c1
2 changed files with 6 additions and 5 deletions

View File

@ -18,6 +18,7 @@
#include "llvm/CodeGen/SelectionDAGISel.h"
#include "llvm/IR/Function.h" // To access function attributes.
#include "llvm/Support/Debug.h"
#include "llvm/Support/KnownBits.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/raw_ostream.h"
using namespace llvm;

View File

@ -33,11 +33,11 @@ def or_is_add : PatFrag<(ops node:$lhs, node:$rhs), (or node:$lhs, node:$rhs),[{
if (ConstantSDNode *CN = dyn_cast<ConstantSDNode>(N->getOperand(1)))
return CurDAG->MaskedValueIsZero(N->getOperand(0), CN->getAPIntValue());
APInt KnownZero0, KnownOne0;
CurDAG->computeKnownBits(N->getOperand(0), KnownZero0, KnownOne0, 0);
APInt KnownZero1, KnownOne1;
CurDAG->computeKnownBits(N->getOperand(1), KnownZero1, KnownOne1, 0);
return (~KnownZero0 & ~KnownZero1) == 0;
KnownBits Known0;
CurDAG->computeKnownBits(N->getOperand(0), Known0, 0);
KnownBits Known1;
CurDAG->computeKnownBits(N->getOperand(1), Known1, 0);
return (~Known0.Zero & ~Known1.Zero) == 0;
}]>;
// GlobalAddresses are conceptually unsigned values, so we can also fold them