diff options
author | Markus Böck <markus.boeck02@gmail.com> | 2022-10-24 20:55:52 +0200 |
---|---|---|
committer | Markus Böck <markus.boeck02@gmail.com> | 2022-10-24 21:41:13 +0200 |
commit | 3637dc601c4923721a69426187aa69dd6a71a053 (patch) | |
tree | c2068bf8f2d64be37989583dd9d651cd2b9f19d0 /llvm/lib/Transforms/Utils/LoopSimplify.cpp | |
parent | c3ead85e2f1c94b9be40d6c24532f2b932c8bfc7 (diff) | |
download | llvm-3637dc601c4923721a69426187aa69dd6a71a053.zip llvm-3637dc601c4923721a69426187aa69dd6a71a053.tar.gz llvm-3637dc601c4923721a69426187aa69dd6a71a053.tar.bz2 |
[clang][CodeGen] Consistently return nullptr Values for void builtins and scalar initalization
A common post condition of the various visitor functions in CodeGen is that instructions, that do not return any values, simply return a nullptr Value as a sentinel. This has not been the case however for calls to some builtins returning void, as well as for an initializer expression of the form `void()`. This would then lead to ICEs in CodeGen on code relying on nullptr being returned for void values, which is eg. the case for conditional expressions [0].
This patch fixes that by returning nullptr Values for intrinsics known not to return any values as well as for a scalar initializer returning void.
Fixes https://github.com/llvm/llvm-project/issues/53127
[0] https://github.com/llvm/llvm-project/blob/266ec801fb23f9f5f1d61ca9466e0805fbdb78a7/clang/lib/CodeGen/CGExprScalar.cpp#L4849-L4892
Differential Revision: https://reviews.llvm.org/D136548
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopSimplify.cpp')
0 files changed, 0 insertions, 0 deletions