[PATCH] D60318: [ExpandMemCmp] Improve generated code for simple non-equality compares.

Clement Courbet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 10 01:43:37 PDT 2019


courbet added a comment.

> Alternatively, what do you think about making ExpandMemCmp a late IR optimization pass like the vectorizer passes?

The would be ideal, but unfortunately `ExpandMemCmp` requires access to the `TargetLowering` (for `TargetLowering::MaxLoadsPerMemcmp` which is consistent with what happens for memcpy and memset) . On the other hand, we already have some `MemCmpExpansionOptions` in `TargetTransformInfo`, which also knows about memcpy (e.g. `getMemcpyLoopLoweringType()`, `getMemcpyLoopResidualLoweringType` and `getMemcpyCost`), so we could move it here and move `ExpandMemCmp` to a late IR opt pass. I'll create a patch with this approach.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D60318





More information about the llvm-commits mailing list