[PATCH] D47735: [DAGCombiner] Create rotates more aggressively
Sanjay Patel via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 16 10:17:59 PDT 2018
spatel added a comment.
In https://reviews.llvm.org/D47735#1163728, @kparzysz wrote:
> At the moment https://reviews.llvm.org/D49242 expands these intrinsics into individual DAG operations. If the intrinsics were transformed into ROTL, and if instcombine could reassociate "or" operations to expose more fshl opportunities, then I guess it would be sufficient.
>
> A benefit of having it in the DAG combiner is that it could handle IR generators that have not generated funnel shifts.
The next steps as I see it after https://reviews.llvm.org/D49242:
1. Convert the intrinsics directly to ROTL/ROTR nodes (this should be a ~2 line patch in SelectionDAGBuilder).
2. Expose the intrinsic as clang or other front-end builtins (the first of these will be __builtin_rotate* rather than the more general __builtin_funnel_shift).
3. Add simplifications/folds/analysis for the intrinsics to IR passes.
4. Canonicalize to the intrinsics in instcombine.
So if these rotate ops can be created/matched sooner (and likely more easily) in IR, then I think it's a better investment to get those intrinsics into the IR rather than trying to put the patterns back together again here in the DAG.
Repository:
rL LLVM
https://reviews.llvm.org/D47735
More information about the llvm-commits
mailing list