[llvm] [DAG] Teach SelectionDAGBuilder to read parameter alignment of compressstore/expandload. (PR #83763)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 3 23:20:08 PST 2024


================
@@ -4746,6 +4748,8 @@ void SelectionDAGBuilder::visitMaskedLoad(const CallInst &I, bool IsExpanding) {
     // @llvm.masked.expandload.*(Ptr, Mask, Src0)
     Ptr = I.getArgOperand(0);
     Alignment = std::nullopt;
+    if (MaybeAlign Align = I.getParamAlign(0))
+      Alignment = Align;
----------------
topperc wrote:

To clarify the reason I think the vector type isn't relevant, is that we are like not accessing a full vector of memory. If this intrinsic is used in a loop, the pointer for the next iteration will likely have advanced less than a full vector making it not aligned.

https://github.com/llvm/llvm-project/pull/83763


More information about the llvm-commits mailing list