[all-commits] [llvm/llvm-project] 1accfd: [CodeGen][inlineasm] assume the flag output of inl...

Yuanfang Chen via All-commits all-commits at lists.llvm.org
Tue Aug 2 21:52:08 PDT 2022


  Branch: refs/heads/release/15.x
  Home:   https://github.com/llvm/llvm-project
  Commit: 1accfde99a8aac9e7306290575f40c57e525f41b
      https://github.com/llvm/llvm-project/commit/1accfde99a8aac9e7306290575f40c57e525f41b
  Author: Yuanfang Chen <yuanfang.chen at sony.com>
  Date:   2022-08-02 (Tue, 02 Aug 2022)

  Changed paths:
    M clang/lib/CodeGen/CGStmt.cpp
    M clang/test/CodeGen/inline-asm-x86-flag-output.c

  Log Message:
  -----------
  [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

(cherry picked from commit 92c1bc61586c9d6c7bf0c36b1005fe00b4f48cc0)




More information about the All-commits mailing list