Fix PR35542: Correct adjusting of private reduction variable
The adjustment is calculated with CreatePtrDiff() which returns the difference in (base) elements. This is passed to CreateGEP() so make sure that the GEP base has the correct pointer type: It needs to be a pointer to the base type, not a pointer to a constant sized array. Differential Revision: https://reviews.llvm.org/D40911 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@319931 91177308-0d34-0410-b5e6-96231b3b80d8
Showing
- lib/CodeGen/CGOpenMPRuntime.cpp 6 additions, 3 deletionslib/CodeGen/CGOpenMPRuntime.cpp
- test/OpenMP/for_reduction_codegen.cpp 17 additions, 13 deletionstest/OpenMP/for_reduction_codegen.cpp
- test/OpenMP/for_reduction_codegen_UDR.cpp 8 additions, 5 deletionstest/OpenMP/for_reduction_codegen_UDR.cpp
Loading
Please register or sign in to comment