diff options
author | Chris Lattner <sabre@nondot.org> | 2011-01-06 07:09:23 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2011-01-06 07:09:23 +0000 |
commit | 73552c2ccefd89652925a450d977c424ac0aa01c (patch) | |
tree | 423b843317dfdd0bfc6629cbbe647d494418f12f | |
parent | 3ae2b79aa32524cfa590cefc7d645384a3b0aeea (diff) | |
download | bcm5719-llvm-73552c2ccefd89652925a450d977c424ac0aa01c.tar.gz bcm5719-llvm-73552c2ccefd89652925a450d977c424ac0aa01c.zip |
add a trivial instcombine missed in Dhrystone
llvm-svn: 122953
-rw-r--r-- | llvm/lib/Target/README.txt | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/llvm/lib/Target/README.txt b/llvm/lib/Target/README.txt index fa5e6010cfc..a02863c6a47 100644 --- a/llvm/lib/Target/README.txt +++ b/llvm/lib/Target/README.txt @@ -1964,4 +1964,41 @@ This occurs several times in viterbi. //===---------------------------------------------------------------------===// +This code (from Benchmarks/Dhrystone/dry.c): + +define i32 @Func1(i32, i32) nounwind readnone optsize ssp { +entry: + %sext = shl i32 %0, 24 + %conv = ashr i32 %sext, 24 + %sext6 = shl i32 %1, 24 + %conv4 = ashr i32 %sext6, 24 + %cmp = icmp eq i32 %conv, %conv4 + %. = select i1 %cmp, i32 10000, i32 0 + ret i32 %. +} + +Should be simplified into something like: + +define i32 @Func1(i32, i32) nounwind readnone optsize ssp { +entry: + %sext = shl i32 %0, 24 + %conv = and i32 %sext, 0xFF000000 + %sext6 = shl i32 %1, 24 + %conv4 = and i32 %sext6, 0xFF000000 + %cmp = icmp eq i32 %conv, %conv4 + %. = select i1 %cmp, i32 10000, i32 0 + ret i32 %. +} + +and then to: + +define i32 @Func1(i32, i32) nounwind readnone optsize ssp { +entry: + %conv = and i32 %0, 0xFF + %conv4 = and i32 %1, 0xFF + %cmp = icmp eq i32 %conv, %conv4 + %. = select i1 %cmp, i32 10000, i32 0 + ret i32 %. +} +//===---------------------------------------------------------------------===// |