OSDN Git Service

[InstCombine] When turning sext into zext due to known bits, return the new ZExt...
authorCraig Topper <craig.topper@intel.com>
Wed, 8 May 2019 20:59:21 +0000 (20:59 +0000)
committerCraig Topper <craig.topper@intel.com>
Wed, 8 May 2019 20:59:21 +0000 (20:59 +0000)
commit780dedf4b06041036a442a35e317a8a2ff3f2284
treebd2e60b4cea3e9e2a6d80e9c38073de8e5a27402
parent38812105a9e8bb6fc186d2a3db24b8bf1ef2fc82
[InstCombine] When turning sext into zext due to known bits, return the new ZExt instead of calling replaceinstuseswith

The worklist loop that we're returning back to should be able to do the repacement itself. This is how we normally do replacements.

My main motivation was that I observed that we weren't preserving the name of the result when we do this transform. The replacement code in the worklist loop will call takeName as part of the replacement.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360284 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineCasts.cpp