[llvm] [ConstantFold][RFC] Refactor getBinOpAbsorber function (PR #109736)

via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 26 02:54:35 PDT 2024


eric-xtang1008 wrote:

Thanks a lot, @nikic!

"What the hardware does here is not relevant, only the semantics specified in LangRef are relevant." There is another explain [here](https://discourse.llvm.org/t/qeustion-of-poison-produced-by-shift-instruction/81413/2?u=eric-xtang1008). The code above caused an undefined behavior if we ananlyse it based on C standard(the same as optimizer do), we shouldn't write the code like above.

I update the patch only refactor the getBinOpAbsober function, please help review it again if you have time, thanks!



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


More information about the llvm-commits mailing list