Page MenuHomePhabricator

[InstCombineCalls] Use isKnownNonNullAt() to check nullness of gc.relocate return value
ClosedPublic

Authored by chenli on Sep 10 2015, 1:48 PM.

Details

Summary

This patch replaces isKnownNonNull() with isKnownNonNullAt() when checking nullness of gc.relocate return value. In this way it can handle cases where the relocated value does not have nonnull attribute but has a dominating null check from the CFG.

Diff Detail

Repository
rL LLVM

Event Timeline

chenli updated this revision to Diff 34485.Sep 10 2015, 1:48 PM
chenli retitled this revision from to [InstCombineCalls] Use isKnownNonNullAt() to check nullness of gc.relocate return value .
chenli updated this object.
chenli added a reviewer: reames.
chenli added a subscriber: llvm-commits.
reames accepted this revision.Sep 10 2015, 2:42 PM
reames edited edge metadata.

LGTM w/minor comment addressed.

test/Transforms/InstCombine/gc.relocate.ll
26 ↗(On Diff #34485)

I'd replace this vague check line with a bit of IR that will constant fold if the pointer is known non null. e.g. return (relocate == null);
; CHECK: ret i1 false

This revision is now accepted and ready to land.Sep 10 2015, 2:42 PM
chenli closed this revision.Sep 10 2015, 3:36 PM
This revision was automatically updated to reflect the committed changes.