mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-19 13:16:46 +00:00
[TableGen] Directly use SDNode functions to implement HasOneUse and HasNoUse. NFC (#133976)
The SDValue functions we were calling wrap SDNode functions we can call directly.
This commit is contained in:
parent
28b300d546
commit
e020fc1895
@ -13,7 +13,7 @@ def NO_RET_ATOMIC_ADD : I<(outs), (ins GPR32Op:$src0, GPR32Op:$src1), []>;
|
||||
// SDAG-NEXT: SDNode *N = Node;
|
||||
// SDAG-NEXT: (void)N;
|
||||
// SDAG-NEXT: if (cast<MemSDNode>(N)->getMemoryVT() != MVT::i32) return false;
|
||||
// SDAG-NEXT: if (!SDValue(N, 0).use_empty()) return false;
|
||||
// SDAG-NEXT: if (N->hasAnyUseOfValue(0)) return false;
|
||||
// SDAG-NEXT: return true;
|
||||
|
||||
// GISEL: GIM_CheckOpcode, /*MI*/0, GIMT_Encode2(TargetOpcode::G_ATOMICRMW_ADD),
|
||||
|
@ -52,7 +52,7 @@ def TGTmul24_oneuse : PatFrag<
|
||||
// SDAG: OPC_CheckPredicate0, // Predicate_TGTmul24_oneuse
|
||||
|
||||
// SCUSTOM: return N->hasOneUse();
|
||||
// SBUILTIN: if (!SDValue(N, 0).hasOneUse()) return false;
|
||||
// SBUILTIN: if (!N->hasNUsesOfValue(1, 0)) return false;
|
||||
|
||||
// GISEL: GIM_CheckOpcode, /*MI*/1, GIMT_Encode2(TargetOpcode::G_INTRINSIC_W_SIDE_EFFECTS),
|
||||
// GISEL: GIM_CheckIntrinsicID, /*MI*/1, /*Op*/1, GIMT_Encode2(Intrinsic::tgt_mul24),
|
||||
|
@ -1127,9 +1127,9 @@ std::string TreePredicateFn::getPredCode() const {
|
||||
}
|
||||
|
||||
if (hasNoUse())
|
||||
Code += "if (!SDValue(N, 0).use_empty()) return false;\n";
|
||||
Code += "if (N->hasAnyUseOfValue(0)) return false;\n";
|
||||
if (hasOneUse())
|
||||
Code += "if (!SDValue(N, 0).hasOneUse()) return false;\n";
|
||||
Code += "if (!N->hasNUsesOfValue(1, 0)) return false;\n";
|
||||
|
||||
std::string PredicateCode =
|
||||
std::string(PatFragRec->getRecord()->getValueAsString("PredicateCode"));
|
||||
|
Loading…
x
Reference in New Issue
Block a user