Page MenuHomePhabricator

Fix the compilation assertion due to unreachable BB pruning not deleting the associated BB from the jump tables
AcceptedPublic

Authored by NeHuang on Oct 30 2020, 2:13 PM.

Details

Summary

We encountered the same failure as https://reviews.llvm.org/D22435. Original bug tracked in https://bugs.llvm.org/show_bug.cgi?id=28102
@cperfetto provided a potential solution to remove the unreachable MBBs reference in the jump table. (Comment 27 and Comment 28)

We have confirmed the assertion issue fixed with this patch.

Diff Detail

Unit TestsFailed

TimeTest
330 mslinux > HWAddressSanitizer-x86_64.TestCases::sizes.cpp
Script: -- : 'RUN: at line 3'; /mnt/disks/ssd0/agent/llvm-project/build/./bin/clang --driver-mode=g++ -m64 -gline-tables-only -fsanitize=hwaddress -fuse-ld=lld -mcmodel=large -mllvm -hwasan-globals -mllvm -hwasan-use-short-granules -mllvm -hwasan-instrument-landing-pads=0 -mllvm -hwasan-instrument-personality-functions /mnt/disks/ssd0/agent/llvm-project/compiler-rt/test/hwasan/TestCases/sizes.cpp -nostdlib++ -lstdc++ -o /mnt/disks/ssd0/agent/llvm-project/build/projects/compiler-rt/test/hwasan/X86_64/TestCases/Output/sizes.cpp.tmp

Event Timeline

NeHuang created this revision.Oct 30 2020, 2:13 PM
NeHuang requested review of this revision.Oct 30 2020, 2:13 PM
NeHuang updated this revision to Diff 302691.Nov 3 2020, 2:34 PM

Add the test case.

jsji added a reviewer: Restricted Project.Nov 9 2020, 8:42 AM
bsaleil accepted this revision as: bsaleil.Nov 12 2020, 2:32 PM
bsaleil added a subscriber: bsaleil.

LGTM

This revision is now accepted and ready to land.Nov 12 2020, 2:32 PM
amyk accepted this revision as: amyk.Nov 12 2020, 2:42 PM
amyk added a subscriber: amyk.

Minor nit but LGTM

llvm/lib/CodeGen/MachineFunction.cpp
1053

nit: end with period (as well as the other comments in this patch that are added).

NeHuang updated this revision to Diff 305166.Nov 13 2020, 8:29 AM

Addressed review comments for the nits.