[clang] [CIR] Mark sizeof & alignof as NYI for scalable Vector (PR #172861)

Amr Hesham via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 19 04:32:57 PST 2025


AmrDeveloper wrote:

> ```c++
> return builder.getConstant(
>       loc, cir::IntAttr::get(cgf.cgm.uInt64Ty,
>       e->EvaluateKnownConstInt(cgf.getContext())));
> ```

For a fixed vector, it's updated to get the size directly.

```
return builder.getConstant(
        loc, cir::IntAttr::get(cgf.cgm.uInt64Ty, vecTy.getSize()));
```

And for scalable, it's NYI because, similar to classical codegen, we need `llvm.vscale` and perform a mul op, and after the NYI, I returned the old value for now so we can recover from this error and print as many errors as we can.

> Is there no way to test the NYI logic? I would normally check myself, but am already OOO (and afk) for the break.

I also usually check myself locally and make sure it hits this part, but for this case, i already know it when I implement sizeof and countof :D, I was just waiting for scalable vector to be added to update it


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


More information about the cfe-commits mailing list