OSDN Git Service

[InstCombine] Avoid creating mis-sized dbg.values in commonCastTransforms()
authorVedant Kumar <vsk@apple.com>
Wed, 27 Jun 2018 00:47:53 +0000 (00:47 +0000)
committerVedant Kumar <vsk@apple.com>
Wed, 27 Jun 2018 00:47:53 +0000 (00:47 +0000)
commitbde65c4dd971fb8c1f13a43651f2c72ddf9bebdf
tree2ee77731abcda612e04b47b2e6f6a3bd14e27196
parent3dbfeaffe7a9c26b463c577feb650e0f32da36cc
[InstCombine] Avoid creating mis-sized dbg.values in commonCastTransforms()

This prevents InstCombine from creating mis-sized dbg.values when
replacing a sequence of casts with a simpler cast. For example, in:

  (fptrunc (floor (fpext X))) -> (floorf X)

We no longer emit dbg.value(X) (with a 32-bit float operand) to describe
(fpext X) (which is a 64-bit float).

This was diagnosed by the debugify check added in r335682.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335696 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineCasts.cpp
test/Transforms/InstCombine/double-float-shrink-2.ll