For vmsgeu.vi with 0, we know this is always true,
so we can instead it with vmset.m (unmasked) or
vmset.m+vmand.mm (masked).
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Time | Test | |
---|---|---|
60 ms | x64 debian > LLVM.Bindings/Go::go.test |
Event Timeline
llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp | ||
---|---|---|
817 | New simm5_plus1 excludes 0, and I Keep pattern "defm : VPatCompareUnsignedZero<"int_riscv_vmsltu", "PseudoVMSNE">" to match vmsltu 0,and del this two case. Understanding right ? |
llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp | ||
---|---|---|
817 | Remove the VPatCOmpareUnisignedZero. The vmsltu.vx will then be able to match. The 0 will select to X0. |
llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp | ||
---|---|---|
817 | I try it, but vmsleu.vi -1 still generate. |
I posted an alternative version that handles vsltu.vi without RISCVISelDAGToDAG.cpp changes here https://reviews.llvm.org/D116723
I read your patch, it is a good solution. I will rebase after for your patch merge into the main
llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp | ||
---|---|---|
817 |
simm5_plus1 newest code in branch main. I thought is it define range -15 ~ 16 ? havn't excludes 0? or there are some new patch havn't push to main? def simm5_plus1 : Operand<XLenVT>, ImmLeaf<XLenVT, [{return (isInt<5>(Imm) && Imm != -16) || Imm == 16;}]> { let ParserMatchClass = SImm5Plus1AsmOperand; let MCOperandPredicate = [{ int64_t Imm; if (MCOp.evaluateAsConstantImm(Imm)) return (isInt<5>(Imm) && Imm != -16) || Imm == 16; return MCOp.isBareSymbolRef(); }]; } |
llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp | ||
---|---|---|
975 | This code was recently changed to use a macro for each case since they are only vary by instruction suffix. Please rebase. |
llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp | ||
---|---|---|
968 | done |
This could be done by using a new version of simm5_plus1 that excludes 0 in VPatCompare_VI for the vmsltu case.