Carry facts about nullness and undef across GC relocation
authorPhilip Reames <listmail@philipreames.com>
Mon, 29 Dec 2014 23:27:30 +0000 (23:27 +0000)
committerPhilip Reames <listmail@philipreames.com>
Mon, 29 Dec 2014 23:27:30 +0000 (23:27 +0000)
commit91a083c57f4d1f2e0169b02f6e530e95d61cae3f
treeefa07cc9307ee8fe41e693977220fb991d972d70
parent1714ad67bd7706e3590ed85edab399800d742fa5
Carry facts about nullness and undef across GC relocation

This change implements four basic optimizations:

    If a relocated value isn't used, it doesn't need to be relocated.
    If the value being relocated is null, relocation doesn't change that. (Technically, this might be collector specific. I don't know of one which it doesn't work for though.)
    If the value being relocated is undef, the relocation is meaningless.
    If the value being relocated was known nonnull, the relocated pointer also isn't null. (Since it points to the same source language object.)

I outlined other planned work in comments.

Differential Revision: http://reviews.llvm.org/D6600

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224968 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/IR/Statepoint.h
lib/Transforms/InstCombine/InstCombineCalls.cpp
test/Transforms/InstCombine/statepoint.ll [new file with mode: 0644]