[llvm] [llubi] Implement experimental vector intrinsics (PR #206899)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 4 11:03:47 PDT 2026


================
@@ -810,6 +810,104 @@ class InstExecutor : public InstVisitor<InstExecutor, void>,
     return AnyValue();
   }
 
+  static BooleanKind getMaskLane(const AnyValue &Mask, size_t I) {
+    assert(Mask.isAggregate());
+    return Mask.asAggregate()[I].asBoolean();
+  }
+
+  AnyValue callExperimentalVectorHistogramIntrinsic(CallBase &CB,
+                                                    ArrayRef<AnyValue> Args,
+                                                    Intrinsic::ID IID) {
+    struct LaneUpdate {
+      MemoryObject *MO;
+      uint64_t Offset;
+      uint64_t Count;
+      AnyValue Old;
+      AnyValue New;
+    };
+
+    const auto &Ptrs = Args[0].asAggregate();
+    const AnyValue &Update = Args[1];
+    const AnyValue &Mask = Args[2];
+    Type *ElemTy = CB.getArgOperand(1)->getType();
+    const uint64_t AccessSize = Ctx.getEffectiveTypeStoreSize(ElemTy);
+
+    SmallVector<LaneUpdate, 8> Lanes;
----------------
dtcxzyw wrote:

```suggestion
    SmallVector<LaneUpdate, 8> Lanes;
    Lanes.reserve(Ptrs.size());
```

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


More information about the llvm-commits mailing list