[WebAssembly] Use `SDValue::getConstantOperandVal` (NFC)

Reviewed By: tlively

Differential Revision: https://reviews.llvm.org/D107499
This commit is contained in:
Heejin Ahn 2021-08-04 13:53:34 -07:00
parent 12b34e056c
commit aa0b0fbbe6
2 changed files with 7 additions and 8 deletions

View File

@ -117,8 +117,7 @@ void WebAssemblyDAGToDAGISel::Select(SDNode *Node) {
if (!MF.getSubtarget<WebAssemblySubtarget>().hasAtomics())
break;
uint64_t SyncScopeID =
cast<ConstantSDNode>(Node->getOperand(2).getNode())->getZExtValue();
uint64_t SyncScopeID = Node->getConstantOperandVal(2);
MachineSDNode *Fence = nullptr;
switch (SyncScopeID) {
case SyncScope::SingleThread:
@ -152,7 +151,7 @@ void WebAssemblyDAGToDAGISel::Select(SDNode *Node) {
}
case ISD::INTRINSIC_WO_CHAIN: {
unsigned IntNo = cast<ConstantSDNode>(Node->getOperand(0))->getZExtValue();
unsigned IntNo = Node->getConstantOperandVal(0);
switch (IntNo) {
case Intrinsic::wasm_tls_size: {
MachineSDNode *TLSSize = CurDAG->getMachineNode(
@ -174,7 +173,7 @@ void WebAssemblyDAGToDAGISel::Select(SDNode *Node) {
}
case ISD::INTRINSIC_W_CHAIN: {
unsigned IntNo = cast<ConstantSDNode>(Node->getOperand(1))->getZExtValue();
unsigned IntNo = Node->getConstantOperandVal(1);
const auto &TLI = CurDAG->getTargetLoweringInfo();
MVT PtrVT = TLI.getPointerTy(CurDAG->getDataLayout());
switch (IntNo) {

View File

@ -830,7 +830,7 @@ void WebAssemblyTargetLowering::computeKnownBitsForTargetNode(
default:
break;
case ISD::INTRINSIC_WO_CHAIN: {
unsigned IntNo = cast<ConstantSDNode>(Op.getOperand(0))->getZExtValue();
unsigned IntNo = Op.getConstantOperandVal(0);
switch (IntNo) {
default:
break;
@ -1492,7 +1492,7 @@ SDValue WebAssemblyTargetLowering::LowerRETURNADDR(SDValue Op,
if (verifyReturnAddressArgumentIsConstant(Op, DAG))
return SDValue();
unsigned Depth = cast<ConstantSDNode>(Op.getOperand(0))->getZExtValue();
unsigned Depth = Op.getConstantOperandVal(0);
MakeLibCallOptions CallOptions;
return makeLibCall(DAG, RTLIB::RETURN_ADDRESS, Op.getValueType(),
{DAG.getConstant(Depth, DL, MVT::i32)}, CallOptions, DL)
@ -1671,10 +1671,10 @@ SDValue WebAssemblyTargetLowering::LowerIntrinsic(SDValue Op,
switch (Op.getOpcode()) {
case ISD::INTRINSIC_VOID:
case ISD::INTRINSIC_W_CHAIN:
IntNo = cast<ConstantSDNode>(Op.getOperand(1))->getZExtValue();
IntNo = Op.getConstantOperandVal(1);
break;
case ISD::INTRINSIC_WO_CHAIN:
IntNo = cast<ConstantSDNode>(Op.getOperand(0))->getZExtValue();
IntNo = Op.getConstantOperandVal(0);
break;
default:
llvm_unreachable("Invalid intrinsic");