[PATCH] D69120: [TargetLowering][DAGCombine][MSP430] Shift Amount Threshold in DAGCombine (2/2)

Joan LLuch via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 30 03:08:42 PDT 2019


joanlluch added a comment.

@asl  I identified you as the creator of the MSP430 patch that optimised 8 bit and larger shifts by combining them with bswap and extend instructions. This creates relatively cheap instruction sequences for exactly 8 bit shifts.

I am considering replacing my current implementation of getShiftAmountThreshold, by a version that passes the intended shift amount as a parameter and returns a boolean. For example, let's say that we have

  bool shouldAvoidTransformToShift(EVT VT, unsigned amount) const override; 

Which would return false by default.

For the MSP430 it could be implemented like this

  bool MSP430TargetLowering::shouldAvoidTransformToShift(EVT VT, unsigned amount) const {
    return !(amount == 8 || amount<=2);
  }

Would this make sense for the MSP430?

Thanks.


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

https://reviews.llvm.org/D69120





More information about the llvm-commits mailing list