diff options
| author | Petar Avramovic <Petar.Avramovic@rt-rk.com> | 2019-02-20 13:42:44 +0000 | 
|---|---|---|
| committer | Petar Avramovic <Petar.Avramovic@rt-rk.com> | 2019-02-20 13:42:44 +0000 | 
| commit | dee5846b4a9d582949e814e9811da962e23416bb (patch) | |
| tree | 9908766a57ddb2f85453e1d47900722d2cb471dd /llvm/lib/Target/Mips | |
| parent | 97ed3c1e4754ac2da5b582328e0c82aec2850f63 (diff) | |
| download | bcm5719-llvm-dee5846b4a9d582949e814e9811da962e23416bb.tar.gz bcm5719-llvm-dee5846b4a9d582949e814e9811da962e23416bb.zip  | |
[MIPS MSA] Avoid some DAG combines for vector shifts
DAG combiner combines two shifts into shift + and with bitmask.
Avoid such combines for vectors since leaving two vector shifts
as they are produces better end results.
Differential Revision: https://reviews.llvm.org/D58225
llvm-svn: 354461
Diffstat (limited to 'llvm/lib/Target/Mips')
| -rw-r--r-- | llvm/lib/Target/Mips/MipsISelLowering.cpp | 7 | ||||
| -rw-r--r-- | llvm/lib/Target/Mips/MipsISelLowering.h | 2 | 
2 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/Target/Mips/MipsISelLowering.cpp b/llvm/lib/Target/Mips/MipsISelLowering.cpp index 103d1fcb44b..d69effb6224 100644 --- a/llvm/lib/Target/Mips/MipsISelLowering.cpp +++ b/llvm/lib/Target/Mips/MipsISelLowering.cpp @@ -1190,6 +1190,13 @@ bool MipsTargetLowering::isCheapToSpeculateCtlz() const {    return Subtarget.hasMips32();  } +bool MipsTargetLowering::shouldFoldShiftPairToMask(const SDNode *N, +                                                   CombineLevel Level) const { +  if (N->getOperand(0).getValueType().isVector()) +    return false; +  return true; +} +  void  MipsTargetLowering::LowerOperationWrapper(SDNode *N,                                            SmallVectorImpl<SDValue> &Results, diff --git a/llvm/lib/Target/Mips/MipsISelLowering.h b/llvm/lib/Target/Mips/MipsISelLowering.h index e25810c8741..3a9e61b97b4 100644 --- a/llvm/lib/Target/Mips/MipsISelLowering.h +++ b/llvm/lib/Target/Mips/MipsISelLowering.h @@ -284,6 +284,8 @@ class TargetRegisterClass;      bool isCheapToSpeculateCttz() const override;      bool isCheapToSpeculateCtlz() const override; +    bool shouldFoldShiftPairToMask(const SDNode *N, +                                   CombineLevel Level) const override;      /// Return the register type for a given MVT, ensuring vectors are treated      /// as a series of gpr sized integers.  | 

