diff options
author | Nadav Rotem <nrotem@apple.com> | 2012-08-30 11:23:20 +0000 |
---|---|---|
committer | Nadav Rotem <nrotem@apple.com> | 2012-08-30 11:23:20 +0000 |
commit | 639570c3117aaabb0c97b34a9bf05d09f8903ef4 (patch) | |
tree | a844659e4411dc7c722bc16c130f349d5d0667b4 /test/Transforms | |
parent | c4a32e6596f3974a6c00322db1f5f31ea448bd58 (diff) | |
download | external_llvm-639570c3117aaabb0c97b34a9bf05d09f8903ef4.zip external_llvm-639570c3117aaabb0c97b34a9bf05d09f8903ef4.tar.gz external_llvm-639570c3117aaabb0c97b34a9bf05d09f8903ef4.tar.bz2 |
It is illegal to transform (sdiv (ashr X c1) c2) -> (sdiv x (2^c1 * c2)),
because C always rounds towards zero.
Thanks Dirk and Ben.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162899 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms')
-rw-r--r-- | test/Transforms/InstCombine/2012-08-28-udiv_ashl.ll | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/test/Transforms/InstCombine/2012-08-28-udiv_ashl.ll b/test/Transforms/InstCombine/2012-08-28-udiv_ashl.ll index a35a816..4efaf8c 100644 --- a/test/Transforms/InstCombine/2012-08-28-udiv_ashl.ll +++ b/test/Transforms/InstCombine/2012-08-28-udiv_ashl.ll @@ -15,15 +15,6 @@ entry: ret i32 %div1 } -; CHECK: @sdiv400 -; CHECK: sdiv i32 %x, 400 -; CHECK: ret -define i32 @sdiv400(i32 %x) { -entry: - %div = ashr i32 %x, 2 - %div1 = sdiv i32 %div, 100 - ret i32 %div1 -} ; CHECK: @udiv400_no ; CHECK: ashr @@ -59,22 +50,6 @@ define i80 @udiv_i80(i80 %x) { ret i80 %div1 } -; CHECK: @sdiv_i80 -; CHECK: sdiv i80 %x, 400 -; CHECK: ret -define i80 @sdiv_i80(i80 %x) { - %div = ashr i80 %x, 2 - %div1 = sdiv i80 %div, 100 - ret i80 %div1 -} - - -define i32 @no_crash_notconst_sdiv(i32 %x, i32 %notconst) { - %div = ashr i32 %x, %notconst - %div1 = sdiv i32 %div, 100 - ret i32 %div1 -} - define i32 @no_crash_notconst_udiv(i32 %x, i32 %notconst) { %div = lshr i32 %x, %notconst %div1 = udiv i32 %div, 100 |