[llvm] r292661 - IPO, LTO: Plumb the summary from the LTO API into the pass manager.
Peter Collingbourne via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 25 16:28:44 PST 2017
Hi Davide, does the attached patch fix your regression?
Thanks,
Peter
On Wed, Jan 25, 2017 at 3:52 PM, Davide Italiano <davide at freebsd.org> wrote:
> On Wed, Jan 25, 2017 at 3:30 PM, Davide Italiano <davide at freebsd.org>
> wrote:
> > On Fri, Jan 20, 2017 at 2:18 PM, Peter Collingbourne via llvm-commits
> > <llvm-commits at lists.llvm.org> wrote:
> >> Author: pcc
> >> Date: Fri Jan 20 16:18:52 2017
> >> New Revision: 292661
> >>
> >> URL: http://llvm.org/viewvc/llvm-project?rev=292661&view=rev
> >> Log:
> >> IPO, LTO: Plumb the summary from the LTO API into the pass manager.
> >>
> >
> > Hi Peter,
> > sorry to bring (late) bad news but this causes a regression when doing
> > LTO of one of our titles.
> > I was able to find a synthetic repro:
> >
> > $ llvm-mc -filetype=obj breakable.s -o breakable.o
> > $ opt blah.ll -o blah.o
> > $ ld.lld breakable.o blah.o -shared
> >
> > $ cat breakable.s
> > .section .rodata.patatino,"aG", at progbits,patatino,comdat
> > .weak patatino
> >
> > $ cat blah.ll
> > target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
> > target triple = "x86_64-scei-ps4"
> >
> > @dipsy = external constant i8, !type !0
> >
> > define void @tinkywinky() {
> > store i8* @dipsy, i8** undef
> > ret void
> > }
> >
>
> The second file missed a line, sorry:
>
> target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
> target triple = "x86_64-scei-ps4"
>
> @dipsy = external constant i8, !type !0
>
> define void @tinkywinky() {
> store i8* @dipsy, i8** undef
> ret void
> }
>
> !0 = !{i64 16, !"teletubbies"}
>
> --
> Davide
>
> "There are no solved problems; there are only problems that are more
> or less solved" -- Henri Poincare
>
--
--
Peter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170125/1f8ddb00/attachment.html>
-------------- next part --------------
diff --git a/llvm/lib/Transforms/IPO/LowerTypeTests.cpp b/llvm/lib/Transforms/IPO/LowerTypeTests.cpp
index c7b9564c63f..120e93ab5b7 100644
--- a/llvm/lib/Transforms/IPO/LowerTypeTests.cpp
+++ b/llvm/lib/Transforms/IPO/LowerTypeTests.cpp
@@ -878,9 +878,9 @@ void LowerTypeTestsModule::verifyTypeMDNode(GlobalObject *GO, MDNode *Type) {
report_fatal_error(
"A member of a type identifier may not have an explicit section");
- if (isa<GlobalVariable>(GO) && GO->isDeclarationForLinker())
- report_fatal_error(
- "A global var member of a type identifier must be a definition");
+ // FIXME: We previously checked that global var member of a type identifier
+ // must be a definition, but the IR linker may leave type metadata on
+ // declarations. We should restore this check after fixing PR31759.
auto OffsetConstMD = dyn_cast<ConstantAsMetadata>(Type->getOperand(0));
if (!OffsetConstMD)
@@ -1375,6 +1375,9 @@ bool LowerTypeTestsModule::lower() {
unsigned I = 0;
SmallVector<MDNode *, 2> Types;
for (GlobalObject &GO : M.global_objects()) {
+ if (isa<GlobalVariable>(GO) && GO.isDeclarationForLinker())
+ continue;
+
Types.clear();
GO.getMetadata(LLVMContext::MD_type, Types);
if (Types.empty())
More information about the llvm-commits
mailing list