[llvm] [InstCombine] Extend folding of aggregate construction to cases when source aggregates are partially available (PR #100828)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 10 00:58:53 PST 2024


dtcxzyw wrote:

> > > IR diff looks good to me. I believe the regression can be addressed by using `simplifyInstruction` in `FoldOpIntoSelect`: https://alive2.llvm.org/ce/z/HiwgPk. We discussed about this in [#84686 (comment)](https://github.com/llvm/llvm-project/pull/84686#issuecomment-1987344128).
> > 
> > 
> > @weiguozhi Are you willing to try this?
> 
> Yes, I tried it. As you have noticed it doesn't handle non-const aggregates. We can enhance FoldOpIntoSelect to do the non-const transform in [aef5402](https://github.com/llvm/llvm-project/commit/aef54025298b496d4f0b8766816700659b2f9015)
> 
> ```
>      extract (select (cond, insert(agg, elem), FV))
>  ->  select (cond, elem, extract(FV))
> ```

Can you file a separate PR?

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


More information about the llvm-commits mailing list