[PATCH] D144468: [GlobalOpt] Extend CleanupPointerRootUsers to handle CE users.
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 28 03:04:44 PST 2023
nikic added inline comments.
================
Comment at: llvm/lib/Transforms/IPO/GlobalOpt.cpp:247
+ } else
+ append_range(Worklist, CE->users());
} else if (Constant *C = dyn_cast<Constant>(U)) {
----------------
fhahn wrote:
> nikic wrote:
> > Do we know that the users here are only cast/GEP?
> It could be any constant expression, but would that be a problem? I think the existing code should handle any type of constant expressions already. I added some extra tests with different constant expressions in c34936465c56 and 7f51145b1bc2
To give a silly example `store i32 0, ptr inttoptr (i64 add (i64 ptrtoint ptr @g to i64, i64 100)) to ptr)` could be writing to a different underlying object (without UB if certain conditions are met).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D144468/new/
https://reviews.llvm.org/D144468
More information about the llvm-commits
mailing list