[llvm] r183314 - ARMInstrInfo: Improve isSwiftFastImmShift

Matt Beaumont-Gay matthewbg at google.com
Wed Jun 5 13:07:55 PDT 2013


Test case?

On Wed, Jun 5, 2013 at 7:59 AM, Arnold Schwaighofer
<aschwaighofer at apple.com> wrote:
> Author: arnolds
> Date: Wed Jun  5 09:59:36 2013
> New Revision: 183314
>
> URL: http://llvm.org/viewvc/llvm-project?rev=183314&view=rev
> Log:
> ARMInstrInfo: Improve isSwiftFastImmShift
>
> An instruction with less than 3 inputs is trivially a fast immediate shift.
>
> Reapply of 183256, should not have caused the tablegen segfault on linux either.
>
> Modified:
>     llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp
>
> Modified: llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp?rev=183314&r1=183313&r2=183314&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp (original)
> +++ llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp Wed Jun  5 09:59:36 2013
> @@ -4152,6 +4152,8 @@ bool ARMBaseInstrInfo::hasNOP() const {
>  }
>
>  bool ARMBaseInstrInfo::isSwiftFastImmShift(const MachineInstr *MI) const {
> +  if (MI->getNumOperands() < 4)
> +    return true;
>    unsigned ShOpVal = MI->getOperand(3).getImm();
>    unsigned ShImm = ARM_AM::getSORegOffset(ShOpVal);
>    // Swift supports faster shifts for: lsl 2, lsl 1, and lsr 1.
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits



More information about the llvm-commits mailing list