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

Shengchen Kan via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 16 21:34:21 PDT 2024


KanRobert wrote:

### Summary for  comments being addressed

1. Not do hoist if it's expensive. (checked by expensive_to_hoist in hoist-loads-stores-with-cf.ll) https://github.com/llvm/llvm-project/pull/96878#discussion_r1656831523

2. Share code for check predictability in `SpeculativelyExecuteBB` with the newly added transform. https://github.com/llvm/llvm-project/pull/96878#issuecomment-2195923264

3. Add all/nothing logic so that we don't ever hoist the loads/stores without removing the branch https://github.com/llvm/llvm-project/pull/96878#discussion_r1663692413

4. Make sure that this patch doesn't cause crashes or miscompilation on the following benchmarks:
    * [ ]   Clang stage2 build
    * [ ]   SPEC 2006/2017
    * [ ]   llvm-test-suite
    * [ ]  https://github.com/dtcxzyw/llvm-opt-benchmark
    * [ ]   fuzzers (e.g., csmith)
    
    https://github.com/llvm/llvm-project/pull/96878#issuecomment-2198044038

5. File **a separate PR** to support conditional load/store of ptrs with +cf https://github.com/llvm/llvm-project/pull/96878#issuecomment-2209436371

6. Support `load_from_gep` **in the follow-up patche**s (checked by load_from_gep in hoist-loads-stores-with-cf.ll) https://github.com/llvm/llvm-project/pull/96878#discussion_r1658169639

7. Extend LLVM IR to support scalar versioned masked.load/store gradually **in the follow-up patches** https://github.com/llvm/llvm-project/pull/96878#issuecomment-2212961381

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


More information about the llvm-commits mailing list