aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2020-04-06 11:49:17 -0400
committerAlexey Bataev <a.bataev@hotmail.com>2020-04-06 12:07:43 -0400
commit1c924486564461810903603542ffc2d7db204dde (patch)
tree0a5a90dd938e00c97ef7ff52b4d8ac0e1a9c005b /clang/lib/CodeGen/CGOpenMPRuntime.cpp
parent[lldb] NFC: Fix trivial typo in comments, documents, and messages (diff)
downloadllvm-project-1c924486564461810903603542ffc2d7db204dde.tar.gz
llvm-project-1c924486564461810903603542ffc2d7db204dde.tar.bz2
llvm-project-1c924486564461810903603542ffc2d7db204dde.zip
[OPENMP]Fix PR45439: `omp for collapse(2) ordered(2)` generates invalid
IR. Fixed a crash because of the not quite correct casting of the value of iterations.
Diffstat (limited to 'clang/lib/CodeGen/CGOpenMPRuntime.cpp')
-rw-r--r--clang/lib/CodeGen/CGOpenMPRuntime.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CGOpenMPRuntime.cpp b/clang/lib/CodeGen/CGOpenMPRuntime.cpp
index 6642851a56bc..737349ea5453 100644
--- a/clang/lib/CodeGen/CGOpenMPRuntime.cpp
+++ b/clang/lib/CodeGen/CGOpenMPRuntime.cpp
@@ -11206,10 +11206,9 @@ void CGOpenMPRuntime::emitDoacrossInit(CodeGenFunction &CGF,
// dims.upper = num_iterations;
LValue UpperLVal = CGF.EmitLValueForField(
DimsLVal, *std::next(RD->field_begin(), UpperFD));
- llvm::Value *NumIterVal =
- CGF.EmitScalarConversion(CGF.EmitScalarExpr(NumIterations[I]),
- D.getNumIterations()->getType(), Int64Ty,
- D.getNumIterations()->getExprLoc());
+ llvm::Value *NumIterVal = CGF.EmitScalarConversion(
+ CGF.EmitScalarExpr(NumIterations[I]), NumIterations[I]->getType(),
+ Int64Ty, NumIterations[I]->getExprLoc());
CGF.EmitStoreOfScalar(NumIterVal, UpperLVal);
// dims.stride = 1;
LValue StrideLVal = CGF.EmitLValueForField(