Page MenuHomePhabricator

[WIP] Implement RFC: Decomposing deref(N) into deref(N) + nofree
Needs ReviewPublic

Authored by reames on Mar 22 2021, 11:59 AM.

Details

Summary

This implements the semantic change to dereferenceability described in the llvm-dev thread "RFC: Decomposing deref(N) into deref(N) + nofree".

At the moment, it shows the (widespread) optimization impact of simply toggling the behavior. My plan is to examine each test change to see if a) we can generalize the transform slightly to not depend on global deref, or b) what appropriate test changes (e.g. adding attributes) make sense without destroying the intend of the test. My plan is to tackle each transform in it's own review, and rebase this one incrementally as we go.

In addition to the updated tests, there are currently 4 failing tests. These simply happen to be difficult to show updates in easily due to limitations of our auto-update tests. They will be included before final review of this patch.

LLVM :: Analysis/BasicAA/dereferenceable.ll
LLVM :: Analysis/ValueTracking/memory-dereferenceable.ll
LLVM :: Transforms/VectorCombine/X86/load-inseltpoison.ll
LLVM :: Transforms/VectorCombine/X86/load.ll

Diff Detail

Unit TestsFailed

TimeTest
90 msx64 debian > Clang.CodeGenOpenCL::builtins-amdgcn.cl
Script: -- : 'RUN: at line 2'; /mnt/disks/ssd0/agent/llvm-project/build/bin/clang -cc1 -internal-isystem /mnt/disks/ssd0/agent/llvm-project/build/lib/clang/13.0.0/include -nostdsysteminc -cl-std=CL2.0 -triple amdgcn-unknown-unknown -S -emit-llvm -o - /mnt/disks/ssd0/agent/llvm-project/clang/test/CodeGenOpenCL/builtins-amdgcn.cl | /mnt/disks/ssd0/agent/llvm-project/build/bin/FileCheck -enable-var-scope /mnt/disks/ssd0/agent/llvm-project/clang/test/CodeGenOpenCL/builtins-amdgcn.cl
50 msx64 debian > LLVM.Analysis/BasicAA::dereferenceable.ll
Script: -- : 'RUN: at line 1'; /mnt/disks/ssd0/agent/llvm-project/build/bin/opt -basic-aa -print-all-alias-modref-info -aa-eval < /mnt/disks/ssd0/agent/llvm-project/llvm/test/Analysis/BasicAA/dereferenceable.ll 2>&1 | /mnt/disks/ssd0/agent/llvm-project/build/bin/FileCheck /mnt/disks/ssd0/agent/llvm-project/llvm/test/Analysis/BasicAA/dereferenceable.ll
30 msx64 debian > LLVM.Analysis/ValueTracking::memory-dereferenceable.ll
Script: -- : 'RUN: at line 1'; /mnt/disks/ssd0/agent/llvm-project/build/bin/opt -print-memderefs -analyze -S < /mnt/disks/ssd0/agent/llvm-project/llvm/test/Analysis/ValueTracking/memory-dereferenceable.ll -enable-new-pm=0 | /mnt/disks/ssd0/agent/llvm-project/build/bin/FileCheck /mnt/disks/ssd0/agent/llvm-project/llvm/test/Analysis/ValueTracking/memory-dereferenceable.ll
30 msx64 debian > LLVM.CodeGen/AArch64/GlobalISel::irtranslator-load-metadata.ll
Script: -- : 'RUN: at line 2'; /mnt/disks/ssd0/agent/llvm-project/build/bin/llc -mtriple=aarch64-- -mcpu=falkor -O0 -aarch64-enable-atomic-cfg-tidy=0 -stop-after=irtranslator -global-isel -verify-machineinstrs /mnt/disks/ssd0/agent/llvm-project/llvm/test/CodeGen/AArch64/GlobalISel/irtranslator-load-metadata.ll -o - | /mnt/disks/ssd0/agent/llvm-project/build/bin/FileCheck /mnt/disks/ssd0/agent/llvm-project/llvm/test/CodeGen/AArch64/GlobalISel/irtranslator-load-metadata.ll
30 msx64 debian > LLVM.CodeGen/AArch64/GlobalISel::irtranslator-stack-objects.ll
Script: -- : 'RUN: at line 1'; /mnt/disks/ssd0/agent/llvm-project/build/bin/llc -global-isel -mtriple=aarch64-unknown-unknown -stop-after=irtranslator -verify-machineinstrs /mnt/disks/ssd0/agent/llvm-project/llvm/test/CodeGen/AArch64/GlobalISel/irtranslator-stack-objects.ll -o - | /mnt/disks/ssd0/agent/llvm-project/build/bin/FileCheck /mnt/disks/ssd0/agent/llvm-project/llvm/test/CodeGen/AArch64/GlobalISel/irtranslator-stack-objects.ll
View Full Test Results (45 Failed)