Page MenuHomePhabricator

[Attributor] Create `AAMustProgress` for the `mustprogress` attribute
Needs ReviewPublic

Authored by jdoerfert on Jan 14 2021, 7:13 PM.

Details

Summary

Derive the mustprogress attribute based on the willreturn attribute
or the fact that all callers are mustprogress. For now we only use
"known" willreturn not assumed ones. This is to prevent cyclic
deduction. More thought should be put in to determine what makes the
most sense.

Diff Detail

Unit TestsFailed

TimeTest
190 msx64 debian > LLVM.Transforms/OpenMP::parallel_deletion.ll
Script: -- : 'RUN: at line 2'; /mnt/disks/ssd0/agent/llvm-project/build/bin/opt -S -attributor -openmpopt < /mnt/disks/ssd0/agent/llvm-project/llvm/test/Transforms/OpenMP/parallel_deletion.ll | /mnt/disks/ssd0/agent/llvm-project/build/bin/FileCheck --allow-unused-prefixes=false /mnt/disks/ssd0/agent/llvm-project/llvm/test/Transforms/OpenMP/parallel_deletion.ll
450 msx64 debian > LLVM.tools/UpdateTestChecks/update_test_checks::check_attrs.test
Script: -- : 'RUN: at line 2'; cp -f /mnt/disks/ssd0/agent/llvm-project/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/check_attrs.ll /mnt/disks/ssd0/agent/llvm-project/build/test/tools/UpdateTestChecks/update_test_checks/Output/check_attrs.test.tmp.ll && '/usr/bin/python3.8' /mnt/disks/ssd0/agent/llvm-project/build/test/../../llvm/utils/update_test_checks.py --opt-binary /mnt/disks/ssd0/agent/llvm-project/build/test/../bin/opt /mnt/disks/ssd0/agent/llvm-project/build/test/tools/UpdateTestChecks/update_test_checks/Output/check_attrs.test.tmp.ll --function-signature
170 msx64 windows > LLVM.Transforms/OpenMP::parallel_deletion.ll
Script: -- : 'RUN: at line 2'; c:\ws\w16c2-1\llvm-project\premerge-checks\build\bin\opt.exe -S -attributor -openmpopt < C:\ws\w16c2-1\llvm-project\premerge-checks\llvm\test\Transforms\OpenMP\parallel_deletion.ll | c:\ws\w16c2-1\llvm-project\premerge-checks\build\bin\filecheck.exe --allow-unused-prefixes=false C:\ws\w16c2-1\llvm-project\premerge-checks\llvm\test\Transforms\OpenMP\parallel_deletion.ll

Event Timeline

jdoerfert created this revision.Jan 14 2021, 7:13 PM
jdoerfert requested review of this revision.Jan 14 2021, 7:13 PM
Herald added a project: Restricted Project. · View Herald Transcript
Herald added a subscriber: bbn. · View Herald Transcript
uenoku added a comment.EditedJan 26 2021, 1:11 AM

Basically it looks good to me.
However, it's not obvious to me that (known) willreturn can derive mustprogress.
(It seems correct to me though)

llvm/lib/Transforms/IPO/AttributorAttributes.cpp
2363–2367

This initialization is already done by AAMustProgress::initialize(A) so I think initialize function can be removed.

However, it's not obvious to me that (known) willreturn can derive mustprogress.

Given that we know we will return or throw, the function will make progress, so it's not going to get stuck. Arguably, it's a bit backwards but it might help down the road.