[CodeGen][inlineasm] assume the flag output of inline asm is boolean value
authorYuanfang Chen <yuanfang.chen@sony.com>
Fri, 29 Jul 2022 21:50:40 +0000 (14:50 -0700)
committerYuanfang Chen <yuanfang.chen@sony.com>
Tue, 2 Aug 2022 18:49:01 +0000 (11:49 -0700)
commit92c1bc61586c9d6c7bf0c36b1005fe00b4f48cc0
tree72e15849f9ea0af0bd7d70dcaffc687ca70bc719
parent9921ef73c864c5aa7a2f1e539a09d5cbd487def9
[CodeGen][inlineasm] assume the flag output of inline asm is boolean value

GCC inline asm document says that
"... the general rule is that the output variable must be a scalar
integer, and the value is boolean."

Commit e5c37958f901cc9bec50624dbee85d40143e4bca lowers flag output of
inline asm on X86 with setcc, hence it is guaranteed that the flag
is of boolean value. Clang does not support ARM inline asm flag output
yet so nothing need to be worried about ARM.

See "Flag Output" section at
https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html#OutputOperands

Fixes https://github.com/llvm/llvm-project/issues/56568

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D129954
clang/lib/CodeGen/CGStmt.cpp
clang/test/CodeGen/inline-asm-x86-flag-output.c