[llvm] [SimplifyLibCalls] Simplify cabs libcall if real or imaginary part of input is zero (PR #97976)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 9 02:19:36 PDT 2024


dtcxzyw wrote:

> @dtcxzyw I just noticed another mistake I made, I did not handle array type inputs correctly. If Op has type "ArrayTy", how can I get the first and second element and check if one is zero? In the existing code, IRBuilderBase.createExtractValue is used, but I can't use this to check for zeros because it actually modifies the IR and which should not happen in case there is no zero.

IIRC `ConstantFolder::FoldExtractValue` should handle this case. You can just push the array tests then I can have a look :)



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


More information about the llvm-commits mailing list