Closed
Description
For the following a.ll
,
define i8 @test(i8 %0) {
start:
%1 = call i8 @llvm.fshr.i8(i8 %0, i8 %0, i8 4)
ret i8 %1
}
declare i8 @llvm.fshr.i8(i8, i8, i8)
Build it with llc a.ll -march=avr -mcpu=atmega328
, the following assembly is generated,
.type test,@function
test: ; @test
; %bb.0: ; %start
bst r24, 0
ror r24
bld r24, 7
bst r24, 0
ror r24
bld r24, 7
bst r24, 0
ror r24
bld r24, 7
bst r24, 0
ror r24
bld r24, 7
ret
which could be optimized to a single swap r24
.