diff options
author | Chris Lattner <sabre@nondot.org> | 2008-10-15 05:53:25 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-10-15 05:53:25 +0000 |
commit | cc49fd4f3c36f0fa11104e0e3a01e954c2804d38 (patch) | |
tree | 7c29e5d39269f32e5bd44df9f846d68c926c48ee /lib/Target/README.txt | |
parent | d03ed8f35c6b156bf2bfa319155a4245d3955b4d (diff) | |
download | external_llvm-cc49fd4f3c36f0fa11104e0e3a01e954c2804d38.zip external_llvm-cc49fd4f3c36f0fa11104e0e3a01e954c2804d38.tar.gz external_llvm-cc49fd4f3c36f0fa11104e0e3a01e954c2804d38.tar.bz2 |
add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57557 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/README.txt')
-rw-r--r-- | lib/Target/README.txt | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/lib/Target/README.txt b/lib/Target/README.txt index faa351a..a7fa802 100644 --- a/lib/Target/README.txt +++ b/lib/Target/README.txt @@ -891,3 +891,33 @@ vec2d foo () { } //===---------------------------------------------------------------------===// + +This C++ file: +void g(); struct A { int n; int m; A& operator++(void) { ++n; if (n == m) g(); +return *this; } A() : n(0), m(0) { } friend bool operator!=(A const& a1, +A const& a2) { return a1.n != a2.n; } }; void testfunction(A& iter) { A const +end; while (iter != end) ++iter; } + +Compiles down to: + +bb: ; preds = %bb3.backedge, %bb.nph + %.rle = phi i32 [ %1, %bb.nph ], [ %7, %bb3.backedge ] ; <i32> [#uses=1] + %4 = add i32 %.rle, 1 ; <i32> [#uses=2] + store i32 %4, i32* %0, align 4 + %5 = load i32* %3, align 4 ; <i32> [#uses=1] + %6 = icmp eq i32 %4, %5 ; <i1> [#uses=1] + br i1 %6, label %bb1, label %bb3.backedge + +bb1: ; preds = %bb + tail call void @_Z1gv() + br label %bb3.backedge + +bb3.backedge: ; preds = %bb, %bb1 + %7 = load i32* %0, align 4 ; <i32> [#uses=2] + + +The %7 load is partially redundant with the store of %4 to %0, GVN's PRE +should remove it, but it doesn't apply to memory objects. + +//===---------------------------------------------------------------------===// + |