summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2011-01-02 18:32:09 +0000
committerChris Lattner <sabre@nondot.org>2011-01-02 18:32:09 +0000
commit0469e01c02c1a9603500b3b0f01dfab82e266beb (patch)
tree876868879aec05ce2511e6ee39f31ad68f01723c /llvm/lib
parent51415d26f15022b008cf730a16ed38a3177155f3 (diff)
downloadbcm5719-llvm-0469e01c02c1a9603500b3b0f01dfab82e266beb.tar.gz
bcm5719-llvm-0469e01c02c1a9603500b3b0f01dfab82e266beb.zip
add a list of opportunities for future improvement.
llvm-svn: 122701
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp23
1 files changed, 22 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp b/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
index 84e33f062b0..72fee7012e1 100644
--- a/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
@@ -12,6 +12,27 @@
// performance win.
//
//===----------------------------------------------------------------------===//
+//
+// TODO List:
+//
+// Future loop memory idioms to recognize:
+// memcmp, memmove, strlen, etc.
+// Future floating point idioms to recognize in -ffast-math mode:
+// fpowi
+// Future integer operation idioms to recognize:
+// ctpop, ctlz, cttz
+//
+// Beware that isel's default lowering for ctpop is highly inefficient for
+// i64 and larger types when i64 is legal and the value has few bits set. It
+// would be good to enhance isel to emit a loop for ctpop in this case.
+//
+// We should enhance the memset/memcpy recognition to handle multiple stores in
+// the loop. This would handle things like:
+// void foo(_Complex float *P)
+// for (i) { __real__(*P) = 0; __imag__(*P) = 0; }
+// this is also "Example 2" from http://blog.regehr.org/archives/320
+//
+//===----------------------------------------------------------------------===//
#define DEBUG_TYPE "loop-idiom"
#include "llvm/Transforms/Scalar.h"
@@ -326,7 +347,7 @@ processLoopStoreOfLoopLoad(StoreInst *SI, unsigned StoreSize,
LoadInst *LI = cast<LoadInst>(SI->getValueOperand());
// Okay, we have a strided store "p[i]" of a loaded value. We can turn
- // this into a memcmp in the loop preheader now if we want. However, this
+ // this into a memcpy in the loop preheader now if we want. However, this
// would be unsafe to do if there is anything else in the loop that may read
// or write to the aliased location (including the load feeding the stores).
// Check for an alias.
OpenPOWER on IntegriCloud