[all-commits] [llvm/llvm-project] ec489a: [IPSCCP] Fix a bug that the "returned" attribute i...
dancgr via All-commits
all-commits at lists.llvm.org
Wed Sep 2 08:23:19 PDT 2020
Branch: refs/heads/master
Home: https://github.com/llvm/llvm-project
Commit: ec489ae048fd971b22400c61458a5295eeba368a
https://github.com/llvm/llvm-project/commit/ec489ae048fd971b22400c61458a5295eeba368a
Author: Congzhe Cao <congzhe.cao@@huawei.com>
Date: 2020-09-02 (Wed, 02 Sep 2020)
Changed paths:
M llvm/lib/Transforms/Scalar/SCCP.cpp
A llvm/test/Transforms/SCCP/ipsccp-clear-returned.ll
Log Message:
-----------
[IPSCCP] Fix a bug that the "returned" attribute is not cleared when function is optimized to return undef
In IPSCCP when a function is optimized to return undef, it should clear the returned attribute for all its input arguments
and its corresponding call sites.
The bug is exposed when the value of an input argument of the function is assigned to a physical register and
because of the argument having a returned attribute, the value of this physical register will continue to be used
as the function return value right after the call instruction returns, even if the value that this register holds may
be clobbered during the function call. This potentially results in incorrect values being used afterwards.
Reviewed By: jdoerfert, fhahn
Differential Revision: https://reviews.llvm.org/D84220
More information about the All-commits
mailing list