diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2007-03-18 14:37:20 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2007-03-18 14:37:20 +0000 |
commit | 7f4ba44f377b1a71c3484385d4338e7917433d5f (patch) | |
tree | 9217bf1d8b6a692d32c95ee400b85800f04593aa | |
parent | cf596c54d4089ef23ce00be04bbb674d3ae2e0a6 (diff) |
This is implemented. We now generate:
entry:
icmp ugt i32 %x, 4 ; <i1>:0 [#uses=1]
br i1 %0, label %cond_true, label %cond_false
cond_true: ; preds = %entry
%tmp1 = tail call i32 (...)* @bar( i32 12 ) ; <i32> [#uses=0]
ret void
cond_false: ; preds = %entry
switch i32 %x, label %cond_true15 [
i32 4, label %cond_true3
i32 3, label %cond_true7
i32 2, label %cond_true11
i32 0, label %cond_false17
]
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35142 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/README.txt | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/lib/Target/README.txt b/lib/Target/README.txt index 437e93c18c..e6bfe6dee6 100644 --- a/lib/Target/README.txt +++ b/lib/Target/README.txt @@ -348,46 +348,6 @@ pass. //===---------------------------------------------------------------------===// --predsimplify should transform this: - -void bad(unsigned x) -{ - if (x > 4) - bar(12); - else if (x > 3) - bar(523); - else if (x > 2) - bar(36); - else if (x > 1) - bar(65); - else if (x > 0) - bar(45); - else - bar(367); -} - -into: - -void good(unsigned x) -{ - if (x == 4) - bar(523); - else if (x == 3) - bar(36); - else if (x == 2) - bar(65); - else if (x == 1) - bar(45); - else if (x == 0) - bar(367); - else - bar(12); -} - -to enable further optimizations. - -//===---------------------------------------------------------------------===// - Consider: typedef unsigned U32; |