Skip to content

Commit d501a1e

Browse files
committedDec 25, 2018
[PowerPC] Fix the bug of ISD::ADDE to set its second return type to glue
Summary: This patch is to fix the bug imported by rL341634. In above submit , the the return type of ISD::ADDE is 14224: SDVTList VTs = DAG.getVTList(MVT::i64, MVT::i64), but in fact, the second return type of ISD::ADDE should be MVT::Glue not MVT::i64. Reviewed By: hfinkel Differential Revision: https://reviews.llvm.org/D55977 llvm-svn: 350061
1 parent 495b9e0 commit d501a1e

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed
 

‎llvm/lib/Target/PowerPC/PPCISelLowering.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -14389,7 +14389,7 @@ static SDValue combineADDToADDZE(SDNode *N, SelectionDAG &DAG,
1438914389
return SDValue();
1439014390

1439114391
SDLoc DL(N);
14392-
SDVTList VTs = DAG.getVTList(MVT::i64, MVT::i64);
14392+
SDVTList VTs = DAG.getVTList(MVT::i64, MVT::Glue);
1439314393
SDValue Cmp = RHS.getOperand(0);
1439414394
SDValue Z = Cmp.getOperand(0);
1439514395
auto *Constant = dyn_cast<ConstantSDNode>(Cmp.getOperand(1));
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
; REQUIRES: asserts
2+
; RUN: llc -mtriple=powerpc64le-unknown-unknown -debug-only=legalize-types \
3+
; RUN: < %s -o /dev/null 2>&1 | FileCheck %s
4+
5+
define i64 @testAddeReturnType(i64 %X, i64 %Z) {
6+
; CHECK: Legally typed node: {{.*}}: i64,glue = adde {{.*}}
7+
%cmp = icmp ne i64 %Z, 0
8+
%conv1 = zext i1 %cmp to i64
9+
%add = add nsw i64 %conv1, %X
10+
ret i64 %add
11+
}

0 commit comments

Comments
 (0)
Please sign in to comment.