[llvm] [DXIL] Add constraint specification and backend implementation of DXIL Ops (PR #97593)

S. Bharadwaj Yadavalli via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 11 07:46:55 PDT 2024


================
@@ -213,11 +251,23 @@ static int getValidConstraintIndex(const OpCodeProperty *Prop,
 namespace llvm {
 namespace dxil {
 
-CallInst *DXILOpBuilder::createDXILOpCall(dxil::OpCode OpCode,
-                                          VersionTuple SMVer,
-                                          StringRef StageKind, Type *ReturnTy,
+CallInst *DXILOpBuilder::createDXILOpCall(dxil::OpCode OpCode, Type *ReturnTy,
                                           Type *OverloadTy,
                                           SmallVector<Value *> Args) {
+
+  std::string TTStr = M.getTargetTriple();
+  // No extra checks need be performed to verify that the Triple is
+  // well-formed or the target is supported since these checks would have
+  // been done at the time the module M is constructed in the earlier stages of
+  // compilation.
+  auto Major = Triple(TTStr).getOSVersion().getMajor();
----------------
bharadwajy wrote:

> This will build Triple from TTStr 3 times every time createDXILOpCall is invoked. Maybe we can add Triple as a member of DXILOpBuilder?

I expect that change to be part of the follow up NFC PR with remaining changes planned in `DXILBuilder` class that I mentioned [here](https://github.com/llvm/llvm-project/pull/97593#discussion_r1673006190).

https://github.com/llvm/llvm-project/pull/97593


More information about the llvm-commits mailing list