[all-commits] [llvm/llvm-project] fce44f: [Scalarizer] Avoid updating the name of globals

Björn Pettersson via All-commits all-commits at lists.llvm.org
Mon Aug 24 12:56:42 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: fce44ff5da4eba4b781d73d72a18903215962091
      https://github.com/llvm/llvm-project/commit/fce44ff5da4eba4b781d73d72a18903215962091
  Author: Bjorn Pettersson <bjorn.a.pettersson at ericsson.com>
  Date:   2020-08-24 (Mon, 24 Aug 2020)

  Changed paths:
    M llvm/lib/Transforms/Scalar/Scalarizer.cpp
    M llvm/test/Transforms/Scalarizer/basic.ll
    A llvm/test/Transforms/Scalarizer/global-bug.ll

  Log Message:
  -----------
  [Scalarizer] Avoid updating the name of globals

The "takeName" logic at the end of ScalarizerVisitor::finish
could end up renaming global variables when having simplified
and extractelement instruction to simply pick a single vector
element. If the input vector to the extractelement instruction
held pointers to global variables we ended up renaming the global
variable.
The patch make sure we only take the name of the replaced Op when
we have added new instructions that might need a useful name.

Reviewed By: lebedev.ri

Differential Revision: https://reviews.llvm.org/D86472




More information about the All-commits mailing list