mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-04 06:09:05 +00:00
2918efd551
Summary: Straight-line strength reduction (SLSR) is implemented in GCC but not yet in LLVM. It has proven to effectively simplify statements derived from an unrolled loop, and can potentially benefit many other cases too. For example, LLVM unrolls #pragma unroll foo (int i = 0; i < 3; ++i) { sum += foo((b + i) * s); } into sum += foo(b * s); sum += foo((b + 1) * s); sum += foo((b + 2) * s); However, no optimizations yet reduce the internal redundancy of the three expressions: b * s (b + 1) * s (b + 2) * s With SLSR, LLVM can optimize these three expressions into: t1 = b * s t2 = t1 + s t3 = t2 + s This commit is only an initial step towards implementing a series of such optimizations. I will implement more (see TODO in the file commentary) in the near future. This optimization is enabled for the NVPTX backend for now. However, I am more than happy to push it to the standard optimization pipeline after more thorough performance tests. Test Plan: test/StraightLineStrengthReduce/slsr.ll Reviewers: eliben, HaoLiu, meheff, hfinkel, jholewinski, atrick Reviewed By: jholewinski, atrick Subscribers: karthikthecool, jholewinski, llvm-commits Differential Revision: http://reviews.llvm.org/D7310 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228016 91177308-0d34-0410-b5e6-96231b3b80d8 |
||
---|---|---|
.. | ||
InstPrinter | ||
MCTargetDesc | ||
TargetInfo | ||
cl_common_defines.h | ||
CMakeLists.txt | ||
LLVMBuild.txt | ||
Makefile | ||
ManagedStringPool.h | ||
NVPTX.h | ||
NVPTX.td | ||
NVPTXAllocaHoisting.cpp | ||
NVPTXAllocaHoisting.h | ||
NVPTXAsmPrinter.cpp | ||
NVPTXAsmPrinter.h | ||
NVPTXAssignValidGlobalNames.cpp | ||
NVPTXFavorNonGenericAddrSpaces.cpp | ||
NVPTXFrameLowering.cpp | ||
NVPTXFrameLowering.h | ||
NVPTXGenericToNVVM.cpp | ||
NVPTXImageOptimizer.cpp | ||
NVPTXInstrFormats.td | ||
NVPTXInstrInfo.cpp | ||
NVPTXInstrInfo.h | ||
NVPTXInstrInfo.td | ||
NVPTXIntrinsics.td | ||
NVPTXISelDAGToDAG.cpp | ||
NVPTXISelDAGToDAG.h | ||
NVPTXISelLowering.cpp | ||
NVPTXISelLowering.h | ||
NVPTXLowerAggrCopies.cpp | ||
NVPTXLowerAggrCopies.h | ||
NVPTXLowerStructArgs.cpp | ||
NVPTXMachineFunctionInfo.h | ||
NVPTXMCExpr.cpp | ||
NVPTXMCExpr.h | ||
NVPTXPrologEpilogPass.cpp | ||
NVPTXRegisterInfo.cpp | ||
NVPTXRegisterInfo.h | ||
NVPTXRegisterInfo.td | ||
NVPTXReplaceImageHandles.cpp | ||
NVPTXSection.h | ||
NVPTXSubtarget.cpp | ||
NVPTXSubtarget.h | ||
NVPTXTargetMachine.cpp | ||
NVPTXTargetMachine.h | ||
NVPTXTargetObjectFile.h | ||
NVPTXTargetTransformInfo.cpp | ||
NVPTXTargetTransformInfo.h | ||
NVPTXutil.cpp | ||
NVPTXutil.h | ||
NVPTXUtilities.cpp | ||
NVPTXUtilities.h | ||
NVPTXVector.td | ||
NVVMReflect.cpp |