[llvm] 4ae896f - [AMDGPU] HasOneUse uses (#92534)
via llvm-commits
llvm-commits at lists.llvm.org
Tue May 21 08:25:43 PDT 2024
Author: jofrn
Date: 2024-05-21T11:25:39-04:00
New Revision: 4ae896fe979b7db501cabde4b6b3504478958682
URL: https://github.com/llvm/llvm-project/commit/4ae896fe979b7db501cabde4b6b3504478958682
DIFF: https://github.com/llvm/llvm-project/commit/4ae896fe979b7db501cabde4b6b3504478958682.diff
LOG: [AMDGPU] HasOneUse uses (#92534)
#91578 implements `HasOneUse` predicate on `PatFrag`, so this commit
uses it within AMDGPU.
Added:
Modified:
llvm/lib/Target/AMDGPU/AMDGPUInstructions.td
Removed:
################################################################################
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUInstructions.td b/llvm/lib/Target/AMDGPU/AMDGPUInstructions.td
index 86f77f7b64e88..fa7492ac6cbe1 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUInstructions.td
+++ b/llvm/lib/Target/AMDGPU/AMDGPUInstructions.td
@@ -168,30 +168,20 @@ def brtarget : Operand<OtherVT>;
class HasOneUseUnaryOp<SDPatternOperator op> : PatFrag<
(ops node:$src0),
- (op $src0),
- [{ return N->hasOneUse(); }]> {
-
- let GISelPredicateCode = [{
- return MRI.hasOneNonDBGUse(MI.getOperand(0).getReg());
- }];
+ (op $src0)> {
+ let HasOneUse = 1;
}
class HasOneUseBinOp<SDPatternOperator op> : PatFrag<
(ops node:$src0, node:$src1),
- (op $src0, $src1),
- [{ return N->hasOneUse(); }]> {
- let GISelPredicateCode = [{
- return MRI.hasOneNonDBGUse(MI.getOperand(0).getReg());
- }];
+ (op $src0, $src1)> {
+ let HasOneUse = 1;
}
class HasOneUseTernaryOp<SDPatternOperator op> : PatFrag<
(ops node:$src0, node:$src1, node:$src2),
- (op $src0, $src1, $src2),
- [{ return N->hasOneUse(); }]> {
- let GISelPredicateCode = [{
- return MRI.hasOneNonDBGUse(MI.getOperand(0).getReg());
- }];
+ (op $src0, $src1, $src2)> {
+ let HasOneUse = 1;
}
class is_canonicalized_1<SDPatternOperator op> : PatFrag<
More information about the llvm-commits
mailing list