[OpenMPIRBuilderTest] Remove getPointerElementType() uses (NFC)
authorNikita Popov <npopov@redhat.com>
Tue, 8 Feb 2022 10:37:42 +0000 (11:37 +0100)
committerNikita Popov <npopov@redhat.com>
Tue, 8 Feb 2022 10:38:17 +0000 (11:38 +0100)
Use the type of the stored value instead.

llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp

index 7c8ea48..f5fd7de 100644 (file)
@@ -590,7 +590,7 @@ TEST_F(OpenMPIRBuilderTest, ParallelSimple) {
 
     // Trivial copy (=firstprivate).
     Builder.restoreIP(AllocaIP);
-    Type *VTy = Inner.getType()->getPointerElementType();
+    Type *VTy = ReplacementValue->getType();
     Value *V = Builder.CreateLoad(VTy, &Inner, Orig.getName() + ".reload");
     ReplacementValue = Builder.CreateAlloca(VTy, 0, Orig.getName() + ".copy");
     Builder.restoreIP(CodeGenIP);
@@ -670,7 +670,7 @@ TEST_F(OpenMPIRBuilderTest, ParallelNested) {
                     Value *&ReplacementValue) -> InsertPointTy {
     // Trivial copy (=firstprivate).
     Builder.restoreIP(AllocaIP);
-    Type *VTy = Inner.getType()->getPointerElementType();
+    Type *VTy = ReplacementValue->getType();
     Value *V = Builder.CreateLoad(VTy, &Inner, Orig.getName() + ".reload");
     ReplacementValue = Builder.CreateAlloca(VTy, 0, Orig.getName() + ".copy");
     Builder.restoreIP(CodeGenIP);
@@ -766,7 +766,7 @@ TEST_F(OpenMPIRBuilderTest, ParallelNested2Inner) {
                     Value *&ReplacementValue) -> InsertPointTy {
     // Trivial copy (=firstprivate).
     Builder.restoreIP(AllocaIP);
-    Type *VTy = Inner.getType()->getPointerElementType();
+    Type *VTy = ReplacementValue->getType();
     Value *V = Builder.CreateLoad(VTy, &Inner, Orig.getName() + ".reload");
     ReplacementValue = Builder.CreateAlloca(VTy, 0, Orig.getName() + ".copy");
     Builder.restoreIP(CodeGenIP);
@@ -907,7 +907,7 @@ TEST_F(OpenMPIRBuilderTest, ParallelIfCond) {
 
     // Trivial copy (=firstprivate).
     Builder.restoreIP(AllocaIP);
-    Type *VTy = Inner.getType()->getPointerElementType();
+    Type *VTy = ReplacementValue->getType();
     Value *V = Builder.CreateLoad(VTy, &Inner, Orig.getName() + ".reload");
     ReplacementValue = Builder.CreateAlloca(VTy, 0, Orig.getName() + ".copy");
     Builder.restoreIP(CodeGenIP);