This is an archive of the discontinued LLVM Phabricator instance.

[ConstantFold] Make areGlobalsPotentiallyEqual less aggressive.
ClosedPublic

Authored by efriedma on Sep 3 2020, 9:11 PM.

Details

Summary

In particular, we shouldn't make assumptions about globals which are unnamed_addr: we can fold them together with other globals.

Also while I'm here, use isInterposable() instead of trying to explicitly name all the different kinds of weak linkage.

Fixes https://bugs.llvm.org/show_bug.cgi?id=47090

Diff Detail

Event Timeline

efriedma created this revision.Sep 3 2020, 9:11 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 3 2020, 9:11 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
efriedma requested review of this revision.Sep 3 2020, 9:11 PM
fhahn accepted this revision.Sep 6 2020, 7:41 AM

LGTM, thanks!

llvm/test/Assembler/ConstantExprNoFold.ll
47

Looks like the precommit checks complain about this. Shouldn't this be c"...." for string constants? Also, it seems like escape sequences are not supported by the bitcode parser and \0 counts as 2 chars.

This revision is now accepted and ready to land.Sep 6 2020, 7:41 AM
This revision was landed with ongoing or failed builds.Sep 11 2020, 5:23 PM
This revision was automatically updated to reflect the committed changes.