aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenAction.cpp
diff options
context:
space:
mode:
authorMatthias Springer <me@m-sp.org>2023-12-20 14:39:22 +0900
committerGitHub <noreply@github.com>2023-12-20 14:39:22 +0900
commitf10302e3fa468a22a43e7d6bd6ec75919c60d72d (patch)
tree97720ece5b7ebe68adf7281f98e14246bf82589e /clang/lib/CodeGen/CodeGenAction.cpp
parent560564f51c626cf89920f13b6cea96684bac5848 (diff)
downloadllvm-f10302e3fa468a22a43e7d6bd6ec75919c60d72d.zip
llvm-f10302e3fa468a22a43e7d6bd6ec75919c60d72d.tar.gz
llvm-f10302e3fa468a22a43e7d6bd6ec75919c60d72d.tar.bz2
[mlir] Require folders to produce Values of same type (#75887)
This commit adds extra assertions to `OperationFolder` and `OpBuilder` to ensure that the types of the folded SSA values match with the result types of the op. There used to be checks that discard the folded results if the types do not match. This commit makes these checks stricter and turns them into assertions. Discarding folded results with the wrong type (without failing explicitly) can hide bugs in op folders. Two such bugs became apparent in MLIR (and some more in downstream projects) and are fixed with this change. Note: The existing type checks were introduced in https://reviews.llvm.org/D95991. Migration guide: If you see failing assertions (`folder produced value of incorrect type`; make sure to run with assertions enabled!), run with `-debug` or dump the operation right before the failing assertion. This will point you to the op that has the broken folder. A common mistake is a mismatch between static/dynamic dimensions (e.g., input has a static dimension but folded result has a dynamic dimension).
Diffstat (limited to 'clang/lib/CodeGen/CodeGenAction.cpp')
0 files changed, 0 insertions, 0 deletions