[llvm] [DXIL] Model DXIL Class and Shader Model association of DXIL Ops in DXIL.td (PR #87803)
S. Bharadwaj Yadavalli via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 10 18:47:35 PDT 2024
================
@@ -249,16 +255,38 @@ static FunctionType *getDXILOpFunctionType(const OpCodeProperty *Prop,
ArgTys[0], ArrayRef<Type *>(&ArgTys[1], ArgTys.size() - 1), false);
}
+static uint16_t getValidOverloadMask(const OpCodeProperty *Prop,
+ uint32_t SMVer) {
+ uint16_t ValidTyMask = 0;
+ // std::vector Prop->OverloadProp is in ascending order of SM Version
+ // Overloads of highest SM version that is not greater than SMVer
+ // are the ones that are valid for SMVer.
+ for (auto OL : Prop->OverloadProp) {
+ if (OL.ShaderModelVer <= SMVer) {
+ ValidTyMask = OL.ValidTys;
+ } else {
+ break;
+ }
+ }
+ return ValidTyMask;
+}
----------------
bharadwajy wrote:
> `std::binary_search`?
Changed to use `std::lower_bound`.
https://github.com/llvm/llvm-project/pull/87803
More information about the llvm-commits
mailing list