The original transformation is
/ entry:
/ %4 = select i1 %3, %C* %0, %C* null
/ %5 = icmp eq %C* %4, null
/ br i1 %5, label %9, label %7
/ ...
/ ; <label>:7 ; preds = %entry
/ %8 = getelementptr inbounds %C* %4, i64 0, i32 0
/ ...
///
transformed to
/
/ %5 = icmp eq %C* %0, null
/ %6 = select i1 %3, i1 %5, i1 true
/ br i1 %6, label %9, label %7
/ ...
/ ; <label>:7 ; preds = %entry
/ %8 = getelementptr inbounds %C* %0, i64 0, i32 0 replace by %0!
However this transformation is only true when branching to two different blocks. We have to make sure this condition true in the code.