[all-commits] [llvm/llvm-project] beadae: [llubi] Add support for constant expressions (#203...

Yingwei Zheng via All-commits all-commits at lists.llvm.org
Sun Jun 14 04:11:49 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: beadaec428a65a901be47964619121cc5b889635
      https://github.com/llvm/llvm-project/commit/beadaec428a65a901be47964619121cc5b889635
  Author: Yingwei Zheng <dtcxzyw2333 at gmail.com>
  Date:   2026-06-14 (Sun, 14 Jun 2026)

  Changed paths:
    M llvm/test/tools/llubi/global_constexpr_initializer.ll
    A llvm/test/tools/llubi/unsupported_constant.ll
    M llvm/tools/llubi/lib/Context.cpp
    M llvm/tools/llubi/lib/Context.h
    M llvm/tools/llubi/lib/Interpreter.cpp
    M llvm/tools/llubi/lib/Value.h

  Log Message:
  -----------
  [llubi] Add support for constant expressions (#203746)

This patch adds support for most kinds of constant expressions, except
for ptrtoint/inttoptr. Casting between pointers and integers is
stateful, so they cannot be cached. I plan to implement them in
subsequent patches. ptrtoaddr is also supported in this patch to block
constant folding.

The logic in `evaluateConstantExpression` duplicates the interpreter's
code in `visit*` methods. But I think it is acceptable. Only the GEP
computation is reused.



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