[llvm] [PowerPC] Check value uses in ValueBit tracking (PR #66040)

Chen Zheng via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 23 00:24:07 PST 2024


chenzheng1030 wrote:

> > Since developer explicitly uses __rldimi, what the developer expects should be the corresponding PPC instruction rldimi?
> 
> We can definitely create a new intrinsic for `rldimi`. But I'm concerned whether the rest 8 `rl*` instructions also need such an intrinsic? Current codegen tests won't show changes after adding a new intrinsic, so I may need to find whether some C cases will go worse.

I think we just need to add intrinsic for builtin that are currently supported by clang. See https://www.ibm.com/docs/en/openxl-c-and-cpp-aix/17.1.2?topic=rf-rldimi-builtin-ppc-rldimi-rlwimi-builtin-ppc-rlwimi and https://www.ibm.com/docs/en/openxl-c-and-cpp-aix/17.1.2?topic=functions-rlwnm-builtin-ppc-rlwnm . So we need 3 different intrinsics.

> 
> Yes, this patch is indeed a workaround. The reason of this suboptimal codegen is local greedy BitPermutation selector. For longer consideration, we need modeling and recombination of rotate-clear/mask/insert operations in backend. If that shows good result, BitPermutation can be dropped.

Agreed. From the other two cases diff, we indeed have some issue for the BitPermutation logic. We need a redesign here.

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


More information about the llvm-commits mailing list