llvm-project/llvm/test/Transforms/RewriteStatepointsForGC
Philip Reames 01801d5274 [rs4gc] Fix a latent bug around attribute stripping for intrinsics
This change fixes a latent bug which was exposed by a change currently in review (https://reviews.llvm.org/D99802#2685032).

The story on this is a bit involved.  Without this change, what ended up happening with the pending review was that we'd strip attributes off intrinsics, and then selectiondag would fail to lower the intrinsic.  Why?  Because the lowering of the intrinsic relies on the presence of the readonly attribute.  We don't have a matcher to select the case where there's a glue node needed.

Now, on the surface, this still seems like a codegen bug.  However, here it gets fun.  I was unable to reproduce this with a standalone test at all, and was pretty much struck until skatkov provided the critical detail.  This reproduces only when RS4GC and codegen are run in the same process and context.  Why?  Because it turns out we can't roundtrip the stripped attribute through serialized IR!

We'll happily print out the missing attribute, but when we parse it back, the auto-upgrade logic has a side effect of blindly overwriting attributes on intrinsics with those specified in Intrinsics.td.  This makes it impossible to exercise SelectionDAG from a standalone test case.

At this point, I decided to treat this an RS4GC bug as a) we don't need to strip in this case, and b) I could write a test which shows the correct behavior to ensure this doesn't break again in the future.

As an aside, I'd originally set out to handle libfuncs too - since in theory they might have the same issues - but backed away quickly when I realized how the semantics of builtin, nobuiltin, and no-builtin-x all interacted.  I'm utterly convinced that no part of the optimizer handles that correctly, and decided not to open that can of worms here.
2021-04-19 13:14:07 -07:00
..
X86 [rs4gc] Fix a latent bug around attribute stripping for intrinsics 2021-04-19 13:14:07 -07:00
base-inference.ll [rs4gc] don't force a conflict for a canonical broadcast 2021-03-16 12:59:06 -07:00
base-pointers-1.ll [rs4gc/tests] Remove use of internal debug flags 2021-03-06 09:20:02 -08:00
base-pointers-2.ll [rs4gc/tests] Remove use of internal debug flags 2021-03-06 09:20:02 -08:00
base-pointers-3.ll [rs4gc/tests] Remove use of internal debug flags 2021-03-06 09:20:02 -08:00
base-pointers-4.ll [rs4gc] don't duplicate existing values which are provably base pointers 2021-03-16 12:51:21 -07:00
base-pointers-5.ll [rs4gc/tests] Remove use of internal debug flags 2021-03-06 09:20:02 -08:00
base-pointers-6.ll [rs4gc/tests] Remove use of internal debug flags 2021-03-06 09:20:02 -08:00
base-pointers-7.ll [rs4gc/tests] Remove use of internal debug flags 2021-03-06 09:20:02 -08:00
base-pointers-8.ll [rs4gc/tests] Remove use of internal debug flags 2021-03-06 09:20:02 -08:00
base-pointers-9.ll [rs4gc/tests] Remove use of internal debug flags 2021-03-06 09:20:02 -08:00
base-pointers-10.ll [rs4gc/tests] Remove use of internal debug flags 2021-03-06 09:20:02 -08:00
base-pointers-11.ll [rs4gc/tests] Remove use of internal debug flags 2021-03-06 09:20:02 -08:00
base-pointers-12.ll [rs4gc/tests] Remove use of internal debug flags 2021-03-06 09:20:02 -08:00
base-pointers-13.ll [rs4gc/tests] Remove use of internal debug flags 2021-03-06 09:20:02 -08:00
base-pointers.ll [rs4gc] don't duplicate existing values which are provably base pointers 2021-03-16 12:51:21 -07:00
base-vector-inseltpoison.ll [rs4gc] don't duplicate existing values which are provably base pointers 2021-03-16 12:51:21 -07:00
base-vector.ll [rs4gc] don't duplicate existing values which are provably base pointers 2021-03-16 12:51:21 -07:00
basic.ll
basics.ll
call-gc-result.ll
check_traversal_order-inseltpoison.ll
check_traversal_order.ll
codegen-cond.ll
constants.ll
deopt-intrinsic-cconv.ll
deopt-intrinsic.ll
deopt-lowering-attrs.ll [tests] Update an autogen test for format change 2021-03-06 09:49:27 -08:00
deref-pointers.ll
drop-invalid-metadata.ll
gc-relocate-creation.ll
invokes.ll
leaf-function.ll
libcall.ll
live-vector-nosplit-inseltpoison.ll [rs4gc] don't duplicate existing values which are provably base pointers 2021-03-16 12:51:21 -07:00
live-vector-nosplit.ll [rs4gc] don't duplicate existing values which are provably base pointers 2021-03-16 12:51:21 -07:00
liveness-basics.ll
meetBDVState-hangs.ll [RS4GC] Fix hang on infinite loop 2021-03-23 12:54:51 +07:00
patchable-statepoints.ll
preprocess.ll
relocate-invoke-result.ll
relocation.ll
rematerialize-derived-pointers.ll [rs4gc] don't duplicate existing values which are provably base pointers 2021-03-16 12:51:21 -07:00
rewrite-invoke.ll
scalar-base-vector-2.ll
scalar-base-vector.ll [rs4gc] don't force a conflict for a canonical broadcast 2021-03-16 12:59:06 -07:00
statepoint-attrs.ll
statepoint-calling-conventions.ll
statepoint-coreclr.ll
statepoint-format.ll
strip-invalid-attributes.ll [rs4gc] Strip nofree and nosync attributes when lowering from abstract model 2021-04-02 09:12:24 -07:00
two-invokes-one-landingpad.ll
unordered-atomic-memcpy-no-deopt.ll
unordered-atomic-memcpy.ll
unreachable-regression.ll
vector-bitcast.ll