[all-commits] [llvm/llvm-project] aca5ae: [InstCombine] Add freezeAllUsesOfArgument to visit...

Hyeongyu Kim via All-commits all-commits at lists.llvm.org
Sat Jul 24 02:09:12 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: aca5aeb7523d7868a4b0706330dcdfc58c0adaed
      https://github.com/llvm/llvm-project/commit/aca5aeb7523d7868a4b0706330dcdfc58c0adaed
  Author: hyeongyu kim <gusrb406 at snu.ac.kr>
  Date:   2021-07-24 (Sat, 24 Jul 2021)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineInternal.h
    M llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
    M llvm/test/Transforms/InstCombine/freeze.ll
    M llvm/test/Transforms/PhaseOrdering/X86/vector-reductions-logical.ll

  Log Message:
  -----------
  [InstCombine] Add freezeAllUsesOfArgument to visitFreeze

In D106041, a freeze was added before the branch condition to solve the miscompilation problem of SimpleLoopUnswitch.
However, I found that the added freeze disturbed other optimizations in the following situations.
```
arg.fr = freeze(arg)
use(arg.fr)
...
use(arg)
```
It is a problem that occurred when arg and arg.fr were recognized as different values.
Therefore, changing to use arg.fr instead of arg throughout the function eliminates the above problem.
Thus, I add a function that changes all uses of arg to freeze(arg) to visitFreeze of InstCombine.

Reviewed By: nikic

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




More information about the All-commits mailing list