llvm-6502/test/CodeGen/X86/avoid-lea-scale2.ll
2011-03-16 13:53:07 +00:00

11 lines
256 B
LLVM

; RUN: llc < %s -mtriple=x86_64-linux | FileCheck %s
; RUN: llc < %s -mtriple=x86_64-win32 | FileCheck %s
; CHECK: leal -2({{%rdi,%rdi|%rcx,%rcx}})
define i32 @foo(i32 %x) nounwind readnone {
%t0 = shl i32 %x, 1
%t1 = add i32 %t0, -2
ret i32 %t1
}