[PATCH] D128532: [GlobalOpt] Fix memset handling in global ctor evaluation (PR55859)
Arthur Eubanks via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 24 09:43:47 PDT 2022
aeubanks accepted this revision.
aeubanks added inline comments.
This revision is now accepted and ready to land.
================
Comment at: llvm/lib/Transforms/Utils/Evaluator.cpp:453-454
+ DL, Offset, /* AllowNonInbounds */ true));
+ Offset = Offset.sextOrTrunc(
+ DL.getIndexTypeSizeInBits(Ptr->getType()));
+ auto *GV = dyn_cast<GlobalVariable>(Ptr);
----------------
why is this necessary?
================
Comment at: llvm/lib/Transforms/Utils/Evaluator.cpp:465
+ Constant *DestVal = ComputeLoadResult(GV, Val->getType(), Offset);
+ if (DestVal != Val) {
+ LLVM_DEBUG(dbgs() << "Memset is not a no-op at offset "
----------------
are there any tests to test non-zero values?
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D128532/new/
https://reviews.llvm.org/D128532
More information about the llvm-commits
mailing list