The x86-64 ABI says that a bool is only guaranteed to be sign-extended to a byte
authorCameron Zwarich <zwarich@apple.com>
Wed, 16 Mar 2011 22:20:18 +0000 (22:20 +0000)
committerCameron Zwarich <zwarich@apple.com>
Wed, 16 Mar 2011 22:20:18 +0000 (22:20 +0000)
commitebe8173941238cfbabadb1c63bca7fb7dcf2adbe
treee26ad4384575e2b10d06cd5476abbe4d91724ada
parent7be4b7ed75d0e094d2cb1998a3d4a8d346b5d839
The x86-64 ABI says that a bool is only guaranteed to be sign-extended to a byte
rather than an int. Thankfully, this only causes LLVM to miss optimizations, not
generate incorrect code.

This just fixes the zext at the return. We still insert an i32 ZextAssert when
reading a function's arguments, but it is followed by a truncate and another i8
ZextAssert so it is not optimized.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127766 91177308-0d34-0410-b5e6-96231b3b80d8
docs/LangRef.html
include/llvm/Target/TargetLowering.h
lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
lib/Target/X86/X86ISelLowering.cpp
lib/Target/X86/X86ISelLowering.h
test/CodeGen/X86/bool-zext.ll