[RS4GC] Refactor code for Rematerializing in presence of phi. NFC
authorAnna Thomas <anna@azul.com>
Tue, 20 Sep 2016 21:36:02 +0000 (21:36 +0000)
committerAnna Thomas <anna@azul.com>
Tue, 20 Sep 2016 21:36:02 +0000 (21:36 +0000)
commit8cd7de1d1890d9ade06418694ebf2de9dda20d9d
treef67d7a1156cf22b8644db21492398ddc419a688b
parentb44b6d98b3a16942e2761c2f30a5099751ee805e
[RS4GC] Refactor code for Rematerializing in presence of phi. NFC

Summary:
This is an NFC refactoring change as a precursor to the actual fix for rematerializing in
presence of phi.
https://reviews.llvm.org/D24399

Pasted from review:
findRematerializableChainToBasePointer changed to return the root of the
chain. instead of true or false.
move the PHI matching logic into the caller by inspecting the root return value.
This includes an assertion that the alternate root is in the liveset for the
call.

Tested with current RS4GC tests.

Reviewers: reames, sanjoy

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D24780

llvm-svn: 282023
llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp