Use sext in fast isel.
authorRafael Espindola <rafael.espindola@gmail.com>
Mon, 6 Apr 2015 22:29:07 +0000 (22:29 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Mon, 6 Apr 2015 22:29:07 +0000 (22:29 +0000)
commit7bdc1cb69019584854c3292263b6c6ddabda1bb2
treeebaa261dc8cff8b7d021def731973d7615137420
parenta10307bf9543b8ff09a1469ca36bf500a465a73b
Use sext in fast isel.

Fast isel used to zero extends immediates to 64 bits. This normally goes
unnoticed because the value is truncated to 32 bits for output.

Two cases were it is noticed:

* We fail to use smaller encodings.
* If the original constant was smaller than i32.

In the tests using i1 constants, codegen would change to use -1, which is fine
(and matches what regular isel does) since only the lowest bit is then used.

Instead, this patch then changes the ir to use i8 constants, which looks more
like what clang produces.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234249 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/FastISel.cpp
test/CodeGen/Mips/Fast-ISel/logopm.ll
test/CodeGen/X86/fast-isel-i1.ll
test/CodeGen/X86/fast-isel-sext.ll [new file with mode: 0644]