[PATCH] D135738: [InstCombine] Bail out of casting calls when a conversion to byval is involved.
Mike Hommey via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 20 13:55:54 PDT 2022
glandium added inline comments.
================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp:3400
+ Callee->getAttributes().hasParamAttr(i, Attribute::ByVal))
+ return false; // Cannot transform to byval.
+
----------------
nikic wrote:
> Do we need to prevent the reverse direction as well? I.e. call-site has byval, function doesn't.
In theory, I guess we do. At least from the "better safe than sorry" perspective. But in practice it doesn't seem to be a problem: no conversion from byval to integer is attempted, and for pointers, the call is not changed in the first place. https://llvm.godbolt.org/z/5ov489MxP
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D135738/new/
https://reviews.llvm.org/D135738
More information about the llvm-commits
mailing list