[all-commits] [llvm/llvm-project] 1bac51: [Reduce] Function reduction: replace all users of ...

Roman Lebedev via All-commits all-commits at lists.llvm.org
Mon Jul 27 05:40:13 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 1bac5101cdaabfbc755a6d28936962d11240f932
      https://github.com/llvm/llvm-project/commit/1bac5101cdaabfbc755a6d28936962d11240f932
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2020-07-27 (Mon, 27 Jul 2020)

  Changed paths:
    M llvm/tools/llvm-reduce/deltas/ReduceFunctions.cpp

  Log Message:
  -----------
  [Reduce] Function reduction: replace all users of function with undef

There may be other users of a function other than CallInsts,
but what's more important, we can't actually replace function pointer
with undef, because for constants, that would not preserve the type
and RAUW would assert.

In particular, that affects blockaddress, however it proves to be
prohibitively complex to come up with a good test involving blockaddress:
we'd need to both ensure that the function body survives until
this pass, and is not interesting in this pass.


  Commit: 61480db6019d01a7a97de6ec64991664bf9b4996
      https://github.com/llvm/llvm-project/commit/61480db6019d01a7a97de6ec64991664bf9b4996
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2020-07-27 (Mon, 27 Jul 2020)

  Changed paths:
    A llvm/test/Reduce/remove-function-arguments-of-funcs-used-in-blockaddress.ll
    M llvm/test/Reduce/remove-invoked-functions.ll
    M llvm/tools/llvm-reduce/deltas/ReduceArguments.cpp

  Log Message:
  -----------
  [Reduce] Argument reduction: shoe-horn new function into remaining uses of old function

Much like with function reduction, there may be remaining unhandled uses
of function, in particular in blockaddress. And in constants we can't
RAUW it with undef, because undef is not a function.
Instead, let's try to pretent that in the remaining cases, the new
signature didn't change, by bitcasting it.

A new (previously crashing) test case added.


  Commit: 1da9834557cd4302a5183b8228ce063e69f82602
      https://github.com/llvm/llvm-project/commit/1da9834557cd4302a5183b8228ce063e69f82602
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2020-07-27 (Mon, 27 Jul 2020)

  Changed paths:
    M llvm/lib/Transforms/Scalar/JumpThreading.cpp
    A llvm/test/Transforms/JumpThreading/pr46857-callbr.ll

  Log Message:
  -----------
  [JumpThreading] ProcessBranchOnXOR(): bailout if any pred ends in indirect branch (PR46857)

SplitBlockPredecessors() can not split blocks that have such terminators,
and in two other places we already ensure that we don't end up calling
SplitBlockPredecessors() on such blocks. Do so in one more place.

Fixes https://bugs.llvm.org/show_bug.cgi?id=46857


Compare: https://github.com/llvm/llvm-project/compare/d1271127240b...1da9834557cd


More information about the All-commits mailing list