Skip to content
Unverified Commit 2ad1f5eb authored by Roman Lebedev's avatar Roman Lebedev
Browse files

[InstCombine] Don't canonicalize (gep i8* X, -(ptrtoint Y)) as (inttoptr...

[InstCombine] Don't canonicalize  (gep i8* X, -(ptrtoint Y))  as  (inttoptr (sub (ptrtoint X), (ptrtoint Y)))

It's just a wrong thing to do.

We introduce inttoptr where there were none, which results in
loosing all provenance information because we no longer have a GEP{i,},
and pessimize all future optimizations,
because we are basically not allowed to look past `inttoptr`.

(gep i8* X, -(ptrtoint Y))  *is* the canonical form.
So just drop this fold.

Noticed while reviewing D98120.
parent 75c7e3e3
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment