[all-commits] [llvm/llvm-project] 5cc8a5: [CIR] Fix 'isConstant' calc when looking at an inc...
Erich Keane via All-commits
all-commits at lists.llvm.org
Mon Sep 14 17:47:52 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 5cc8a513b417ab7dd791b78863e2f5f834f818d8
https://github.com/llvm/llvm-project/commit/5cc8a513b417ab7dd791b78863e2f5f834f818d8
Author: Erich Keane <ekeane at nvidia.com>
Date: 2026-09-14 (Mon, 14 Sep 2026)
Changed paths:
M clang/lib/CIR/CodeGen/CIRGenModule.cpp
M clang/test/CIR/CodeGen/forward-decls.cpp
Log Message:
-----------
[CIR] Fix 'isConstant' calc when looking at an incomplete type (#223444)
This popped up in a benchmark. Classic codegen ALWAYS sets this as
'excludeCtor'/'excludeDtor', but CIR tried 'harder' to get this right.
However, with an incomplete type, we can't actually look into it to see
if it has any mutable members, so determining 'constness' isn't
possible.
We could PROBABLY do better with enums since I would assume they can be
constant most of the time, but we fall-back to classic-codegen's
behavior here instead: which marks it as non-const.
Thanks to 'trying harder' than classic codegen as mentioned above, there
IS a slight LLVM-IR difference, but for the better.
Also note: Claude helped me with the tests.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list