Skip to content

Commit 0797c18

Browse files
committed
[SCCP] Explicitly mark gep as overdefined if ct eval fails
Don't just leave the result as unknown. I think this currently works out thanks to undef resolution, but the correct thing to do is set it to overdefined explicitly.
1 parent f381cd0 commit 0797c18

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

llvm/lib/Transforms/Utils/SCCPSolver.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1655,6 +1655,8 @@ void SCCPInstVisitor::visitGetElementPtrInst(GetElementPtrInst &I) {
16551655

16561656
if (Constant *C = ConstantFoldInstOperands(&I, Operands, DL))
16571657
markConstant(&I, C);
1658+
else
1659+
markOverdefined(&I);
16581660
}
16591661

16601662
void SCCPInstVisitor::visitAllocaInst(AllocaInst &I) {

0 commit comments

Comments
 (0)