diff options
| author | Eli Friedman <eli.friedman@gmail.com> | 2010-01-31 04:55:32 +0000 |
|---|---|---|
| committer | Eli Friedman <eli.friedman@gmail.com> | 2010-01-31 04:55:32 +0000 |
| commit | 0de0b3677ac91f0f864181220c8da7333e113d5a (patch) | |
| tree | 94158e19217684fad711730534a0f9eddb43e5eb /llvm | |
| parent | 690c7f4dfdc0a0ed6bd958e1b1ed5c45495ee3a6 (diff) | |
| download | bcm5719-llvm-0de0b3677ac91f0f864181220c8da7333e113d5a.tar.gz bcm5719-llvm-0de0b3677ac91f0f864181220c8da7333e113d5a.zip | |
Remove a completed item, add a couple new ones.
llvm-svn: 94945
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/lib/Target/README.txt | 42 |
1 files changed, 38 insertions, 4 deletions
diff --git a/llvm/lib/Target/README.txt b/llvm/lib/Target/README.txt index ce84cbb79d7..7ba7ac90181 100644 --- a/llvm/lib/Target/README.txt +++ b/llvm/lib/Target/README.txt @@ -1751,12 +1751,46 @@ from gcc. Missed instcombine transformation: define i32 @a(i32 %x) nounwind readnone { entry: - %shr = lshr i32 %x, 5 ; <i32> [#uses=1] - %xor = xor i32 %shr, 67108864 ; <i32> [#uses=1] - %sub = add i32 %xor, -67108864 ; <i32> [#uses=1] + %rem = srem i32 %x, 32 + %shl = shl i32 1, %rem + ret i32 %shl +} + +The srem can be transformed to an and because if x is negative, the shift is +undefined. Testcase derived from gcc. + +//===---------------------------------------------------------------------===// + +Missed instcombine/dagcombine transformation: +define i32 @a(i32 %x, i32 %y) nounwind readnone { +entry: + %mul = mul i32 %y, -8 + %sub = sub i32 %x, %mul ret i32 %sub } -This function is equivalent to "ashr i32 %x, 5". Testcase derived from gcc. +Should compile to something like x+y*8, but currently compiles to an +inefficient result. Testcase derived from gcc. + +//===---------------------------------------------------------------------===// + +Missed instcombine/dagcombine transformation: +define void @lshift_lt(i8 zeroext %a) nounwind { +entry: + %conv = zext i8 %a to i32 + %shl = shl i32 %conv, 3 + %cmp = icmp ult i32 %shl, 33 + br i1 %cmp, label %if.then, label %if.end + +if.then: + tail call void @bar() nounwind + ret void + +if.end: + ret void +} +declare void @bar() nounwind + +The shift should be eliminated. Testcase derived from gcc. //===---------------------------------------------------------------------===// |

