[PATCH] D122521: Value-number GVNHoist loads by result type as well as pointer address.
Chang Lin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 28 11:11:29 PDT 2022
clin1 added inline comments.
================
Comment at: llvm/lib/Transforms/Scalar/GVNHoist.cpp:192
+ Type *LT = Load->getType();
+ // "0" size for pointers is OK, as pointer loads are equivalent.
+ unsigned TypeHash = LT->getTypeID() + (LT->getPrimitiveSizeInBits() << 8);
----------------
jcranmer-intel wrote:
> I'm not sure this is true for pointers in different address spaces.
You're right about that... if we key off the whole type as suggested above, it will fix this problem too.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D122521/new/
https://reviews.llvm.org/D122521
More information about the llvm-commits
mailing list