[PATCH] D82861: [Attributor] Add AAValueSimplifyCallSiteArgument::manifest
Shinji Okumura via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 30 04:18:58 PDT 2020
okura created this revision.
okura added a reviewer: jdoerfert.
Herald added subscribers: llvm-commits, kuter, uenoku, javed.absar, hiraditya.
Herald added a reviewer: sstefan1.
Herald added a reviewer: uenoku.
Herald added a reviewer: homerdin.
Herald added a reviewer: baziotis.
Herald added a project: LLVM.
Value simplification result in `AAValueSimplify` is sometimes flow-sensitive because of `AAConstantRange::getConstantRangeFromLVI`,`AAConstantRange::getConstantRangeFromSCEV`.
But manifestation for callsite argument is done in the same way for the floating position. This causes the following unexpected simplification, for example.
Before:
define i32 @g(i1 %d) {
br i1 %c, label %t, label %f
t:
%ret1 = call i32 @f(i1 %c)
ret i32 %ret1
f:
%ret2 = call i32 @f(i1 false)
ret i32 %ret2
}
After:
define i32 @g(i1 %d) {
br label %t
t:
%ret1 = call i32 @f(i1 true)
ret i32 %ret1
f:
%ret2 = call i32 @f(i1 false)
ret i32 %ret2
}
This patch fix the problem by replacing use with simplified values in manifestation.
https://reviews.llvm.org/D82861
Files:
llvm/lib/Transforms/IPO/AttributorAttributes.cpp
llvm/test/Transforms/Attributor/range.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D82861.274400.patch
Type: text/x-patch
Size: 4316 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200630/a9b461c0/attachment.bin>
More information about the llvm-commits
mailing list