RISC-V doesn't have flag registers, we need to implement these
with add/sub and compares.
Remove the untested legalization for the signed versions. We can
add it back when we write tests.
Paths
| Differential D157772
[RISCV][GISel] Lower G_UADDE, G_UADDO, G_USUBE, and G_USUBO ClosedPublic Authored by craig.topper on Aug 11 2023, 11:12 PM.
Details Summary RISC-V doesn't have flag registers, we need to implement these Remove the untested legalization for the signed versions. We can
Diff Detail
Event Timeline
craig.topper added inline comments.
This revision is now accepted and ready to land.Aug 18 2023, 3:58 PM This revision was landed with ongoing or failed builds.Aug 18 2023, 5:29 PM Closed by commit rG3e569883fa7d: [RISCV][GISel] Lower G_UADDE, G_UADDO, G_USUBE, and G_USUBO (authored by craig.topper). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 551679 llvm/lib/Target/RISCV/GISel/RISCVLegalizerInfo.cpp
llvm/test/CodeGen/RISCV/GlobalISel/legalizer/rv32/legalize-add.mir
llvm/test/CodeGen/RISCV/GlobalISel/legalizer/rv32/legalize-mul-ext.mir
llvm/test/CodeGen/RISCV/GlobalISel/legalizer/rv32/legalize-sub.mir
llvm/test/CodeGen/RISCV/GlobalISel/legalizer/rv64/legalize-add.mir
llvm/test/CodeGen/RISCV/GlobalISel/legalizer/rv64/legalize-mul-ext.mir
llvm/test/CodeGen/RISCV/GlobalISel/legalizer/rv64/legalize-sub.mir
|
@arsenm Can you check this expansion? It doesn't look correct to me.
Here's the code from LegalizerHelper.
If LHS is 0 and RHS is all ones, and CarryIn is 1. TmpRes will be all ones and Res will be 0. Res will be 0. The ICMP_ULT will be false, but we there was an overflow.