[PATCH] D128911: Emit table lookup from TargetLowering::expandCTTZ()

Sergei Barannikov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 3 22:46:35 PDT 2022


barannikov88 added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:7987
+      CA, getPointerTy(TD),
+      TD.getPrefTypeAlign(VT.getTypeForEVT(*DAG.getContext())));
+  Align Alignment = cast<ConstantPoolSDNode>(CPIdx)->getAlign();
----------------
craig.topper wrote:
> The Type for the alignment needs to be the type of the elements in `CA` which is based on what data type is used for the `Table` SmallVector.

Why the type of the elements specifically and not of the CA itself?
AFAIK the alignment passed to the load is the "base alignment"; the alignment of the accessed element will be inferred based on the base alignment and the offset of the element.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D128911/new/

https://reviews.llvm.org/D128911



More information about the llvm-commits mailing list