[llvm] r350061 - [PowerPC] Fix the bug of ISD::ADDE to set its second return type to glue
Kang Zhang via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 24 19:29:51 PST 2018
Author: zhangkang
Date: Mon Dec 24 19:29:51 2018
New Revision: 350061
URL: http://llvm.org/viewvc/llvm-project?rev=350061&view=rev
Log:
[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
Added:
llvm/trunk/test/CodeGen/PowerPC/adde_return_type.ll
Modified:
llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp
Modified: llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp?rev=350061&r1=350060&r2=350061&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp Mon Dec 24 19:29:51 2018
@@ -14389,7 +14389,7 @@ static SDValue combineADDToADDZE(SDNode
return SDValue();
SDLoc DL(N);
- SDVTList VTs = DAG.getVTList(MVT::i64, MVT::i64);
+ SDVTList VTs = DAG.getVTList(MVT::i64, MVT::Glue);
SDValue Cmp = RHS.getOperand(0);
SDValue Z = Cmp.getOperand(0);
auto *Constant = dyn_cast<ConstantSDNode>(Cmp.getOperand(1));
Added: llvm/trunk/test/CodeGen/PowerPC/adde_return_type.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/adde_return_type.ll?rev=350061&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/PowerPC/adde_return_type.ll (added)
+++ llvm/trunk/test/CodeGen/PowerPC/adde_return_type.ll Mon Dec 24 19:29:51 2018
@@ -0,0 +1,11 @@
+; REQUIRES: asserts
+; RUN: llc -mtriple=powerpc64le-unknown-unknown -debug-only=legalize-types \
+; RUN: < %s -o /dev/null 2>&1 | FileCheck %s
+
+define i64 @testAddeReturnType(i64 %X, i64 %Z) {
+; CHECK: Legally typed node: {{.*}}: i64,glue = adde {{.*}}
+ %cmp = icmp ne i64 %Z, 0
+ %conv1 = zext i1 %cmp to i64
+ %add = add nsw i64 %conv1, %X
+ ret i64 %add
+}
More information about the llvm-commits
mailing list