[all-commits] [llvm/llvm-project] c68a4c: [LLVMIR] Directly lower global initializer GEP to ...

Nikita Popov via All-commits all-commits at lists.llvm.org
Tue Sep 29 01:00:59 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c68a4ca2a9202d073b569cbfbfb269f21abf7aec
      https://github.com/llvm/llvm-project/commit/c68a4ca2a9202d073b569cbfbfb269f21abf7aec
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2026-09-29 (Tue, 29 Sep 2026)

  Changed paths:
    M mlir/lib/Target/LLVMIR/Dialect/LLVMIR/LLVMToLLVMIRTranslation.cpp
    M mlir/test/Target/LLVMIR/llvmir-invalid.mlir

  Log Message:
  -----------
  [LLVMIR] Directly lower global initializer GEP to constant expression (#226904)

MLIR lowers global initializers in a very unusual way, by using an
IRBuilder without insertion point, and relying on the fact that for a
well-formed initializer, all the instructions will be converted to
constant expressions and no actual instructions that require insertion
will be produced.

This causes issues for https://github.com/llvm/llvm-project/pull/226425,
which requires an insertion point for CreateGEP to determine the data
layout.

To avoid this, make convertGEPOp() directly produce a constant
expression GEP if there is no insertion point, reusing the existing code
path for inrange GEPs.



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