[llvm] [InstCombine] Add an option to skip simplification on call instruction where a non-void return value is expected while the callee returns void (PR #98536)

via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 29 09:48:49 PDT 2024


yozhu wrote:

> I think we should remove the void/non-void transform entirely, not just add an option. I don't really see a good reason to perform this transform. Looking back at the history, I think this is just a leftover of an overly liberal initial implementation.

Happy to remove this transformation entirely.

Given this, should we also emit an error when seeing this void to non-void conversion at call sites? It is known to be undefined behavior that could result in non-determinism or crash at runtime; and If it is non-LTO compilation, clang would output an error unconditionally.

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


More information about the llvm-commits mailing list