[all-commits] [llvm/llvm-project] cc14ec: [InstCombine] Don't change fn signature for calls ...
Nikita Popov via All-commits
all-commits at lists.llvm.org
Mon Aug 12 01:12:22 PDT 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: cc14ecc281331be8f44b370a437a7f1eb7f5c7c9
https://github.com/llvm/llvm-project/commit/cc14ecc281331be8f44b370a437a7f1eb7f5c7c9
Author: Nikita Popov <npopov at redhat.com>
Date: 2024-08-12 (Mon, 12 Aug 2024)
Changed paths:
M llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
M llvm/test/Transforms/InstCombine/apint-call-cast-target.ll
M llvm/test/Transforms/InstCombine/call-cast-target.ll
M llvm/test/Transforms/InstCombine/call.ll
M llvm/test/Transforms/InstCombine/opaque-ptr.ll
Log Message:
-----------
[InstCombine] Don't change fn signature for calls to declarations (#102596)
transformConstExprCastCall() implements a number of highly dubious
transforms attempting to make a call function type line up with the
function type of the called function. Historically, the main value this
had was to avoid function type mismatches due to pointer type
differences, which is no longer relevant with opaque pointers.
This patch is a step towards reducing the scope of the transform, by
applying it only to definitions, not declarations. For declarations, the
declared signature might not match the actual function signature, e.g.
`void @fn()` is sometimes used as a placeholder for functions with
unknown signature. The implementation already bailed out in some cases
for declarations, but I think it would be safer to disable the transform
entirely.
For the test cases, I've updated some of them to use definitions
instead, so that the test coverage is preserved.
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