[llvm] d605af3 - AMDGPU: Don't need pointer bitcasts in AMDGPURewriteOutArguments
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Sat Apr 29 08:01:45 PDT 2023
Author: Matt Arsenault
Date: 2023-04-29T10:35:06-04:00
New Revision: d605af371e2ab69be032f7f4ee854baded688b5a
URL: https://github.com/llvm/llvm-project/commit/d605af371e2ab69be032f7f4ee854baded688b5a
DIFF: https://github.com/llvm/llvm-project/commit/d605af371e2ab69be032f7f4ee854baded688b5a.diff
LOG: AMDGPU: Don't need pointer bitcasts in AMDGPURewriteOutArguments
Added:
Modified:
llvm/lib/Target/AMDGPU/AMDGPURewriteOutArguments.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/AMDGPU/AMDGPURewriteOutArguments.cpp b/llvm/lib/Target/AMDGPU/AMDGPURewriteOutArguments.cpp
index 3ff3546f4f92..9205770c8ead 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPURewriteOutArguments.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPURewriteOutArguments.cpp
@@ -377,19 +377,12 @@ bool AMDGPURewriteOutArguments::runOnFunction(Function &F) {
if (!OutArgIndexes.count(Arg.getArgNo()))
continue;
- PointerType *ArgType = cast<PointerType>(Arg.getType());
-
Type *EltTy = OutArgIndexes[Arg.getArgNo()];
const auto Align =
DL->getValueOrABITypeAlignment(Arg.getParamAlign(), EltTy);
Value *Val = B.CreateExtractValue(StubCall, RetIdx++);
- Type *PtrTy = Val->getType()->getPointerTo(ArgType->getAddressSpace());
-
- // We can peek through bitcasts, so the type may not match.
- Value *PtrVal = B.CreateBitCast(&Arg, PtrTy);
-
- B.CreateAlignedStore(Val, PtrVal, Align);
+ B.CreateAlignedStore(Val, &Arg, Align);
}
if (!RetTy->isVoidTy()) {
More information about the llvm-commits
mailing list