[llvm] [NVPTX] Fold vector FMAs in the IR peephole pass (PR #224018)

Rajat Bajpai via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 29 05:55:54 PDT 2026


rajatbajpai wrote:

> Sorry, high level question first, but looking at the pattern, I was expecting DAGCombine to handle this case, and I think it does:
> 
> https://godbolt.org/z/4Ej1a5zM6
> 
> So, without this patch, we are already generating a `FMA_F32x2`.
> 
> I understand that with this patch, we generate a FMA earlier in the flow and that this may have some benefit, but that's why I wanted to ask about the motivation and if you do see benefits doing this?

Since DAGCombine already handles vector types, I believe this pass is only useful for cross-BB scenarios that DAGCombine can’t handle.

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


More information about the llvm-commits mailing list