[PATCH] D28839: ThinLTOBitcodeWriter: Clear comdats on filtered globals.

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 18 12:14:06 PST 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL292431: ThinLTOBitcodeWriter: Clear comdats on filtered globals. (authored by pcc).

Changed prior to commit:
  https://reviews.llvm.org/D28839?vs=84787&id=84876#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D28839

Files:
  llvm/trunk/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp
  llvm/trunk/test/Transforms/ThinLTOBitcodeWriter/split.ll


Index: llvm/trunk/test/Transforms/ThinLTOBitcodeWriter/split.ll
===================================================================
--- llvm/trunk/test/Transforms/ThinLTOBitcodeWriter/split.ll
+++ llvm/trunk/test/Transforms/ThinLTOBitcodeWriter/split.ll
@@ -12,9 +12,11 @@
 ; BCA0: <GLOBALVAL_SUMMARY_BLOCK
 ; BCA1-NOT: <GLOBALVAL_SUMMARY_BLOCK
 
+$g = comdat any
+
 ; M0: @g = external global i8{{$}}
-; M1: @g = global i8 42, !type !0
- at g = global i8 42, !type !0
+; M1: @g = global i8 42, comdat, !type !0
+ at g = global i8 42, comdat, !type !0
 
 ; M0: define i8* @f()
 ; M1-NOT: @f()
Index: llvm/trunk/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp
===================================================================
--- llvm/trunk/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp
+++ llvm/trunk/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp
@@ -200,6 +200,7 @@
       continue;
 
     F.deleteBody();
+    F.setComdat(nullptr);
     F.clearMetadata();
   }
 
@@ -209,6 +210,7 @@
 
     GV.setInitializer(nullptr);
     GV.setLinkage(GlobalValue::ExternalLinkage);
+    GV.setComdat(nullptr);
     GV.clearMetadata();
   }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28839.84876.patch
Type: text/x-patch
Size: 1118 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170118/88ed6dc6/attachment.bin>


More information about the llvm-commits mailing list