Page MenuHomePhabricator

[ConstantFold] Make areGlobalsPotentiallyEqual less aggressive.

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



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.


Diff Detail

Unit TestsFailed

20 mslinux > LLVM.Assembler::ConstantExprNoFold.ll
Script: -- : 'RUN: at line 4'; /mnt/disks/ssd0/agent/llvm-project/build/bin/llvm-as < /mnt/disks/ssd0/agent/llvm-project/llvm/test/Assembler/ConstantExprNoFold.ll | /mnt/disks/ssd0/agent/llvm-project/build/bin/llvm-dis | /mnt/disks/ssd0/agent/llvm-project/build/bin/FileCheck /mnt/disks/ssd0/agent/llvm-project/llvm/test/Assembler/ConstantExprNoFold.ll
30 mswindows > LLVM.Assembler::ConstantExprNoFold.ll
Script: -- : 'RUN: at line 4'; c:\ws\w64\llvm-project\premerge-checks\build\bin\llvm-as.exe < C:\ws\w64\llvm-project\premerge-checks\llvm\test\Assembler\ConstantExprNoFold.ll | c:\ws\w64\llvm-project\premerge-checks\build\bin\llvm-dis.exe | c:\ws\w64\llvm-project\premerge-checks\build\bin\filecheck.exe C:\ws\w64\llvm-project\premerge-checks\llvm\test\Assembler\ConstantExprNoFold.ll

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!


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.