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

Shengchen Kan via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 28 00:48:35 PDT 2024


KanRobert wrote:

> > > > I think you need at least one backend test case to show this change? (llc also runs SimplifyCFG)
> > > 
> > > 
> > > Hmm, how to let llc run simplifycfg? @DianQK I can't find simplifycfg in the log of `print-after-all`.
> > 
> > 
> > I think a `llc -O2` should be ok. I just believe we need a complete test case to demonstrate the final changes from this patch.
> > > If I add ` -start-before=simplifycfg` to the flags, it will crash. (not related this PR)
> > > ```
> > > bash$ cat 1.c
> > > void f() {}
> > > 
> > > bash$ clang -O2 1.c -S -emit-llvm
> > > 
> > > bash$ llc --start-before=simplifycfg <1.ll
> > > 
> > > Assertion `!NodePtr->isKnownSentinel()' failed
> > > ```
> > 
> > 
> > I guess `--start-before` can only be used on MIR passes.
> 
> -O2 does not work. In fact, the default opt level for llc is `O2`. I can add a test with flags `opt -O2 -S` to check the transform is not cancelled during the middle-end opts. In backend ,we already have a test to check `masked.load/store` can be selected. Does it sound good?

Done. Added test masked-load-store-legal.ll

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


More information about the llvm-commits mailing list