]> granicus.if.org Git - llvm/commit
Introduce Value::stripPointerCastsSameRepresentation
authorJohannes Doerfert <jdoerfert@anl.gov>
Tue, 4 Jun 2019 20:21:46 +0000 (20:21 +0000)
committerJohannes Doerfert <jdoerfert@anl.gov>
Tue, 4 Jun 2019 20:21:46 +0000 (20:21 +0000)
commit552f50540c8ab138491a77002ee91c696c96fb67
treea5c760aa5253f3349a308758d20cae06f5eaa59b
parentac1cfa0a87fdf331b820f2b6d3120bf62b8472b8
Introduce Value::stripPointerCastsSameRepresentation

This patch allows current users of Value::stripPointerCasts() to force
the result of the function to have the same representation as the value
it was called on. This is useful in various cases, e.g., (non-)null
checks.

In this patch only a single call site was adjusted to fix an existing
misuse that would cause nonnull where they may be wrong. Uses in
attribute deduction and other areas, e.g., D60047, are to be expected.

For a discussion on this topic, please see [0].

[0] http://lists.llvm.org/pipermail/llvm-dev/2018-December/128423.html

Reviewers: hfinkel, arsenm, reames

Subscribers: wdng, hiraditya, bollu, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362545 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/IR/Value.h
lib/Analysis/LazyValueInfo.cpp
lib/IR/Value.cpp