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)
commit812fde3603490eb140eb3ef29341dfe0d4e43c66
tree39708b6c117bb08a3a9c9bf4a9f334fd58ce2050
parent6ecbd16f008b7c18d871f5850dae30b0dc4889ed
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

llvm-svn: 277252
llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
llvm/test/CodeGen/AArch64/arm64-shrink-wrapping.ll
llvm/test/CodeGen/ARM/arm-shrink-wrapping.ll
llvm/test/CodeGen/ARM/no_redundant_trunc_for_cmp.ll [new file with mode: 0644]
llvm/test/CodeGen/PowerPC/ppc-shrink-wrapping.ll
llvm/test/CodeGen/Thumb/thumb-shrink-wrapping.ll