Skip to content

Commit 8860679

Browse files
committed
[RISCV] Add Predicates to fcanonicalize patterns. NFC
This doesn't matter in practice since the only way fcanonicalize can make it to isel is if the predicate is already true, but it's good to be consistent.
1 parent 9a6bdfd commit 8860679

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

llvm/lib/Target/RISCV/RISCVInstrInfoD.td

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,7 @@ foreach Ext = DExts in {
401401
defm : PatFprFpr_m<fmaximumnum, FMAX_D, Ext>;
402402
defm : PatFprFpr_m<riscv_fmin, FMIN_D, Ext>;
403403
defm : PatFprFpr_m<riscv_fmax, FMAX_D, Ext>;
404+
let Predicates = Ext.Predicates in
404405
def : Pat<(f64 (fcanonicalize FPR64:$rs1)), (FMIN_D $rs1, $rs1)>;
405406
}
406407

llvm/lib/Target/RISCV/RISCVInstrInfoF.td

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -655,6 +655,7 @@ foreach Ext = FExts in {
655655
defm : PatFprFpr_m<fmaximumnum, FMAX_S, Ext>;
656656
defm : PatFprFpr_m<riscv_fmin, FMIN_S, Ext>;
657657
defm : PatFprFpr_m<riscv_fmax, FMAX_S, Ext>;
658+
let Predicates = Ext.Predicates in
658659
def : Pat<(f32 (fcanonicalize FPR32:$rs1)), (FMIN_S $rs1, $rs1)>;
659660
}
660661

llvm/lib/Target/RISCV/RISCVInstrInfoZfh.td

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,7 @@ foreach Ext = ZfhExts in {
380380
defm : PatFprFpr_m<fmaximumnum, FMAX_H, Ext>;
381381
defm : PatFprFpr_m<riscv_fmin, FMIN_H, Ext>;
382382
defm : PatFprFpr_m<riscv_fmax, FMAX_H, Ext>;
383+
let Predicates = Ext.Predicates in
383384
def : Pat<(f16 (fcanonicalize FPR16:$rs1)), (FMIN_H $rs1, $rs1)>;
384385
}
385386

0 commit comments

Comments
 (0)