[tests] Stablize tests for possible change in deref semantics
authorPhilip Reames <listmail@philipreames.com>
Wed, 14 Jul 2021 20:35:18 +0000 (13:35 -0700)
committerPhilip Reames <listmail@philipreames.com>
Wed, 14 Jul 2021 20:37:50 +0000 (13:37 -0700)
commit7e496c29e2bc85e5b769e0175ca9637dbff5615a
tree8813a06254e1630d5c6bab12850209fd3a822966
parentac500fd18f0615c45d9d127bfb576ffa1e11425a
[tests] Stablize tests for possible change in deref semantics

This is conceptually part of e75a2dfe.  This file contains both tests whose results don't change (with the right attributes added), and tests which fundementally regress with the current proposal.  Doing the update took some care, thus the seperate change.

Here's the e75a2dfe context repeated:

There's a potential change in dereferenceability attribute semantics in the nearish future.  See llvm-dev thread "RFC: Decomposing deref(N) into deref(N) + nofree" and D99100 for context.

This change simply adds appropriate attributes to tests to keep transform logic exercised under both old and new/proposed semantics.  Note that for many of these cases, O3 would infer exactly these attributes on the test IR.

This change handles the idiomatic pattern of a dereferenceable object being passed to a call which can not free that memory.  There's a couple other tests which need more one-off attention, they'll be handled in another change.
llvm/test/Analysis/BasicAA/dereferenceable.ll