[PATCH] D106233: [InstCombine] Add freezeAllUsesOfArgument to visitFreeze
Hyeongyu Kim via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Jul 18 05:11:05 PDT 2021
hyeongyukim created this revision.
Herald added a subscriber: hiraditya.
hyeongyukim requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
In D106041 <https://reviews.llvm.org/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.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D106233
Files:
llvm/lib/Transforms/InstCombine/InstCombineInternal.h
llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
llvm/test/Transforms/InstCombine/freeze.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106233.359613.patch
Type: text/x-patch
Size: 3946 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210718/845777fb/attachment.bin>
More information about the llvm-commits
mailing list