1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-25 05:52:53 +02:00
llvm-mirror/test/Transforms/CodeGenPrepare/NVPTX/bypass-slow-div-not-exact.ll
Justin Lebar b61890b5fc Don't claim the udiv created in BypassSlowDivision is exact.
Summary:
In BypassSlowDivision's short-dividend path, we would create e.g.

  udiv exact i32 %a, %b

"exact" here means that we are asserting that %a is a multiple of %b.
But we have no reason to believe this must be true -- this is just a
bug, as far as I can tell.

Reviewers: tra

Subscribers: jholewinski, llvm-commits

Differential Revision: https://reviews.llvm.org/D26097

llvm-svn: 285459
2016-10-28 21:43:51 +00:00

17 lines
494 B
LLVM

; RUN: opt -S -codegenprepare < %s | FileCheck %s
target datalayout = "e-i64:64-v16:16-v32:32-n16:32:64"
target triple = "nvptx64-nvidia-cuda"
; Check that the smaller-width division that the BypassSlowDivision pass
; creates is not marked as "exact" (that is, it doesn't claim that the
; numerator is a multiple of the denominator).
;
; CHECK-LABEL: @test
define void @test(i64 %a, i64 %b, i64* %retptr) {
; CHECK: udiv i32
%d = sdiv i64 %a, %b
store i64 %d, i64* %retptr
ret void
}