diff options
author | Craig Topper <craig.topper@sifive.com> | 2021-07-01 17:08:23 -0700 |
---|---|---|
committer | Craig Topper <craig.topper@sifive.com> | 2021-07-01 19:08:47 -0700 |
commit | 066524ea5438c5c30ac91a7702091be6dc5fd2d0 (patch) | |
tree | 1194ecd53ebb50b75a842d309eb1ffbb8dd9769c /llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | |
parent | 9ab5f761176c376c0a117c53f0f111fed1bcc842 (diff) | |
download | llvm-066524ea5438c5c30ac91a7702091be6dc5fd2d0.zip llvm-066524ea5438c5c30ac91a7702091be6dc5fd2d0.tar.gz llvm-066524ea5438c5c30ac91a7702091be6dc5fd2d0.tar.bz2 |
[ScalarizeMaskedMemIntrin][SelectionDAGBuilder] Use the element type to calculate alignment for gather/scatter when alignment operand is 0.
Previously we used the vector type, but we're loading/storing
invididual elements so I think only element alignment should matter.
Noticed while looking at the code for something else so I don't
have a test case.
Differential Revision: https://reviews.llvm.org/D105220
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp index 0774c7f..7f012dd 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp @@ -4409,7 +4409,7 @@ void SelectionDAGBuilder::visitMaskedScatter(const CallInst &I) { EVT VT = Src0.getValueType(); Align Alignment = cast<ConstantInt>(I.getArgOperand(2)) ->getMaybeAlignValue() - .getValueOr(DAG.getEVTAlign(VT)); + .getValueOr(DAG.getEVTAlign(VT.getScalarType())); const TargetLowering &TLI = DAG.getTargetLoweringInfo(); AAMDNodes AAInfo; @@ -4527,7 +4527,7 @@ void SelectionDAGBuilder::visitMaskedGather(const CallInst &I) { EVT VT = TLI.getValueType(DAG.getDataLayout(), I.getType()); Align Alignment = cast<ConstantInt>(I.getArgOperand(1)) ->getMaybeAlignValue() - .getValueOr(DAG.getEVTAlign(VT)); + .getValueOr(DAG.getEVTAlign(VT.getScalarType())); AAMDNodes AAInfo; I.getAAMetadata(AAInfo); |