From: Nick Lewycky Date: Sun, 8 Aug 2010 07:04:25 +0000 (+0000) Subject: Add optimization to Target/README.txt. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=b1e4eebec03f71f3c891ba384b5992f3d65e3591;p=oota-llvm.git Add optimization to Target/README.txt. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110543 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/README.txt b/lib/Target/README.txt index 4d7ee08de1d..4faf8bcfd41 100644 --- a/lib/Target/README.txt +++ b/lib/Target/README.txt @@ -1919,5 +1919,21 @@ something like the following, which eliminates a branch: ret .LBB0_2: jmp foo # TAILCALL +//===---------------------------------------------------------------------===// +Given a branch where the two target blocks are identical ("ret i32 %b" in +both), simplifycfg will simplify them away. But not so for a switch statement: + +define i32 @f(i32 %a, i32 %b) nounwind readnone { +entry: + switch i32 %a, label %bb3 [ + i32 4, label %bb + i32 6, label %bb + ] +bb: ; preds = %entry, %entry + ret i32 %b + +bb3: ; preds = %entry + ret i32 %b +} //===---------------------------------------------------------------------===//