[InstCombine] Fold ptrtoint(gep i8 null, x) -> x
authorAlex Richardson <Alexander.Richardson@cl.cam.ac.uk>
Tue, 28 Sep 2021 15:06:35 +0000 (16:06 +0100)
committerAlex Richardson <Alexander.Richardson@cl.cam.ac.uk>
Tue, 28 Sep 2021 16:57:37 +0000 (17:57 +0100)
commitebb3dc08339cd9d5c4204f0a60742514909d5acd
treecf82e68ee3f66b65fd2dc125e593d0f9356f446a
parent9049a1c61e9a0cfa5ba41940f2d14597b9e0c431
[InstCombine] Fold ptrtoint(gep i8 null, x) -> x

This commit is the InstCombine follow-up to the previous constant-folding
change that enables noticeable optimizations for CHERI-enabled targets.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D110247
llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
llvm/test/Transforms/InstCombine/ptrtoint-nullgep.ll