[llvm] [X86][SimplifyCFG][CodeGen] Support hoisting load/store with conditional faulting (PR #95515)

Shengchen Kan via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 24 08:27:55 PDT 2024


KanRobert wrote:

> > > @KanRobert Constant folding an all-true/all-false mask is the absolute minimum, but there are many other optimizations that do not happen. For example, even something as basic as https://llvm.godbolt.org/z/ajbhr6qEh does not seem to work.
> > > While the masked load/store intrinsics are target-independent and old, they are also only used in specific situations and introduced fairly late in optimization (during vectorization), so ability to further optimize them has never been particularly important in the past.
> > 
> > 
> > Well, then we can improve it in the future. This transform is run only when APX sub-feature conditional faulting is available. We haven't had a real machine for APX so we have time to do it.
> 
> That makes it worse, not better. It means it's not even possible to evaluate the real impact this is going to have until it is too late.

On the contrary, I am optimistic about this. The possible regression is probably only happens when flags `-march=native` is used on future machines and we can always turn off this transform by `-mno-apx-features=cf` as a workaround before fixing it. 

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


More information about the llvm-commits mailing list