summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/Generic
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test/CodeGen/Generic')
-rw-r--r--llvm/test/CodeGen/Generic/dag-combine-select-undef.ll24
1 files changed, 24 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/Generic/dag-combine-select-undef.ll b/llvm/test/CodeGen/Generic/dag-combine-select-undef.ll
new file mode 100644
index 00000000000..bc741906187
--- /dev/null
+++ b/llvm/test/CodeGen/Generic/dag-combine-select-undef.ll
@@ -0,0 +1,24 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: llc < %s | FileCheck %s
+
+define void @select_undef_n1(float addrspace(1)* %a, i32 %c) {
+; CHECK-LABEL: select_undef_n1:
+; CHECK: # %bb.0:
+; CHECK-NEXT: movl $1065353216, (%rdi) # imm = 0x3F800000
+; CHECK-NEXT: retq
+ %cc = icmp eq i32 %c, 0
+ %sel = select i1 %cc, float 1.000000e+00, float undef
+ store float %sel, float addrspace(1)* %a
+ ret void
+}
+
+define void @select_undef_n2(float addrspace(1)* %a, i32 %c) {
+; CHECK-LABEL: select_undef_n2:
+; CHECK: # %bb.0:
+; CHECK-NEXT: movl $1065353216, (%rdi) # imm = 0x3F800000
+; CHECK-NEXT: retq
+ %cc = icmp eq i32 %c, 0
+ %sel = select i1 %cc, float undef, float 1.000000e+00
+ store float %sel, float addrspace(1)* %a
+ ret void
+}
OpenPOWER on IntegriCloud