[PATCH] D40042: [InstCombine] Replace metadata alloca uses without a cast
Reid Kleckner via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 14 11:11:50 PST 2017
rnk created this revision.
Herald added a subscriber: hiraditya.
Changing the allocated type of an alloca requires introducing a new cast
and replacing all uses with the cast to satisfy the LLVM type system.
However, debug info (and presumably most other metadata uses) don't care
about LLVM pointee types, and would probably rather refer to the
underlying alloca instead of a bitcast. Therefore, replace the metadata
uses up front with the new alloca before doing the global replacement
with a cast.
Fixes a debug info quality issue uncovered in Chromium in
http://crbug.com/784609
https://reviews.llvm.org/D40042
Files:
llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
llvm/test/Transforms/InstCombine/alloca-cast-debuginfo.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D40042.122880.patch
Type: text/x-patch
Size: 5148 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171114/43b7be12/attachment.bin>
More information about the llvm-commits
mailing list