mirror of
https://github.com/llvm/llvm-project.git
synced 2025-05-08 13:36:07 +00:00
the GEP faq says that only inbounds geps are guaranteed to not overflow.
llvm-svn: 123218
This commit is contained in:
parent
a00bccc0c5
commit
23109cb319
@ -2722,11 +2722,12 @@ const SCEV *ScalarEvolution::createNodeForPHI(PHINode *PN) {
|
||||
HasNUW = true;
|
||||
if (OBO->hasNoSignedWrap())
|
||||
HasNSW = true;
|
||||
} else if (isa<GEPOperator>(BEValueV)) {
|
||||
} else if (const GEPOperator *GEP =
|
||||
dyn_cast<GEPOperator>(BEValueV)) {
|
||||
// If the increment is a GEP, then we know it won't perform an
|
||||
// unsigned overflow, because the address space cannot be
|
||||
// wrapped around.
|
||||
HasNUW = true;
|
||||
HasNUW |= GEP->isInBounds();
|
||||
}
|
||||
|
||||
const SCEV *StartVal = getSCEV(StartValueV);
|
||||
|
Loading…
x
Reference in New Issue
Block a user