[PATCH] D130466: [LICM] - Add option to force thread model single

Shubham Narlawar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 30 03:47:26 PDT 2022


gsocshubham updated this revision to Diff 464209.
gsocshubham retitled this revision from "[LICM] - Add option to allow data races" to "[LICM] - Add option to force thread model single".
gsocshubham added a comment.

Address review comments -

1. Run -sroa on lit tests where-ever applicable.

2. Update LICM flag description.

3. Add a new LIT test "promote-sink-atomic-store-arg.ll" to show atomic store behaviour.

I am able to run -sroa successfully on promote-sink-store-global.ll

I could not run sroa on below LIT tests as everything is getting optimized and there will be no load/store left to showcase this optmization effect - (Please check below godbolt links)

a. promote-sink-store-constant-global.ll - Constant global case - https://clang.godbolt.org/z/n5E69ebbz

IR obtained from -

  const int u = 7;
  
  int f(int n) {
       int x, i;
      for (i = 0; i < n; ++i) {
          x = u;
      }
    return x + u;
  }

b. promote-sink-store-capture.ll - Capture case - https://clang.godbolt.org/z/fjxn7xc46

IR obtained from -

  void f(int n, int u) {
      for (int i = 0, x = u; i < n; ++i) {
      x = u;
      }
  }

c. promote-sink-store-arg.ll - Function argument case - https://clang.godbolt.org/z/d85qhxbsr

IR obtained from -

  void f(int n, int u) {
      for (int i = 0; i < n; ++i) {
              u = i;
      }
  }


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D130466/new/

https://reviews.llvm.org/D130466

Files:
  llvm/include/llvm/Analysis/TargetTransformInfo.h
  llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
  llvm/include/llvm/CodeGen/BasicTTIImpl.h
  llvm/include/llvm/Transforms/Utils/LoopUtils.h
  llvm/lib/Analysis/TargetTransformInfo.cpp
  llvm/lib/Transforms/Scalar/LICM.cpp
  llvm/test/Transforms/LICM/promote-sink-atomic-store-arg.ll
  llvm/test/Transforms/LICM/promote-sink-store-arg.ll
  llvm/test/Transforms/LICM/promote-sink-store-capture.ll
  llvm/test/Transforms/LICM/promote-sink-store-constant-global.ll
  llvm/test/Transforms/LICM/promote-sink-store-global.ll
  llvm/test/Transforms/LICM/promote-sink-store.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D130466.464209.patch
Type: text/x-patch
Size: 42000 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220930/88d0ed5c/attachment.bin>


More information about the llvm-commits mailing list