summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2018-02-13 14:55:07 +0000
committerSanjay Patel <spatel@rotateright.com>2018-02-13 14:55:07 +0000
commit907b58530f19d1c5d1e02b0d67e9255f0e70c869 (patch)
treef51c676cac18bfccaabd562c4c075be17bc49081 /llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
parent35d744d388aa6ab325036f3dfd258b4c39ade1bc (diff)
downloadbcm5719-llvm-907b58530f19d1c5d1e02b0d67e9255f0e70c869.tar.gz
bcm5719-llvm-907b58530f19d1c5d1e02b0d67e9255f0e70c869.zip
[DAG] fix type of undef returned by getNode()
The bug has been lying dormant, but apparently was never exposed, until after rL324941 because we didn't return the correct result for shifts with undef operands. llvm-svn: 325010
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 2ece6a82f6c..0dabfdf374e 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -4667,7 +4667,7 @@ SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
case ISD::FSUB:
case ISD::FDIV:
case ISD::FREM:
- return N1; // fold op(undef, arg2) -> undef
+ return getUNDEF(VT); // fold op(undef, arg2) -> undef
case ISD::UDIV:
case ISD::SDIV:
case ISD::UREM:
@@ -4700,7 +4700,7 @@ SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
case ISD::SRA:
case ISD::SRL:
case ISD::SHL:
- return N2; // fold op(arg1, undef) -> undef
+ return getUNDEF(VT); // fold op(arg1, undef) -> undef
case ISD::FADD:
case ISD::FSUB:
case ISD::FMUL:
OpenPOWER on IntegriCloud