[llvm-dev] Single use rule for chained node in pattern matcher

Thomas Preud'homme via llvm-dev llvm-dev at lists.llvm.org
Mon Oct 19 02:39:56 PDT 2020


Hi,

I'm trying to write a pattern for a truncating strict​*floating-point instruction that broadcast the result in the resulting register. However the pattern is not recognized by the pattern matcher because the any_fpround node is used more than once due to the broadcasting. I'm not quite sure I understand the reason behind that single use rule [1] (introduced by commit [2]) but all the uses are within the same pattern, as arguments of the same node even. Is there a way to relax the single use rule to allow uses in the same node? If not, how would you suggest I go about implementing pattern matching for this instruction?

[1] https://reviews.llvm.org/source/llvm-github/browse/master/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp$3214-3228
[2] https://reviews.llvm.org/rGf8695c1ee9bb8b18a4e1991591fa92383d427435

Thanks in advance for your help. Best regards,

Thomas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20201019/5773871d/attachment.html>


More information about the llvm-dev mailing list