[SelectionDAG] Compute known bits of CopyFromReg
authorPiotr Sobczak <piotr.sobczak@amd.com>
Fri, 5 Apr 2019 07:44:09 +0000 (07:44 +0000)
committerPiotr Sobczak <piotr.sobczak@amd.com>
Fri, 5 Apr 2019 07:44:09 +0000 (07:44 +0000)
commit0376ac1d946466eb346c2055554153e11b0fc3cf
treea9e134c70ee7634941c786dd42ef32e5d0fb12c6
parent94cd06676349f034f005b3284fc161d96baadbea
[SelectionDAG] Compute known bits of CopyFromReg

Summary:
Teach SelectionDAG how to compute known bits of ISD::CopyFromReg if
the virtual reg used has one def only.

This can be particularly useful when calling isBaseWithConstantOffset()
with the ISD::CopyFromReg argument, as more optimizations may get enabled
in the result.

Also add a missing truncation on X86, found by testing of this patch.

Change-Id: Id1c9fceec862d118c54a5b53adf72ada5d6daefa

Reviewers: bogner, craig.topper, RKSimon

Reviewed By: RKSimon

Subscribers: lebedev.ri, nemanjai, jvesely, nhaehnle, javed.absar, jsji, jdoerfert, llvm-commits

Tags: #llvm

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

llvm-svn: 357745
llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/AMDGPU/llvm.amdgcn.s.buffer.load.ll
llvm/test/CodeGen/ARM/atomic-op.ll
llvm/test/CodeGen/PowerPC/pr35688.ll
llvm/test/CodeGen/SystemZ/subregliveness-04.ll
llvm/test/CodeGen/X86/fold-tied-op.ll
llvm/test/CodeGen/X86/pr28444.ll