Tablegen generated code already tests the opcode value, so it's not

necessary to use dyn_cast in these predicates.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55055 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dan Gohman
2008-08-20 15:24:22 +00:00
parent c53ec49885
commit 67ca6be16a
4 changed files with 183 additions and 247 deletions

View File

@@ -89,11 +89,9 @@ def immSExt16int : PatLeaf<(imm), [{ //(int)imm fits in a 16 bit sign extended
}], SExt16>;
def zappat : PatFrag<(ops node:$LHS), (and node:$LHS, imm:$L), [{
if (ConstantSDNode *RHS = dyn_cast<ConstantSDNode>(N->getOperand(1))) {
uint64_t build = get_zapImm(N->getOperand(0), (uint64_t)RHS->getValue());
return build != 0;
}
return false;
ConstantSDNode *RHS = cast<ConstantSDNode>(N->getOperand(1));
uint64_t build = get_zapImm(N->getOperand(0), (uint64_t)RHS->getValue());
return build != 0;
}]>;
def immFPZ : PatLeaf<(fpimm), [{ //the only fpconstant nodes are +/- 0.0