18 lines · plain
1; All of these ands and shifts should be folded into rlwimi's2; RUN: llc -verify-machineinstrs < %s -mtriple=ppc32-- -o %t3; RUN: not grep mulhwu %t4; RUN: not grep srawi %t 5; RUN: not grep add %t 6; RUN: grep mulhw %t | count 17 8define i32 @mulhs(i32 %a, i32 %b) nounwind {9entry:10 %tmp.1 = sext i32 %a to i64 ; <i64> [#uses=1]11 %tmp.3 = sext i32 %b to i64 ; <i64> [#uses=1]12 %tmp.4 = mul i64 %tmp.3, %tmp.1 ; <i64> [#uses=1]13 %tmp.6 = lshr i64 %tmp.4, 32 ; <i64> [#uses=1]14 %tmp.7 = trunc i64 %tmp.6 to i32 ; <i32> [#uses=1]15 ret i32 %tmp.716}17 18