aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-11-05 18:19:19 +0000
committerChris Lattner <sabre@nondot.org>2009-11-05 18:19:19 +0000
commit6c9fab7404c556c23864cc552572985c3180f4c4 (patch)
tree4e9d6d7ae4b839b985344bada1c7873e999d841a
parent0ff290615f7675e42111fd907f7b457f08f06747 (diff)
downloadexternal_llvm-6c9fab7404c556c23864cc552572985c3180f4c4.zip
external_llvm-6c9fab7404c556c23864cc552572985c3180f4c4.tar.gz
external_llvm-6c9fab7404c556c23864cc552572985c3180f4c4.tar.bz2
add a note from PR5313
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86146 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/README.txt34
1 files changed, 34 insertions, 0 deletions
diff --git a/lib/Target/README.txt b/lib/Target/README.txt
index a345d3d..7018b61 100644
--- a/lib/Target/README.txt
+++ b/lib/Target/README.txt
@@ -1229,6 +1229,40 @@ GCC PR33344 is a similar case.
//===---------------------------------------------------------------------===//
+[PHI TRANSLATE INDEXED GEPs] PR5313
+
+Load redundancy elimination for simple loop. This loop:
+
+void append_text(const char* text,unsigned char * const io) {
+ while(*text)
+ *io=*text++;
+}
+
+Compiles to have a fully redundant load in the loop (%2):
+
+define void @append_text(i8* nocapture %text, i8* nocapture %io) nounwind {
+entry:
+ %0 = load i8* %text, align 1 ; <i8> [#uses=1]
+ %1 = icmp eq i8 %0, 0 ; <i1> [#uses=1]
+ br i1 %1, label %return, label %bb
+
+bb: ; preds = %bb, %entry
+ %indvar = phi i32 [ 0, %entry ], [ %tmp, %bb ] ; <i32> [#uses=2]
+ %text_addr.04 = getelementptr i8* %text, i32 %indvar ; <i8*> [#uses=1]
+ %2 = load i8* %text_addr.04, align 1 ; <i8> [#uses=1]
+ store i8 %2, i8* %io, align 1
+ %tmp = add i32 %indvar, 1 ; <i32> [#uses=2]
+ %scevgep = getelementptr i8* %text, i32 %tmp ; <i8*> [#uses=1]
+ %3 = load i8* %scevgep, align 1 ; <i8> [#uses=1]
+ %4 = icmp eq i8 %3, 0 ; <i1> [#uses=1]
+ br i1 %4, label %return, label %bb
+
+return: ; preds = %bb, %entry
+ ret void
+}
+
+//===---------------------------------------------------------------------===//
+
There are many load PRE testcases in testsuite/gcc.dg/tree-ssa/loadpre* in the
GCC testsuite. There are many pre testcases as ssa-pre-*.c