[llvm] [DirectX] remove string function attribute DXIL not allowed (PR #90778)
Chris B via llvm-commits
llvm-commits at lists.llvm.org
Mon May 6 13:05:52 PDT 2024
================
@@ -110,9 +140,20 @@ class DXILPrepareModule : public ModulePass {
if (!isValidForDXIL(I))
AttrMask.addAttribute(I);
}
+
+
+ dxil::ValidatorVersionMD ValVerMD(M);
+ VersionTuple ValVer = ValVerMD.getAsVersionTuple();
+ bool SkipValidation = ValVer.getMajor() == 0 && ValVer.getMinor() == 0;
+
for (auto &F : M.functions()) {
F.removeFnAttrs(AttrMask);
F.removeRetAttrs(AttrMask);
+ // Only remove string attributes if we are not skipping validation.
+ // This will reserve the experimental attributes when validation version
+ // is 0.0 for experiment mode.
+ if (!SkipValidation)
----------------
llvm-beanz wrote:
Do you have an example of an experimental attribute? It seems to me like we don't want to completely disable stripping attributes when validation is skipped.
https://github.com/llvm/llvm-project/pull/90778
More information about the llvm-commits
mailing list