diff options
author | Nikita Popov <npopov@redhat.com> | 2021-12-16 12:59:45 +0100 |
---|---|---|
committer | Nikita Popov <npopov@redhat.com> | 2021-12-16 15:26:21 +0100 |
commit | 58c8c5326329bb55df6b9d4f7f8f43a2c82e67c1 (patch) | |
tree | 044192ac89121fbd9c7636e083c498937d5b9c58 /clang/lib/CodeGen/TargetInfo.cpp | |
parent | 8c7f2a4f871928d8734ee3f03e67d09086850b60 (diff) | |
download | llvm-58c8c5326329bb55df6b9d4f7f8f43a2c82e67c1.zip llvm-58c8c5326329bb55df6b9d4f7f8f43a2c82e67c1.tar.gz llvm-58c8c5326329bb55df6b9d4f7f8f43a2c82e67c1.tar.bz2 |
[CodeGen] Avoid more pointer element type accesses
Diffstat (limited to 'clang/lib/CodeGen/TargetInfo.cpp')
-rw-r--r-- | clang/lib/CodeGen/TargetInfo.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/clang/lib/CodeGen/TargetInfo.cpp b/clang/lib/CodeGen/TargetInfo.cpp index 5a15645..85089cd 100644 --- a/clang/lib/CodeGen/TargetInfo.cpp +++ b/clang/lib/CodeGen/TargetInfo.cpp @@ -431,7 +431,7 @@ static Address emitMergePHI(CodeGenFunction &CGF, PHI->addIncoming(Addr1.getPointer(), Block1); PHI->addIncoming(Addr2.getPointer(), Block2); CharUnits Align = std::min(Addr1.getAlignment(), Addr2.getAlignment()); - return Address(PHI, Align); + return Address(PHI, Addr1.getElementType(), Align); } TargetCodeGenInfo::~TargetCodeGenInfo() = default; @@ -4034,7 +4034,7 @@ static Address EmitX86_64VAArgFromMemory(CodeGenFunction &CGF, CGF.Builder.CreateStore(overflow_arg_area, overflow_arg_area_p); // AMD64-ABI 3.5.7p5: Step 11. Return the fetched type. - return Address(Res, Align); + return Address(Res, LTy, Align); } Address X86_64ABIInfo::EmitVAArg(CodeGenFunction &CGF, Address VAListAddr, @@ -4147,7 +4147,7 @@ Address X86_64ABIInfo::EmitVAArg(CodeGenFunction &CGF, Address VAListAddr, RegAddr = CGF.Builder.CreateElementBitCast(Tmp, LTy); } else if (neededInt) { RegAddr = Address(CGF.Builder.CreateGEP(CGF.Int8Ty, RegSaveArea, gp_offset), - CharUnits::fromQuantity(8)); + CGF.Int8Ty, CharUnits::fromQuantity(8)); RegAddr = CGF.Builder.CreateElementBitCast(RegAddr, LTy); // Copy to a temporary if necessary to ensure the appropriate alignment. @@ -4165,7 +4165,7 @@ Address X86_64ABIInfo::EmitVAArg(CodeGenFunction &CGF, Address VAListAddr, } else if (neededSSE == 1) { RegAddr = Address(CGF.Builder.CreateGEP(CGF.Int8Ty, RegSaveArea, fp_offset), - CharUnits::fromQuantity(16)); + CGF.Int8Ty, CharUnits::fromQuantity(16)); RegAddr = CGF.Builder.CreateElementBitCast(RegAddr, LTy); } else { assert(neededSSE == 2 && "Invalid number of needed registers!"); @@ -4177,7 +4177,7 @@ Address X86_64ABIInfo::EmitVAArg(CodeGenFunction &CGF, Address VAListAddr, // all the SSE registers to the RSA. Address RegAddrLo = Address(CGF.Builder.CreateGEP(CGF.Int8Ty, RegSaveArea, fp_offset), - CharUnits::fromQuantity(16)); + CGF.Int8Ty, CharUnits::fromQuantity(16)); Address RegAddrHi = CGF.Builder.CreateConstInBoundsByteGEP(RegAddrLo, CharUnits::fromQuantity(16)); |