]> granicus.if.org Git - llvm/commit
[X86] Fast-ISel was incorrectly always killing the source of a truncate.
authorPete Cooper <peter_cooper@apple.com>
Fri, 8 May 2015 18:29:42 +0000 (18:29 +0000)
committerPete Cooper <peter_cooper@apple.com>
Fri, 8 May 2015 18:29:42 +0000 (18:29 +0000)
commitc2347d5cf1860633872e004bf614c75d0f2d29eb
treeca0fd816db544b139328b2aa56567ac429553089
parent5c7f7462e40e98bf6fa02baadec7337586192b7e
[X86] Fast-ISel was incorrectly always killing the source of a truncate.

A trunc from i32 to i1 on x86_64 generates an instruction such as

%vreg19<def> = COPY %vreg9:sub_8bit<kill>; GR8:%vreg19 GR32:%vreg9

However, the copy here should only have the kill flag on the 32-bit path, not the 64-bit one.
Otherwise, we are killing the source of the truncate which could be used later in the program.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236890 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86FastISel.cpp
test/CodeGen/X86/fast-isel-trunc-kill-subreg.ll [new file with mode: 0644]