[llvm-commits] [llvm] r86469 - /llvm/trunk/lib/Target/MSP430/MSP430InstrInfo.td

Chris Lattner clattner at apple.com
Sun Nov 8 11:02:07 PST 2009


On Nov 8, 2009, at 7:32 AM, Anton Korobeynikov wrote:

> Author: asl
> Date: Sun Nov  8 09:32:28 2009
> New Revision: 86469
>
> URL: http://llvm.org/viewvc/llvm-project?rev=86469&view=rev
> Log:
> Some nice peephole patterns. Based on patch by Brian Lucas!

Does the first one actually ever match?  DAG combine should  
canonicalize it to the second one.  Testcase? :)

-Chris

>
> Modified:
>    llvm/trunk/lib/Target/MSP430/MSP430InstrInfo.td
>
> Modified: llvm/trunk/lib/Target/MSP430/MSP430InstrInfo.td
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MSP430/MSP430InstrInfo.td?rev=86469&r1=86468&r2=86469&view=diff
>
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- llvm/trunk/lib/Target/MSP430/MSP430InstrInfo.td (original)
> +++ llvm/trunk/lib/Target/MSP430/MSP430InstrInfo.td Sun Nov  8  
> 09:32:28 2009
> @@ -690,6 +690,10 @@
>
> } // Defs = [SRW]
>
> +def ZEXT16r : Pseudo<(outs GR16:$dst), (ins GR16:$src),
> +                     "mov.b\t{$src, $dst}",
> +                     [(set GR16:$dst, (zext (trunc GR16:$src)))]>;
> +
> def SWPB16r : Pseudo<(outs GR16:$dst), (ins GR16:$src),
>                      "swpb\t$dst",
>                      [(set GR16:$dst, (bswap GR16:$src))]>;
> @@ -899,3 +903,6 @@
>           (SUB8mr addr:$dst, GR8:$src)>;
> def : Pat<(store (subc (load addr:$dst), (i8 (load addr:$src))),  
> addr:$dst),
>           (SUB8mm addr:$dst, addr:$src)>;
> +
> +// peephole patterns
> +def : Pat<(and GR16:$src, 255), (ZEXT16r GR16:$src)>;
>
>
> _______________________________________________
> 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