[all-commits] [llvm/llvm-project] ee6f5f: [InstCombine] Replace alloca with undef size with ...

Manuel Carrasco via All-commits all-commits at lists.llvm.org
Fri Feb 27 11:14:18 PST 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ee6f5f386f95753d869045acbe54a6b3ec38dde9
      https://github.com/llvm/llvm-project/commit/ee6f5f386f95753d869045acbe54a6b3ec38dde9
  Author: Manuel Carrasco <Manuel.Carrasco at amd.com>
  Date:   2026-02-27 (Fri, 27 Feb 2026)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
    A llvm/test/Transforms/InstCombine/alloca-poison-size.ll

  Log Message:
  -----------
  [InstCombine] Replace alloca with undef size with poison instead of null (#182919)

InstCombine previously replaced an alloca instruction with a null
pointer when the array size operand was undef. While this replacement
may be legal, it still caused invalid IR in cases where the original
alloca was used by `@llvm.lifetime` intrinsics.

The spec requires that the pointer operand of `@llvm.lifetime.*` must be
either:

- a pointer to an alloca instruction, or
- a poison value.

Replacing the pointer with null violated this requirement and triggered
verifier errors.

These new changes update InstCombine so that in this scenario the alloca
is replaced with poison instead of null.



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