[PATCH] D108307: [DAG] CombineConsecutiveLoads - replace getABITypeAlign with allowsMemoryAccess (PR45116)

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 23 09:08:55 PDT 2021


RKSimon added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:12573
+      DAG.areNonVolatileConsecutiveLoads(LD2, LD1, LD1Bytes, 1) &&
+      TLI.allowsMemoryAccess(*DAG.getContext(), DAG.getDataLayout(), VT,
+                             *LD1->getMemOperand()))
----------------
RKSimon wrote:
> pengfei wrote:
> > Is the type possible a vector? Is there performance penalty when we turn it into unaligned?
> allowsMemoryAccess does have an optional fast check that we could use, that allows targets to specify if the unaligned load is slower or not - I'll try adding it.
I've added the fast check to ensure we only perform the unaligned load if its not slow - X86TargetLowering::allowsMisalignedMemoryAccesses checks for slow unaligned memory access to avoid perf issues with vectors.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D108307



More information about the llvm-commits mailing list