[all-commits] [llvm/llvm-project] 53907e: [clang][codegen] Don't mark "int" TBAA on FP libca...

Benjamin Maxwell via All-commits all-commits at lists.llvm.org
Wed Sep 25 01:51:16 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 53907ed5081b6cfde6cbe147ab06a074a4f3e0ed
      https://github.com/llvm/llvm-project/commit/53907ed5081b6cfde6cbe147ab06a074a4f3e0ed
  Author: Benjamin Maxwell <benjamin.maxwell at arm.com>
  Date:   2024-09-25 (Wed, 25 Sep 2024)

  Changed paths:
    M clang/lib/CodeGen/CGBuiltin.cpp
    M clang/lib/CodeGen/CGExpr.cpp
    M clang/lib/CodeGen/CodeGenFunction.h
    A clang/test/CodeGen/math-libcalls-tbaa-indirect-args.c

  Log Message:
  -----------
  [clang][codegen] Don't mark "int" TBAA on FP libcalls with indirect args (#108853)

On some targets, an FP libcall with argument types such as long double
will be lowered to pass arguments indirectly via pointers. When this is
the case we should not mark the libcall with "int" TBAA as it may lead
to incorrect optimizations.

Currently, this can be seen for long doubles on x86_64-w64-mingw32. The
`load x86_fp80` after the call is (incorrectly) marked with "int" TBAA
(overwriting the previous metadata for "long double").

Nothing seems to break due to this currently as the metadata is being
incorrectly placed on the load and not the call. But if the metadata
is moved to the call (which this patch ensures), LLVM will optimize out
the setup for the arguments.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list