[PATCH] D16074: Make sure that any new and optimized objects created during GlobalOPT copy all the attributes from the base object.

Sergei Larin via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 11 11:31:07 PST 2016


slarin created this revision.
slarin added a subscriber: llvm-commits.

Make sure that any new and optimized objects created during GlobalOPT copy all the attributes from the base object.

A good example of improper behavior in the current implementation is section information associated with the GlobalObject. If a section was set for it, and GlobalOpt is creating/modifying a new object based on this one (often copying the original name), without this change new object will be placed in a default section, resulting in inappropriate properties of the new variable.
The argument here is that if customer specified a section for a variable, any changes to it that compiler does should not cause it to change that section allocation.
Moreover, any other properties worth representation in copyAttributesFrom() should also be propagated.

http://reviews.llvm.org/D16074

Files:
  lib/Transforms/IPO/GlobalOpt.cpp
  test/Transforms/GlobalOpt/GSROA-section.ll
  test/Transforms/GlobalOpt/MallocSROA-section.ll
  test/Transforms/GlobalOpt/SROA-section.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D16074.44529.patch
Type: text/x-patch
Size: 5484 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160111/30daf78b/attachment.bin>


More information about the llvm-commits mailing list