OSDN Git Service

DAG: avoid duplicated truncating for sign extended operand
authorWeiming Zhao <weimingz@codeaurora.org>
Fri, 29 Jul 2016 23:33:48 +0000 (23:33 +0000)
committerWeiming Zhao <weimingz@codeaurora.org>
Fri, 29 Jul 2016 23:33:48 +0000 (23:33 +0000)
commit7420263227e11b14d4f58f1ccb75240d29adc9b2
treee568107306633ffee2d48a293761836114ecb281
parent17beea7ca2d5cfc64a96f4d915aaa1b23dac788b
DAG: avoid duplicated truncating for sign extended operand

Summary:
When performing cmp for EQ/NE and the operand is sign extended, we can
avoid the truncaton if the bits to be tested are no less than origianl
bits.

Reviewers: eli.friedman

Subscribers: eli.friedman, aemerson, nemanjai, t.p.northover, llvm-commits

Differential Revision: https://reviews.llvm.org/D22933

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277252 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
test/CodeGen/AArch64/arm64-shrink-wrapping.ll
test/CodeGen/ARM/arm-shrink-wrapping.ll
test/CodeGen/ARM/no_redundant_trunc_for_cmp.ll [new file with mode: 0644]
test/CodeGen/PowerPC/ppc-shrink-wrapping.ll
test/CodeGen/Thumb/thumb-shrink-wrapping.ll