[AVR] Fix codegen for rotate instructions
commitda0fe5db999baa659c2e386e5b0636dadfbbf759
authorJim Lin <tclin914@gmail.com>
Mon, 23 Dec 2019 03:24:20 +0000 (23 11:24 +0800)
committerJim Lin <tclin914@gmail.com>
Mon, 23 Dec 2019 03:41:28 +0000 (23 11:41 +0800)
treea12cb3b4d66ae4dcd8a10af7380967f52b75bf15
parent9681dc9627b1ea50fd90cdea84290ddc021d3fca
[AVR] Fix codegen for rotate instructions

Summary:
    This patch introduces the ROLBRd and RORBRd pseudo-instructions,
    which implemenent the "traditional" rotate operations; instead of
    the AVR rotate instructions that use the carry bit.

    The code is not optimized at all. Especially when dealing with
    loops of rotate instructions, this codegen should be improved some
    day.

Related bug: 41358 <https://bugs.llvm.org/show_bug.cgi?id=41358>

//Note//: This is my first submitted patch.

Reviewers: dylanmckay, Jim

Reviewed By: dylanmckay

Subscribers: hiraditya, llvm-commits, dylanmckay, dsprenkels

Tags: #llvm

Patched by dsprenkels (Daan Sprenkels)

Differential Revision: https://reviews.llvm.org/D60365
llvm/lib/Target/AVR/AVRExpandPseudoInsts.cpp
llvm/lib/Target/AVR/AVRISelLowering.cpp
llvm/lib/Target/AVR/AVRInstrInfo.td
llvm/test/CodeGen/AVR/rot.ll