[all-commits] [llvm/llvm-project] c1d005: [Inline][Cloning] Introduce test for PR87963 (NFC)

Antonio Frighetto via All-commits all-commits at lists.llvm.org
Wed Apr 24 07:59:34 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c1d00510ab5e7f5052efb1e678173e3a97302e61
      https://github.com/llvm/llvm-project/commit/c1d00510ab5e7f5052efb1e678173e3a97302e61
  Author: Antonio Frighetto <me at antoniofrighetto.com>
  Date:   2024-04-24 (Wed, 24 Apr 2024)

  Changed paths:
    A llvm/test/Transforms/Inline/inline-deferred-instsimplify.ll

  Log Message:
  -----------
  [Inline][Cloning] Introduce test for PR87963 (NFC)


  Commit: a61f9fe31750cee65c726fb51f1b14e31e177258
      https://github.com/llvm/llvm-project/commit/a61f9fe31750cee65c726fb51f1b14e31e177258
  Author: Antonio Frighetto <me at antoniofrighetto.com>
  Date:   2024-04-24 (Wed, 24 Apr 2024)

  Changed paths:
    M llvm/lib/Transforms/Utils/CloneFunction.cpp
    M llvm/test/Transforms/Inline/inline-deferred-instsimplify.ll
    M llvm/test/Transforms/Inline/prof-update-sample-alwaysinline.ll
    M llvm/test/Transforms/Inline/prof-update-sample.ll

  Log Message:
  -----------
  [Inline][Cloning] Defer simplification after phi-nodes resolution

A logic issue arose when inlining via `CloneAndPruneFunctionInto`,
which, besides cloning, performs instruction simplification as well.
By the time a new cloned instruction is being simplified, phi-nodes
are not remapped yet as the whole CFG needs to be processed first.
As `VMap` state at this stage is incomplete, `threadCmpOverPHI` and
variants could lead to unsound optimizations. This issue has been
addressed by performing basic constant folding while cloning, and
postponing instruction simplification once phi-nodes are revisited.

Fixes: https://github.com/llvm/llvm-project/issues/87534.


Compare: https://github.com/llvm/llvm-project/compare/b4f923e9124c...a61f9fe31750

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