You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After the introduction of "[InstCombine][DebugInfo] Fold constants wrapped in metadata", some debug invariance started appearing.
Please note that that commit was reverted in 9829445 due to this issue.
C reproducer:
int a, b, c;
static int arr[4];
void foo() {
const int *e[] = {&arr[2]};
const int **f = &e[0];
c = f != foo;
}
int main() {
for (b = 0; b < 4; b++)
a = a ^ arr[b];
return 0;
}
The issue seems to be that the dbg.value intrinsic:
call void @llvm.dbg.value(metadata i64 ptrtoint (i32* getelementptr inbounds ([4 x i32], [4 x i32]* @arr, i64 0, i64 2) to i64), metadata !24, metadata !DIExpression()), !dbg !32
seems to lead to GlobalStatus::analyzeGlobal() returning true that @arr has its address taken. This seems to have to do with the analysis bailing out due to the ptrtoint use of the GEP:
// If the result of the constantexpr isn't pointer type, then we won't
// know to expect it in various places. Just reject early.
if (!isa<PointerType>(CE->getType()))
return true;
The text was updated successfully, but these errors were encountered:
Extended Description
After the introduction of "[InstCombine][DebugInfo] Fold constants wrapped in metadata", some debug invariance started appearing.
Please note that that commit was reverted in 9829445 due to this issue.
C reproducer:
Commands:
That commit appears to have exposed a pre-existing debug invariance issue in GlobalOpt.
This can also be reproduced by just running GlobalOpt on the attached IR reproducer.
The issue seems to be that the dbg.value intrinsic:
call void @llvm.dbg.value(metadata i64 ptrtoint (i32* getelementptr inbounds ([4 x i32], [4 x i32]* @arr, i64 0, i64 2) to i64), metadata !24, metadata !DIExpression()), !dbg !32
seems to lead to GlobalStatus::analyzeGlobal() returning true that @arr has its address taken. This seems to have to do with the analysis bailing out due to the ptrtoint use of the GEP:
The text was updated successfully, but these errors were encountered: