teak-llvm/llvm/test/CodeGen/X86/overlap-shift.ll
Dávid Bolvanský 584ed88226 [Codegen][X86] Modernize/regenerate old tests. NFCI.
Summary:
Switch to FileCheck where possible.
Adjust tests so they can be easily regenerated by update scripts.

Reviewers: craig.topper, spatel, RKSimon

Reviewed By: spatel

Subscribers: MatzeB, qcolombet, arphaman, jfb, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D71211
2019-12-10 00:27:46 +01:00

26 lines
930 B
LLVM

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