[PATCH] D47681: [DAGCombiner] Bug 31275- Extract a shift from a constant mul or udiv if a rotate can be formed

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 3 23:35:22 PDT 2018


lebedev.ri added inline comments.


================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:5057
 // a rot[lr].
 SDNode *DAGCombiner::MatchRotate(SDValue LHS, SDValue RHS, const SDLoc &DL) {
   // Must be a legal type.  Expanded 'n promoted things won't work with rotates.
----------------
Is this always considered worth doing,
or the check whether this should be done is on the caller's side?


================
Comment at: test/CodeGen/X86/rotate-extract.ll:2
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: llc < %s -mtriple=x86_64-unknown-unknown | FileCheck %s
+
----------------
You could also copy this into `test/CodeGen/AArch64/rotate-extract.ll`,
since that should also profit from the transform.


https://reviews.llvm.org/D47681





More information about the llvm-commits mailing list