The motivation of this patch is to lower the IR pattern
(vp.merge mask, (add x, y), false, vl) to
(PseudoVADD_VV_<LMUL>_MASK false, x, y, mask, vl).
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Time | Test | |
---|---|---|
60,030 ms | x64 debian > libFuzzer.libFuzzer::fuzzer-leak.test |
Event Timeline
llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp | ||
---|---|---|
2677 | This is incorrect if the True opcode can raise a floating point exception. Applying the mask could lose an exception that should occur even if the result is discarded. I think we need to look up the MayRaiseException property from the MCInstrDesc entry for the opcode. If it is has that properly, we need to check that the hasNoFPExcept bit in the SDNodeFlags is set before doing this combine. |
llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp | ||
---|---|---|
2700 | We also should be copying the NoFPExcept flag here. Can probably just take the SDNodeFlags from the True node. |
llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp | ||
---|---|---|
2677 | Good point. Thank you find the bug. |
llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp | ||
---|---|---|
2677 | @fakepaper56 @craig.topper is there a reason why we only check for fp exceptions when the VL changes and not the mask too? |
This is incorrect if the True opcode can raise a floating point exception. Applying the mask could lose an exception that should occur even if the result is discarded.
I think we need to look up the MayRaiseException property from the MCInstrDesc entry for the opcode. If it is has that properly, we need to check that the hasNoFPExcept bit in the SDNodeFlags is set before doing this combine.