summaryrefslogtreecommitdiff
path: root/lib/Target/SystemZ/SystemZISelDAGToDAG.cpp
diff options
context:
space:
mode:
authorRichard Sandiford <rsandifo@linux.vnet.ibm.com>2014-01-09 11:28:53 +0000
committerRichard Sandiford <rsandifo@linux.vnet.ibm.com>2014-01-09 11:28:53 +0000
commitdb5c1f3d7616cb469374903acdac032469749699 (patch)
tree8f2e5e703cc0db551bdbf83c0d8423f790bbd78b /lib/Target/SystemZ/SystemZISelDAGToDAG.cpp
parentacb31a245ceef3510f37163e31c0097b0d63cb8f (diff)
downloadllvm-db5c1f3d7616cb469374903acdac032469749699.tar.gz
llvm-db5c1f3d7616cb469374903acdac032469749699.tar.bz2
llvm-db5c1f3d7616cb469374903acdac032469749699.tar.xz
[SystemZ] Fix RNSBG bug introduced by r197802
The zext handling added in r197802 wasn't right for RNSBG. This patch restricts it to ROSBG, RXSBG and RISBG. (The tests for RISBG were added in r197802 since RISBG was the motivating example.) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198862 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/SystemZ/SystemZISelDAGToDAG.cpp')
-rw-r--r--lib/Target/SystemZ/SystemZISelDAGToDAG.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/lib/Target/SystemZ/SystemZISelDAGToDAG.cpp b/lib/Target/SystemZ/SystemZISelDAGToDAG.cpp
index d95361eed1..aa4752c2ba 100644
--- a/lib/Target/SystemZ/SystemZISelDAGToDAG.cpp
+++ b/lib/Target/SystemZ/SystemZISelDAGToDAG.cpp
@@ -769,15 +769,17 @@ bool SystemZDAGToDAGISel::expandRxSBG(RxSBGOperands &RxSBG) const {
RxSBG.Input = N.getOperand(0);
return true;
- case ISD::ZERO_EXTEND: {
- // Restrict the mask to the extended operand.
- unsigned InnerBitSize = N.getOperand(0).getValueType().getSizeInBits();
- if (!refineRxSBGMask(RxSBG, allOnes(InnerBitSize)))
- return false;
+ case ISD::ZERO_EXTEND:
+ if (RxSBG.Opcode != SystemZ::RNSBG) {
+ // Restrict the mask to the extended operand.
+ unsigned InnerBitSize = N.getOperand(0).getValueType().getSizeInBits();
+ if (!refineRxSBGMask(RxSBG, allOnes(InnerBitSize)))
+ return false;
- RxSBG.Input = N.getOperand(0);
- return true;
- }
+ RxSBG.Input = N.getOperand(0);
+ return true;
+ }
+ // Fall through.
case ISD::SIGN_EXTEND: {
// Check that the extension bits are don't-care (i.e. are masked out