[PATCH] D122081: Add DXILPrepare CodeGen pass

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 20 06:27:18 PDT 2022


nikic added inline comments.


================
Comment at: llvm/lib/Target/DirectX/DXILPrepare.cpp:64
+  }
+#include "llvm/IR/Attributes.inc"
+      for (auto &BB : F) {
----------------
beanz wrote:
> nikic wrote:
> > Do you really need Attributes.inc here? You should be able to loop over all attributes using Attribute::None and Attribute::EndAttrKind.
> I don't strictly need it, but if `isValidForDXIL` gets called with a constant it should get constant-folded to true/false. That isn't the case if I call it in a loop.
You can construct an AttributeMask with all the invalid attributes upfront, and then remove that mask, rather than removing each attribute individually. In that case, constant folding shouldn't matter, and you can probably drop D122079 entirely.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D122081/new/

https://reviews.llvm.org/D122081



More information about the llvm-commits mailing list