[all-commits] [llvm/llvm-project] 8bfe46: [NFC][InstCombine] Add tests with PHI-of-{insert, e...

Roman Lebedev via All-commits all-commits at lists.llvm.org
Wed Aug 26 10:21:05 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 8bfe46dce22266e596370eac86b1aae799300e7e
      https://github.com/llvm/llvm-project/commit/8bfe46dce22266e596370eac86b1aae799300e7e
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2020-08-26 (Wed, 26 Aug 2020)

  Changed paths:
    M llvm/test/Transforms/InstCombine/phi-of-extractvalues.ll
    M llvm/test/Transforms/InstCombine/phi-of-insertvalues.ll

  Log Message:
  -----------
  [NFC][InstCombine] Add tests with PHI-of-{insert,extract}value with multiple uses

It is fine if the operation has multiple uses, as long as they are all
in this very PHI node.


  Commit: c07a430bd39cccb64712ddcba85254a5bb1cd89b
      https://github.com/llvm/llvm-project/commit/c07a430bd39cccb64712ddcba85254a5bb1cd89b
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2020-08-26 (Wed, 26 Aug 2020)

  Changed paths:
    M llvm/include/llvm/IR/Value.h

  Log Message:
  -----------
  [NFC][Value] Fixup comments, "N users" is NOT the same as "N uses".

In those cases, it really means "N uses".


  Commit: 95848ea101274b8bd774c63bad55f21a08080705
      https://github.com/llvm/llvm-project/commit/95848ea101274b8bd774c63bad55f21a08080705
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2020-08-26 (Wed, 26 Aug 2020)

  Changed paths:
    M llvm/include/llvm/IR/Value.h
    M llvm/lib/IR/Value.cpp
    M llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp
    M llvm/test/Transforms/InstCombine/phi-aware-aggregate-reconstruction.ll
    M llvm/test/Transforms/InstCombine/phi-of-extractvalues.ll
    M llvm/test/Transforms/InstCombine/phi-of-insertvalues.ll
    M llvm/test/Transforms/LoopUnroll/runtime-loop-multiple-exits.ll
    M llvm/test/Transforms/PGOProfile/chr.ll

  Log Message:
  -----------
  [Value][InstCombine] Fix one-use checks in PHI-of-op -> Op-of-PHI[s] transforms to be one-user checks

As FIXME said, they really should be checking for a single user,
not use, so let's do that. It is not *that* unusual to have
the same value as incoming value in a PHI node, not unlike
how a PHI may have the same incoming basic block more than once.

There isn't a nice way to do that, Value::users() isn't uniqified,
and Value only tracks it's uses, not Users, so the check is
potentially costly since it does indeed potentially involes
traversing the entire use list of a value.


Compare: https://github.com/llvm/llvm-project/compare/9061eb8245cc...95848ea10127


More information about the All-commits mailing list