llvm.org GIT mirror llvm / 38c3b33
[ARM] GlobalISel: Widen s1, s8, s16 G_CONSTANT Get the legalizer to widen small constants. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307239 91177308-0d34-0410-b5e6-96231b3b80d8 Diana Picus 3 years ago
2 changed file(s) with 17 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
8888 setAction({G_SELECT, 1, s1}, Legal);
8989
9090 setAction({G_CONSTANT, s32}, Legal);
91 for (auto Ty : {s1, s8, s16})
92 setAction({G_CONSTANT, Ty}, WidenScalar);
9193
9294 setAction({G_ICMP, s1}, Legal);
9395 for (auto Ty : {s8, s16})
688688 tracksRegLiveness: true
689689 registers:
690690 - { id: 0, class: _ }
691 - { id: 1, class: _ }
692 - { id: 2, class: _ }
693 - { id: 3, class: _ }
691694 body: |
692695 bb.0:
693696 %0(s32) = G_CONSTANT 42
694697 ; CHECK: {{%[0-9]+}}(s32) = G_CONSTANT 42
698
699 %1(s16) = G_CONSTANT i16 21
700 ; CHECK: [[EXT:%[0-9]+]](s32) = G_CONSTANT i32 21
701 ; CHECK: {{%[0-9]+}}(s16) = G_TRUNC [[EXT]](s32)
702
703 %2(s8) = G_CONSTANT i8 10
704 ; CHECK: [[EXT:%[0-9]+]](s32) = G_CONSTANT i32 10
705 ; CHECK: {{%[0-9]+}}(s8) = G_TRUNC [[EXT]](s32)
706
707 %3(s1) = G_CONSTANT i1 1
708 ; CHECK: [[EXT:%[0-9]+]](s32) = G_CONSTANT i32 -1
709 ; CHECK: {{%[0-9]+}}(s1) = G_TRUNC [[EXT]](s32)
695710
696711 %r0 = COPY %0(s32)
697712 BX_RET 14, _, implicit %r0