AMDGPU/SI: Add test for folding constants into operands
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Thu, 27 Aug 2015 17:41:27 +0000 (17:41 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Thu, 27 Aug 2015 17:41:27 +0000 (17:41 +0000)
Patch by Axel Davy

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246167 91177308-0d34-0410-b5e6-96231b3b80d8

test/CodeGen/AMDGPU/si-literal-folding.ll [new file with mode: 0644]

diff --git a/test/CodeGen/AMDGPU/si-literal-folding.ll b/test/CodeGen/AMDGPU/si-literal-folding.ll
new file mode 100644 (file)
index 0000000..901b3c3
--- /dev/null
@@ -0,0 +1,17 @@
+; XFAIL: *
+; RUN: llc -march=amdgcn -mcpu=SI -verify-machineinstrs < %s | FileCheck %s
+
+; CHECK-LABEL: {{^}}main:
+; CHECK-NOT: v_mov_b32_e32 v{{[0-9]+}}, 0xbf4353f8
+
+define void @main(float) #0 {
+main_body:
+  %1 = fmul float %0, 0x3FE86A7F00000000
+  %2 = fmul float %0, 0xBFE86A7F00000000
+  call void @llvm.SI.export(i32 15, i32 0, i32 1, i32 12, i32 0, float %1, float %1, float %2, float %2)
+  ret void
+}
+
+declare void @llvm.SI.export(i32, i32, i32, i32, i32, float, float, float, float)
+
+attributes #0 = { "ShaderType"="1" }