[PATCH] D128481: Add expensive/extensive pass to set Load/Store alignment

Thomas Raoux via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 23 17:31:23 PDT 2022


ThomasRaoux created this revision.
Herald added subscribers: mattd, gchakrabarti, asavonic, hiraditya, mgorny.
Herald added a project: All.
ThomasRaoux requested review of this revision.
Herald added subscribers: llvm-commits, jholewinski.
Herald added a project: LLVM.

Currently Load/Store alignment is only set in InstComnine pass based on computeKnownBits function.
computeKnownBits is stateless and recursive, therefore it is limited in how much analysis it can do and it will give up after 6 level or after 1 phi and 1 level.
This cause the alignment information to often be pessimistic. On some target having the right alignment important for performance.

This new pass does a more expensive analysis of KnownBits for all the integer of a function and deduce a more accurate alignment information out of it.
Also starting a discourse discussion about it.


https://reviews.llvm.org/D128481

Files:
  llvm/include/llvm/Analysis/ValueTracking.h
  llvm/include/llvm/InitializePasses.h
  llvm/include/llvm/LinkAllPasses.h
  llvm/include/llvm/Transforms/Scalar.h
  llvm/include/llvm/Transforms/Scalar/SetLoadStoreAlignment.h
  llvm/lib/Analysis/ValueTracking.cpp
  llvm/lib/Passes/PassBuilder.cpp
  llvm/lib/Passes/PassRegistry.def
  llvm/lib/Target/NVPTX/NVPTXTargetMachine.cpp
  llvm/lib/Transforms/Scalar/CMakeLists.txt
  llvm/lib/Transforms/Scalar/Scalar.cpp
  llvm/lib/Transforms/Scalar/SetLoadStoreAlignment.cpp
  llvm/test/Transforms/SetLoadStoreAlignment/basic.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D128481.439570.patch
Type: text/x-patch
Size: 46114 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220624/b1540959/attachment.bin>


More information about the llvm-commits mailing list