File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -57,6 +57,12 @@ class RISCVInstructionSelector : public InstructionSelector {
57
57
const TargetRegisterClass *
58
58
getRegClassForTypeOnBank (LLT Ty, const RegisterBank &RB) const ;
59
59
60
+ // const MachineInstr &MI
61
+ bool hasAllNBitUsers (const MachineInstr &MI, unsigned Bits, const unsigned Depth = 0 ) const ;
62
+ bool hasAllBUsers (const MachineInstr &MI) const { return hasAllNBitUsers (MI, 8 ); }
63
+ bool hasAllHUsers (const MachineInstr &MI) const { return hasAllNBitUsers (MI, 16 ); }
64
+ bool hasAllWUsers (const MachineInstr &MI) const { return hasAllNBitUsers (MI, 32 ); }
65
+
60
66
bool isRegInGprb (Register Reg) const ;
61
67
bool isRegInFprb (Register Reg) const ;
62
68
@@ -186,6 +192,10 @@ RISCVInstructionSelector::RISCVInstructionSelector(
186
192
{
187
193
}
188
194
195
+ bool RISCVInstructionSelector::hasAllNBitUsers (const MachineInstr &MI, unsigned Bits, const unsigned Depth) const {
196
+ return false ;
197
+ };
198
+
189
199
InstructionSelector::ComplexRendererFns
190
200
RISCVInstructionSelector::selectShiftMask (MachineOperand &Root,
191
201
unsigned ShiftWidth) const {
Original file line number Diff line number Diff line change @@ -1945,15 +1945,19 @@ class binop_allhusers<SDPatternOperator operator>
1945
1945
: PatFrag<(ops node:$lhs, node:$rhs),
1946
1946
(XLenVT (operator node:$lhs, node:$rhs)), [{
1947
1947
return hasAllHUsers(Node);
1948
- }]>;
1948
+ }]> {
1949
+ let GISelPredicateCode = [{ return hasAllHUsers(MI); }];
1950
+ }
1949
1951
1950
1952
// PatFrag to allow ADDW/SUBW/MULW/SLLW to be selected from i64 add/sub/mul/shl
1951
1953
// if only the lower 32 bits of their result is used.
1952
1954
class binop_allwusers<SDPatternOperator operator>
1953
1955
: PatFrag<(ops node:$lhs, node:$rhs),
1954
1956
(i64 (operator node:$lhs, node:$rhs)), [{
1955
1957
return hasAllWUsers(Node);
1956
- }]>;
1958
+ }]> {
1959
+ let GISelPredicateCode = [{ return hasAllWUsers(MI); }];
1960
+ }
1957
1961
1958
1962
def sexti32_allwusers : PatFrag<(ops node:$src),
1959
1963
(sext_inreg node:$src, i32), [{
You can’t perform that action at this time.
0 commit comments