1; RUN: llc %s -o - -mtriple=armv8-unknown -mattr=-fuse-literals,+use-misched | FileCheck %s --check-prefix=CHECK --check-prefix=CHECKDONT 2; RUN: llc %s -o - -mtriple=armv8-unknown -mattr=+fuse-literals,+use-misched | FileCheck %s --check-prefix=CHECK --check-prefix=CHECKFUSE 3 4@g = common global i32* zeroinitializer 5 6define i32* @litp(i32 %a, i32 %b) { 7entry: 8 %add = add nsw i32 %b, %a 9 %ptr = getelementptr i32, i32* bitcast (i32* (i32, i32)* @litp to i32*), i32 %add 10 %res = getelementptr i32, i32* bitcast (i32** @g to i32*), i32 %add 11 store i32* %ptr, i32** @g, align 4 12 ret i32* %res 13 14; CHECK-LABEL: litp: 15; CHECK: movw [[R:r[0-9]+]], :lower16:litp 16; CHECKDONT-NEXT: movw [[S:r[0-9]+]], :lower16:g 17; CHECKFUSE-NEXT: movt [[R]], :upper16:litp 18; CHECKFUSE-NEXT: movw [[S:r[0-9]+]], :lower16:g 19; CHECKFUSE-NEXT: movt [[S]], :upper16:g 20} 21 22define i32 @liti(i32 %a, i32 %b) { 23entry: 24 %adda = add i32 %a, -262095121 25 %add1 = add i32 %adda, %b 26 %addb = add i32 %b, 121110837 27 %add2 = add i32 %addb, %a 28 store i32 %add1, i32* bitcast (i32** @g to i32*), align 4 29 ret i32 %add2 30 31; CHECK-LABEL: liti: 32; CHECK: movw [[R:r[0-9]+]], #309 33; CHECKDONT-NEXT: add {{r[0-9]+}}, {{r[0-9]+}}, {{r[0-9]+}} 34; CHECKFUSE-NEXT: movt [[R]], #1848 35; CHECKFUSE: movw [[S:r[0-9]+]], :lower16:g 36; CHECKFUSE-NEXT: movt [[S]], :upper16:g 37; CHECKFUSE-NEXT: movw [[T:r[0-9]+]], #48879 38; CHECKFUSE-NEXT: movt [[T]], #61536 39} 40