aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
diff options
context:
space:
mode:
authorTim Northover <tnorthover@apple.com>2019-05-29 20:46:38 +0000
committerTim Northover <tnorthover@apple.com>2019-05-29 20:46:38 +0000
commit71ee3d02372af7361eda0b59163cf92653ac2bbb (patch)
tree6e62b423c129caa0b420c5e10382284d65898514 /llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
parent4b281755ae4951ca83c287680b47d77433f3ee0a (diff)
downloadllvm-71ee3d02372af7361eda0b59163cf92653ac2bbb.zip
llvm-71ee3d02372af7361eda0b59163cf92653ac2bbb.tar.gz
llvm-71ee3d02372af7361eda0b59163cf92653ac2bbb.tar.bz2
Revert "IR: add optional type to 'byval' function parameters"
The IRLinker doesn't delve into the new byval attribute when mapping types, and this breaks LTO. llvm-svn: 362029
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp18
1 files changed, 5 insertions, 13 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
index da06ac7..fe857f7 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -9076,11 +9076,8 @@ TargetLowering::LowerCallTo(TargetLowering::CallLoweringInfo &CLI) const {
if (Args[i].IsByVal || Args[i].IsInAlloca) {
PointerType *Ty = cast<PointerType>(Args[i].Ty);
Type *ElementTy = Ty->getElementType();
-
- unsigned FrameSize = DL.getTypeAllocSize(
- Args[i].ByValType ? Args[i].ByValType : ElementTy);
- Flags.setByValSize(FrameSize);
-
+ Flags.setByValSize(DL.getTypeAllocSize(ElementTy));
+ // For ByVal, alignment should come from FE. BE will guess if this
// info is not there but there are cases it cannot get right.
unsigned FrameAlign;
if (Args[i].Alignment)
@@ -9577,14 +9574,9 @@ void SelectionDAGISel::LowerArguments(const Function &F) {
if (Flags.isByVal() || Flags.isInAlloca()) {
PointerType *Ty = cast<PointerType>(Arg.getType());
Type *ElementTy = Ty->getElementType();
-
- // For ByVal, size and alignment should be passed from FE. BE will
- // guess if this info is not there but there are cases it cannot get
- // right.
- unsigned FrameSize = DL.getTypeAllocSize(
- Arg.getParamByValType() ? Arg.getParamByValType() : ElementTy);
- Flags.setByValSize(FrameSize);
-
+ Flags.setByValSize(DL.getTypeAllocSize(ElementTy));
+ // For ByVal, alignment should be passed from FE. BE will guess if
+ // this info is not there but there are cases it cannot get right.
unsigned FrameAlign;
if (Arg.getParamAlignment())
FrameAlign = Arg.getParamAlignment();