[all-commits] [llvm/llvm-project] 320314: CodeGen: Improve generated IR for __builtin_mul_ov...

Tom Stellard via All-commits all-commits at lists.llvm.org
Thu Dec 17 14:35:47 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 3203143f1356a4e4e3ada231156fc6da6e1a9f9d
      https://github.com/llvm/llvm-project/commit/3203143f1356a4e4e3ada231156fc6da6e1a9f9d
  Author: Tom Stellard <tstellar at redhat.com>
  Date:   2020-12-17 (Thu, 17 Dec 2020)

  Changed paths:
    M clang/lib/CodeGen/CGBuiltin.cpp
    M clang/test/CodeGen/builtins-overflow.c

  Log Message:
  -----------
  CodeGen: Improve generated IR for __builtin_mul_overflow(uint, uint, int)

Add a special case for handling __builtin_mul_overflow with unsigned
inputs and a signed output to avoid emitting the __muloti4 library
call on x86_64.  __muloti4 is not implemented in libgcc, so avoiding
this call fixes compilation of some programs that call
__builtin_mul_overflow with these arguments.

For example, this fixes the build of cpio with clang, which includes code from
gnulib that calls __builtin_mul_overflow with these argument types.

Reviewed By: vsk

Differential Revision: https://reviews.llvm.org/D84405




More information about the All-commits mailing list