-
Notifications
You must be signed in to change notification settings - Fork 14.4k
[OpenMP] [Debug] Debug support for work sharing iterator variable #122047
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
@llvm/pr-subscribers-backend-amdgpu @llvm/pr-subscribers-clang-codegen Author: Alok Kumar Sharma (alokkrsharma) ChangesThis fixes #110700 Work-sharing loop iterator variable had incorrect debug info attached to it. It was due to redundant/incorrect debug info overwrites the correct debug info appearing later in LLVM IR.define internal void @main.omp_outlined_debug__( ) omp.precond.then: ; preds = %entry omp.inner.for.body: ; preds = %omp.inner.for.cond
|
@llvm/pr-subscribers-clang Author: Alok Kumar Sharma (alokkrsharma) ChangesThis fixes #110700 Work-sharing loop iterator variable had incorrect debug info attached to it. It was due to redundant/incorrect debug info overwrites the correct debug info appearing later in LLVM IR.define internal void @main.omp_outlined_debug__( ) omp.precond.then: ; preds = %entry omp.inner.for.body: ; preds = %omp.inner.for.cond
|
…rong based on DWARF Work-sharing loop iterator variable had incorrect debug info attached to it. It was due to redundant/incorrect debug info overwrites the correct debug info appearing later in LLVM IR. ------------------ define internal void @main.omp_outlined_debug__( ) %i = alloca i32, align 4 ;;------------------ (Incorrect) %i4 = alloca i32, align 4 ;;------------------ (Correct) #dbg_declare(ptr %i, !82, !DIExpression(), !67) ;;--- (Incorrect) store i32 0, ptr %i, align 4, !dbg !83 ;;--- (Incorrect) omp.precond.then: ; preds = %entry #dbg_declare(ptr %i4, !82, !DIExpression(), !67) ;;--- (Correct) omp.inner.for.body: ; preds = %omp.inner.for.cond %18 = load i32, ptr %.omp.iv, align 4, !dbg !85 %mul = mul nsw i32 %18, 1, !dbg !83 %add = add nsw i32 0, %mul, !dbg !83 store i32 %add, ptr %i4, align 4, !dbg !83 ;;--- (Correct) ------------------ Suppressing the incorrect IR, enables emission of correct debug info.
b6ed8b9
to
8bbc982
Compare
The fix doesn't look right to me... |
Maybe it fixes debug info, but definitely breaks some of the OpenMP support |
Thanks for your comment alexey-bataev. Though I intend to delete only unused instructions but it is possible that I have overlooked something. Would you please help me with some example, I will improve the fix with concerns addressed. |
Thanks for your comment shiltian. I would love to address your concern and improve the patch. Please help me with the example. |
This fixes #110700
Work-sharing loop iterator variable had incorrect debug info attached to it.
It was due to redundant/incorrect debug info overwrites the correct debug info appearing later in LLVM IR.
Suppressing the incorrect IR, enables emission of correct debug info.