[llvm-commits] [llvm] r127754 - /llvm/trunk/test/CodeGen/X86/bool-args-zext.ll

Cameron Zwarich zwarich at apple.com
Wed Mar 16 13:15:44 PDT 2011


Author: zwarich
Date: Wed Mar 16 15:15:44 2011
New Revision: 127754

URL: http://llvm.org/viewvc/llvm-project?rev=127754&view=rev
Log:
Add a test for i1 zeroext arguments on x86-64. We currently generate code that
conforms to the ABI, but DAGCombine could in theory recognize the sequence of
zext asserts and truncates and generate incorrect code.

Added:
    llvm/trunk/test/CodeGen/X86/bool-args-zext.ll

Added: llvm/trunk/test/CodeGen/X86/bool-args-zext.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/bool-args-zext.ll?rev=127754&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/X86/bool-args-zext.ll (added)
+++ llvm/trunk/test/CodeGen/X86/bool-args-zext.ll Wed Mar 16 15:15:44 2011
@@ -0,0 +1,23 @@
+; RUN: llc < %s -march=x86-64 | FileCheck %s
+
+; CHECK: @bar1
+; CHECK: movzbl
+; CHECK: callq
+define void @bar1(i1 zeroext %v1) nounwind ssp {
+entry:
+  %conv = zext i1 %v1 to i32
+  %call = tail call i32 (...)* @foo(i32 %conv) nounwind
+  ret void
+}
+
+; CHECK: @bar2
+; CHECK-NOT: movzbl
+; CHECK: callq
+define void @bar2(i8 zeroext %v1) nounwind ssp {
+entry:
+  %conv = zext i8 %v1 to i32
+  %call = tail call i32 (...)* @foo(i32 %conv) nounwind
+  ret void
+}
+
+declare i32 @foo(...)





More information about the llvm-commits mailing list