diff options
author | Owen Anderson <resistor@mac.com> | 2008-06-18 21:41:49 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2008-06-18 21:41:49 +0000 |
commit | b230372437183b8daffcd70fe784974ddf26d21b (patch) | |
tree | 50a169998bd7a51046c94ed07cc83e10953e70ef /test/Transforms/GVN/local-pre.ll | |
parent | e4242548976c04183a532695666803fb6a40ba06 (diff) | |
download | external_llvm-b230372437183b8daffcd70fe784974ddf26d21b.zip external_llvm-b230372437183b8daffcd70fe784974ddf26d21b.tar.gz external_llvm-b230372437183b8daffcd70fe784974ddf26d21b.tar.bz2 |
Add local PRE to GVN. This only operates in cases where it would not increase code size, namely when the instantiated expression
would only need to be created in one predecessor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52471 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/GVN/local-pre.ll')
-rw-r--r-- | test/Transforms/GVN/local-pre.ll | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/Transforms/GVN/local-pre.ll b/test/Transforms/GVN/local-pre.ll new file mode 100644 index 0000000..7b6e833 --- /dev/null +++ b/test/Transforms/GVN/local-pre.ll @@ -0,0 +1,18 @@ +; RUN: llvm-as < %s | opt -gvn | llvm-dis | grep {b.pre} + +define i32 @main(i32 %p) { +block1: + + br i1 true, label %block2, label %block3 + +block2: + %a = add i32 %p, 1 + br label %block4 + +block3: + br label %block4 + +block4: + %b = add i32 %p, 1 + ret i32 %b +} |