[PATCH] D37832: Eliminate PHI (int typed) which is only used by inttoptr

Hal Finkel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 14 20:24:36 PDT 2017


hfinkel added a comment.

In the spirit of PR34548, do we need to make sure that the results of the inttoptrs are all dereferenced?

Is the code you're seeing like this coming from SROA?



================
Comment at: lib/Transforms/InstCombine/InstCombinePHI.cpp:42
 
+// Replace Integer typed phi PN if the PHI's value is used as a pointer value.
+// If there is an existing pointer typed phi that produces the same value as PN,
----------------
Please make all phi/PHI in this comment have consistent capitalization.


================
Comment at: lib/Transforms/InstCombine/InstCombinePHI.cpp:72
+//    int_ptr = BitCast(ptr_ptr)
+//    int_init = Load(int_ptr)
+//    br label %bb2
----------------
I don't understand why you're looking for a load here specifically. It's a good example, because it shows that you might need to look for something here other than a ptrtoint, but that seems to motivate taking a general input (not specifically looking for this load as you do below).


https://reviews.llvm.org/D37832





More information about the llvm-commits mailing list