summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/ScalarEvolution.cpp
diff options
context:
space:
mode:
authorSerguei Katkov <serguei.katkov@azul.com>2017-06-21 06:38:23 +0000
committerSerguei Katkov <serguei.katkov@azul.com>2017-06-21 06:38:23 +0000
commit0b0dc57dd88d99257fcc0d4e206e2fc60dba4bd3 (patch)
tree5a1f69ca5073d52d25ce7d520d587e98d48e2070 /llvm/lib/Analysis/ScalarEvolution.cpp
parent676b457b8b694f5ee277ad2dd0eb1c8a984ca2e8 (diff)
downloadbcm5719-llvm-0b0dc57dd88d99257fcc0d4e206e2fc60dba4bd3.tar.gz
bcm5719-llvm-0b0dc57dd88d99257fcc0d4e206e2fc60dba4bd3.zip
[ImplicitNullChecks] Uphold an invariant in areMemoryOpsAliased
Right now areMemoryOpsAliased has an assertion justified as: MMO1 should have a value due it comes from operation we'd like to use as implicit null check. assert(MMO1->getValue() && "MMO1 should have a Value!"); However, it is possible for that invariant to not be upheld in the following situation (conceptually): Null check %RAX NotNullSucc: %RAX = LEA %RSP, 16 // I0 %RDX = MOV64rm %RAX // I1 With the current code, we will have an early exit from ImplicitNullChecks::isSuitableMemoryOp on I0 with SR_Unsuitable. However, I1 will look plausible (since it loads from %RAX) and will go ahead and call areMemoryOpsAliased(I1, I0). This will cause us to fail the assert mentioned above since I1 does not load from an IR level value and thus is allowed to have a non-Value base address. The fix is to bail out earlier whenever we see an unsuitable instruction overwrite PointerReg. This would guarantee that when we call areMemoryOpsAliased, we're guaranteed to be looking at an instruction that loads from or stores to an IR level value. Original Patch Author: sanjoy Reviewers: sanjoy, mkazantsev, reames Reviewed By: sanjoy Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D34385 llvm-svn: 305879
Diffstat (limited to 'llvm/lib/Analysis/ScalarEvolution.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud