[PATCH] D159206: [Clang] Propagate target-features if compatible when using mlink-builtin-bitcode
Juan Manuel Martinez CaamaƱo via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Sep 6 01:52:00 PDT 2023
jmmartinez added inline comments.
================
Comment at: clang/lib/CodeGen/CGCall.cpp:2030-2031
+ bool EnabledForTarget = TEntry->second;
+ if (EnabledForTarget != EnabledForFunc)
+ return;
+ }
----------------
arsenm wrote:
> jmmartinez wrote:
> > arsenm wrote:
> > > Early return breaks the other features
> > I did not understand this remark.
> >
> > If the features are not compatible, we do not add a "target-features" entry in the new "FuncAttrs". Then, the old "target-features" entry is kept in the Function coming from the builtin.
> >
> > If you think it would be better to set the target-features in FuncAttrs to the old value in any case. If that's the case I've added the following code:
> >
> > if (EnabledForTarget != EnabledForFunc) {
> > FuncAttr.addAttribute(FFeatures);
> > return;
> > }
> You find an incompatible feature and then discontinue processing any further features by early exiting. I expect this to act like an append to any features already present. The incompatibility is at an individual feature level, not the group
I see. I changed it to match that behaviour.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D159206/new/
https://reviews.llvm.org/D159206
More information about the cfe-commits
mailing list