[llvm] [TableGen] Gracefully error out in ParseTreePattern when DAG has zero operands so that llvm-tblgen doesn't crash (PR #161417)

Prerona Chaudhuri via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 14 22:33:00 PST 2025


pchaudhuri-nv wrote:

Hello @arsenm and @jurahul I have updated the PR.

Couple of changes that helps us gracefully error out
1. In ParseTreePattern and TreePattern - don't add  "null" TreePatternNodePtr in the tree.
2. For the current test added in the PR, since we return nullptr from ParseTreePattern, we then end up invoking ParseOnePattern, which then ultimately invokes UpdateNodeTypeFromInst where we check the class of the operand. So IMO, we should return false and error out that the current operand type is unsupported.

Do you find this change fine ?

https://github.com/llvm/llvm-project/pull/161417


More information about the llvm-commits mailing list