1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i686-- -x86-asm-syntax=intel | FileCheck %s
4 ;; X's live range extends beyond the shift, so the register allocator
5 ;; cannot coalesce it with Y. Because of this, a copy needs to be
6 ;; emitted before the shift to save the register value before it is
7 ;; clobbered. However, this copy is not needed if the register
8 ;; allocator turns the shift into an LEA. This also occurs for ADD.
10 ; Check that the shift gets turned into an LEA.
12 @G = external dso_local global i32 ; <ptr> [#uses=1]
14 define i32 @test1(i32 %X) {
17 ; CHECK-NEXT: mov eax, dword ptr [esp + 4]
18 ; CHECK-NEXT: lea ecx, [4*eax]
19 ; CHECK-NEXT: mov dword ptr [G], ecx
21 %Z = shl i32 %X, 2 ; <i32> [#uses=1]
22 store volatile i32 %Z, ptr @G