summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/NVPTX/minmax-negative.ll
diff options
context:
space:
mode:
authorArtur Gainullin <artur.gainullin@intel.com>2017-10-27 20:53:41 +0000
committerArtur Gainullin <artur.gainullin@intel.com>2017-10-27 20:53:41 +0000
commitaf7ba8ff6bfc6688419bf863f613b8ed16852879 (patch)
treee7a4ee0ace5939a0c474f62e58b1b0ba8304f413 /llvm/test/CodeGen/NVPTX/minmax-negative.ll
parenta0183b30c52d63d525b33dd154a4f06e44485d87 (diff)
downloadbcm5719-llvm-af7ba8ff6bfc6688419bf863f613b8ed16852879.tar.gz
bcm5719-llvm-af7ba8ff6bfc6688419bf863f613b8ed16852879.zip
Improve clamp recognition in ValueTracking.
Summary: ValueTracking was recognizing not all variations of clamp. Swapping of true value and false value of select was added to fix this problem. The first patch was reverted because it caused miscompile in NVPTX target. Added corresponding test cases. Reviewers: spatel, majnemer, efriedma, reames Subscribers: llvm-commits, jholewinski Differential Revision: https://reviews.llvm.org/D39240 llvm-svn: 316795
Diffstat (limited to 'llvm/test/CodeGen/NVPTX/minmax-negative.ll')
-rw-r--r--llvm/test/CodeGen/NVPTX/minmax-negative.ll9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/NVPTX/minmax-negative.ll b/llvm/test/CodeGen/NVPTX/minmax-negative.ll
new file mode 100644
index 00000000000..73bd9e049e7
--- /dev/null
+++ b/llvm/test/CodeGen/NVPTX/minmax-negative.ll
@@ -0,0 +1,9 @@
+; RUN: llc < %s -march=nvptx -O0 | FileCheck %s
+
+define i16 @test1(i16* %sur1) {
+; CHECK-NOT: mov.u16 %rs{{[0-9]+}}, 32767
+ %_tmp21.i = icmp sle i16 0, 0
+ %_tmp22.i = select i1 %_tmp21.i, i16 0, i16 32767
+ store i16 %_tmp22.i, i16* %sur1
+ ret i16 0
+}
OpenPOWER on IntegriCloud