diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2010-08-04 22:40:58 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2010-08-04 22:40:58 +0000 |
commit | 7752442bfa1213b302d421988813e3b1cec6b796 (patch) | |
tree | 1fd2be61074b03cd69cdf3225826c7207dd11f57 /lib/Target | |
parent | 59135f49e1699daec9a43fc2d15715d55b910f54 (diff) | |
download | external_llvm-7752442bfa1213b302d421988813e3b1cec6b796.zip external_llvm-7752442bfa1213b302d421988813e3b1cec6b796.tar.gz external_llvm-7752442bfa1213b302d421988813e3b1cec6b796.tar.bz2 |
PR7814: Truncates cannot be ignored for signed comparisons.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110268 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target')
-rw-r--r-- | lib/Target/X86/X86ISelDAGToDAG.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Target/X86/X86ISelDAGToDAG.cpp b/lib/Target/X86/X86ISelDAGToDAG.cpp index 72f2bc1..4301d76 100644 --- a/lib/Target/X86/X86ISelDAGToDAG.cpp +++ b/lib/Target/X86/X86ISelDAGToDAG.cpp @@ -1841,7 +1841,8 @@ SDNode *X86DAGToDAGISel::Select(SDNode *Node) { // Look for (X86cmp (and $op, $imm), 0) and see if we can convert it to // use a smaller encoding. - if (N0.getOpcode() == ISD::TRUNCATE && N0.hasOneUse()) + if (N0.getOpcode() == ISD::TRUNCATE && N0.hasOneUse() && + HasNoSignedComparisonUses(Node)) // Look past the truncate if CMP is the only use of it. N0 = N0.getOperand(0); if (N0.getNode()->getOpcode() == ISD::AND && N0.getNode()->hasOneUse() && |