[llvm] [DXIL] Add DXIL version-specific TableGen specification and implementation of DXIL Ops (PR #97593)
S. Bharadwaj Yadavalli via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 30 13:45:42 PDT 2024
================
@@ -42,6 +48,7 @@ class DXILOpBuilder {
private:
Module &M;
IRBuilderBase &B;
+ Triple TargetTriple;
----------------
bharadwajy wrote:
> It will simplify things to have the DXIL version and shader stage as members instead of the triple, and then we can just assume that they're valid like so:
>
> ```c++
> DXILOpBuilder::DXILOpBuilder(Module &M, IRBuilderBase &B) : M(M), B(B) {
> Triple TT(M.getTargetTriple());
> DXILVersion = TT.getDXILVersion();
> assert(TT.isShaderStageEnvironment() &&
> "Cannot build DXIL ops outside of shader environment");
> ShaderStage = TT.getEnvironment();
> }
> ```
>
> It shouldn't be DXILOpBuilder's job to validate the triple.
Changed.
https://github.com/llvm/llvm-project/pull/97593
More information about the llvm-commits
mailing list