[llvm] 61eaa2e - [SDAG] Remember to set UndefElts in isSplatValue for SPLAT_VECTOR

Krzysztof Parzyszek via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 10 17:51:40 PDT 2020


Author: Krzysztof Parzyszek
Date: 2020-10-10T19:42:24-05:00
New Revision: 61eaa2e14aed2f357eaa72ef7bd3a8876bbce598

URL: https://github.com/llvm/llvm-project/commit/61eaa2e14aed2f357eaa72ef7bd3a8876bbce598
DIFF: https://github.com/llvm/llvm-project/commit/61eaa2e14aed2f357eaa72ef7bd3a8876bbce598.diff

LOG: [SDAG] Remember to set UndefElts in isSplatValue for SPLAT_VECTOR

Added: 
    

Modified: 
    llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index b51e5b9981d1..5fe26a6d2abd 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -2310,6 +2310,9 @@ bool SelectionDAG::isSplatValue(SDValue V, const APInt &DemandedElts,
   // vector types.
   switch (V.getOpcode()) {
   case ISD::SPLAT_VECTOR:
+    UndefElts = V.getOperand(0).isUndef()
+                    ? APInt::getAllOnesValue(DemandedElts.getBitWidth())
+                    : APInt(DemandedElts.getBitWidth(), 0);
     return true;
   case ISD::ADD:
   case ISD::SUB:


        


More information about the llvm-commits mailing list