Page MenuHomePhabricator

[WIP][IR] Make `llvm.assume` `readnone`
Needs ReviewPublic

Authored by jdoerfert on Thu, Oct 8, 9:20 AM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

Note: This is not a full commit. No tests were changed. Used for discussion

The llvm.assume intrinsic was historically not readnone because
control dependences need to be preserved. However, the intrinsic can
nowadays be represented as what it is, potentially UB if the condition
is false (or an operand bundle is violated). No effect but potentially
UB is readnone (in contrast to speculatable). While here we add
nosync and nofree to llvm.assume.

Diff Detail

Unit TestsFailed

TimeTest
30 mslinux > LLVM.Analysis/ValueTracking::assume.ll
Script: -- : 'RUN: at line 2'; /mnt/disks/ssd0/agent/llvm-project/build/bin/opt < /mnt/disks/ssd0/agent/llvm-project/llvm/test/Analysis/ValueTracking/assume.ll -instcombine -S | /mnt/disks/ssd0/agent/llvm-project/build/bin/FileCheck /mnt/disks/ssd0/agent/llvm-project/llvm/test/Analysis/ValueTracking/assume.ll
40 mslinux > LLVM.Analysis/ValueTracking::numsignbits-from-assume.ll
Script: -- : 'RUN: at line 2'; /mnt/disks/ssd0/agent/llvm-project/build/bin/opt < /mnt/disks/ssd0/agent/llvm-project/llvm/test/Analysis/ValueTracking/numsignbits-from-assume.ll -instcombine -S | /mnt/disks/ssd0/agent/llvm-project/build/bin/FileCheck /mnt/disks/ssd0/agent/llvm-project/llvm/test/Analysis/ValueTracking/numsignbits-from-assume.ll
60 mslinux > LLVM.Transforms/Attributor::lvi-after-jumpthreading.ll
Script: -- : 'RUN: at line 2'; /mnt/disks/ssd0/agent/llvm-project/build/bin/opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=18 -S < /mnt/disks/ssd0/agent/llvm-project/llvm/test/Transforms/Attributor/lvi-after-jumpthreading.ll | /mnt/disks/ssd0/agent/llvm-project/build/bin/FileCheck /mnt/disks/ssd0/agent/llvm-project/llvm/test/Transforms/Attributor/lvi-after-jumpthreading.ll --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM
80 mslinux > LLVM.Transforms/Attributor::nofree.ll
Script: -- : 'RUN: at line 2'; /mnt/disks/ssd0/agent/llvm-project/build/bin/opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=3 -S < /mnt/disks/ssd0/agent/llvm-project/llvm/test/Transforms/Attributor/nofree.ll | /mnt/disks/ssd0/agent/llvm-project/build/bin/FileCheck /mnt/disks/ssd0/agent/llvm-project/llvm/test/Transforms/Attributor/nofree.ll --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM
110 mslinux > LLVM.Transforms/Attributor::nonnull.ll
Script: -- : 'RUN: at line 2'; /mnt/disks/ssd0/agent/llvm-project/build/bin/opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=15 -S < /mnt/disks/ssd0/agent/llvm-project/llvm/test/Transforms/Attributor/nonnull.ll | /mnt/disks/ssd0/agent/llvm-project/build/bin/FileCheck /mnt/disks/ssd0/agent/llvm-project/llvm/test/Transforms/Attributor/nonnull.ll --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM
View Full Test Results (90 Failed)

Event Timeline

jdoerfert created this revision.Thu, Oct 8, 9:20 AM
Herald added a project: Restricted Project. · View Herald TranscriptThu, Oct 8, 9:20 AM
Herald added a subscriber: bollu. · View Herald Transcript
jdoerfert requested review of this revision.Thu, Oct 8, 9:20 AM
jdoerfert edited the summary of this revision. (Show Details)
jdoerfert added a subscriber: llvm-commits.
nikic added a comment.Thu, Oct 8, 9:55 AM

This looks like a very reasonable change to me, but I can't say that I understand the full consequences :)

I think this approach makes sense.

Tyker added a comment.Thu, Oct 8, 10:33 AM

This change makes a lot of sense, but i don't understand all the consequences either.

I will (try to) do some testing with this and report back.