| Ehsan Amiri | a538b0f | 2016-08-03 18:17:35 +0000 | [diff] [blame] | 1 | ; RUN: llc -verify-machineinstrs < %s | FileCheck %s | 
| Hal Finkel | b1518d6 | 2015-09-05 00:02:59 +0000 | [diff] [blame] | 2 | target datalayout = "E-m:e-i64:64-n32:64" | 
|  | 3 | target triple = "powerpc64-unknown-linux-gnu" | 
|  | 4 |  | 
|  | 5 | @m = external global i32, align 4 | 
|  | 6 |  | 
|  | 7 | ; Function Attrs: nounwind | 
|  | 8 | define signext i32 @main() #0 { | 
|  | 9 | entry: | 
|  | 10 |  | 
|  | 11 | ; CHECK-LABEL: @main | 
|  | 12 | ; CHECK-NOT: rlwimi | 
|  | 13 | ; CHECK: andi | 
|  | 14 |  | 
|  | 15 | %0 = load i32, i32* @m, align 4 | 
|  | 16 | %or = or i32 %0, 250 | 
|  | 17 | store i32 %or, i32* @m, align 4 | 
|  | 18 | %and = and i32 %or, 249 | 
|  | 19 | %sub.i = sub i32 %and, 0 | 
|  | 20 | %sext = shl i32 %sub.i, 24 | 
|  | 21 | %conv = ashr exact i32 %sext, 24 | 
|  | 22 | ret i32 %conv | 
|  | 23 | } | 
|  | 24 |  | 
|  | 25 | attributes #0 = { nounwind "target-cpu"="pwr7" } | 
|  | 26 | attributes #1 = { nounwind } | 
|  | 27 |  |