[PATCH] D114832: [SROA] Improve SROA to prevent generating redundant coalescing operations.

Mingming Liu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 2 14:29:22 PST 2021


luna added a comment.

In D114832#3168066 <https://reviews.llvm.org/D114832#3168066>, @aeubanks wrote:

> I'm not familiar with the term "coalesce instructions", and it doesn't appear anywhere in SROA.cpp, could you explain that in the description?

In this example (https://godbolt.org/z/fhWT48db7), coalesce instruction is ` %10 = or i64 %9, %8, !dbg !27` from the following basic block.

  7:                                                ; preds = %2, %3
    %8 = phi i64 [ %6, %3 ], [ 0, %2 ]
    %9 = phi i64 [ %5, %3 ], [ 0, %2 ]
    %10 = or i64 %9, %8, !dbg !27

Another similar example is https://godbolt.org/z/sna4TPPTY, coalesce instructions are the following three instructions

  %17 = or i64 %13, %12, !dbg !30
  %18 = or i64 %17, %14, !dbg !30
  %19 = or i64 %18, %15, !dbg !30

in the last basic block, which are used to `or` scalar values together.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D114832/new/

https://reviews.llvm.org/D114832



More information about the llvm-commits mailing list