[PATCH] D91786: [GVN] Strengthen the updating of dominated users
Jonas Paulsson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 7 13:41:27 PST 2020
jonpa updated this revision to Diff 310007.
jonpa marked 2 inline comments as done.
jonpa added a comment.
Patch updated per review, and also improved to handle even more cases by iteratively accumulating the dominance. This is needed in order to handle the same example with a sanitizer enabled, which inserts new blocks before the inline asm call (see new test case @fun1).
I factored out a dominates(BB) function into the DominanceSources class. I thought about also putting an "accumulateDomince()" method there, but for now that is done directly in replaceDominatedUsesWith().
> As of D90231 <https://reviews.llvm.org/D90231> i'm personally still unconvinced that it is the LLVM code that needs fixing and not the particular code that is using __builtin_constant_p().
The s390 Linux kernel code in question here is (IMO) undoubtedly impractical, but it seems they have their reasons for that and it would be very helpful if clang could support it, or it seems clang can't be used for the Linux kernel on SystemZ, which would be a shame.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D91786/new/
https://reviews.llvm.org/D91786
Files:
llvm/include/llvm/IR/Dominators.h
llvm/include/llvm/Transforms/Scalar/GVN.h
llvm/include/llvm/Transforms/Utils/Local.h
llvm/lib/IR/Dominators.cpp
llvm/lib/Transforms/Scalar/GVN.cpp
llvm/lib/Transforms/Utils/Local.cpp
llvm/test/Transforms/builtin_constant.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91786.310007.patch
Type: text/x-patch
Size: 16670 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201207/5c0ce4d4/attachment.bin>
More information about the llvm-commits
mailing list