Nathan =?utf-8?q?Gauër?= <[email protected]>,
Nathan =?utf-8?q?Gauër?= <[email protected]>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/[email protected]>


================
@@ -1923,6 +1924,19 @@ class IRBuilderBase {
     return Insert(new AtomicRMWInst(Op, Ptr, Val, *Align, Ordering, SSID));
   }
 
+  StructuredGEPInst *CreateStructuredGEP(Type *BaseType, Value *PtrBase,
+                                         ArrayRef<llvm::Value *> Indices,
+                                         const Twine &Name = "") {
+    SmallVector<llvm::Value *, 4> Args;
+    Args.push_back(llvm::PoisonValue::get(BaseType));
+    Args.push_back(PtrBase);
+    llvm::append_range(Args, Indices);
+
+    return cast<StructuredGEPInst>(
+        CreateIntrinsic(Intrinsic::structured_gep,
+                        {PtrBase->getType(), BaseType}, Args, {}, Name));
----------------
Flakebi wrote:

`preserve_struct_access_index` is another intrinsic that uses elementtype, it 
adds it like this:
```c++
  CallInst *Fn =
      CreateIntrinsic(Intrinsic::preserve_struct_access_index,
                      {ResultType, BaseType}, {Base, GEPIndex, DIIndex});
  Fn->addParamAttr(
      0, Attribute::get(Fn->getContext(), Attribute::ElementType, ElTy));
```

https://github.com/llvm/llvm-project/pull/176145
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to