[PATCH] D105220: [ScalarizeMaskedMemIntrin] Use the element type to calculate alignment for gather/scatter when alignment operand is 0.
Craig Topper via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 1 19:09:47 PDT 2021
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG066524ea5438: [ScalarizeMaskedMemIntrin][SelectionDAGBuilder] Use the element type to… (authored by craig.topper).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D105220/new/
https://reviews.llvm.org/D105220
Files:
llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
llvm/lib/Transforms/Scalar/ScalarizeMaskedMemIntrin.cpp
Index: llvm/lib/Transforms/Scalar/ScalarizeMaskedMemIntrin.cpp
===================================================================
--- llvm/lib/Transforms/Scalar/ScalarizeMaskedMemIntrin.cpp
+++ llvm/lib/Transforms/Scalar/ScalarizeMaskedMemIntrin.cpp
@@ -956,22 +956,22 @@
scalarizeMaskedStore(DL, CI, DTU, ModifiedDT);
return true;
case Intrinsic::masked_gather: {
- unsigned AlignmentInt =
- cast<ConstantInt>(CI->getArgOperand(1))->getZExtValue();
+ MaybeAlign MA =
+ cast<ConstantInt>(CI->getArgOperand(1))->getMaybeAlignValue();
Type *LoadTy = CI->getType();
- Align Alignment =
- DL.getValueOrABITypeAlignment(MaybeAlign(AlignmentInt), LoadTy);
+ Align Alignment = DL.getValueOrABITypeAlignment(MA,
+ LoadTy->getScalarType());
if (TTI.isLegalMaskedGather(LoadTy, Alignment))
return false;
scalarizeMaskedGather(DL, CI, DTU, ModifiedDT);
return true;
}
case Intrinsic::masked_scatter: {
- unsigned AlignmentInt =
- cast<ConstantInt>(CI->getArgOperand(2))->getZExtValue();
+ MaybeAlign MA =
+ cast<ConstantInt>(CI->getArgOperand(2))->getMaybeAlignValue();
Type *StoreTy = CI->getArgOperand(0)->getType();
- Align Alignment =
- DL.getValueOrABITypeAlignment(MaybeAlign(AlignmentInt), StoreTy);
+ Align Alignment = DL.getValueOrABITypeAlignment(MA,
+ StoreTy->getScalarType());
if (TTI.isLegalMaskedScatter(StoreTy, Alignment))
return false;
scalarizeMaskedScatter(DL, CI, DTU, ModifiedDT);
Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
===================================================================
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -4409,7 +4409,7 @@
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 @@
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);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D105220.356082.patch
Type: text/x-patch
Size: 2691 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210702/c86534c8/attachment.bin>
More information about the llvm-commits
mailing list