[PATCH] D12437: ComputeSignBits: look through SELECT_CC, not just SELECT

escha via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 28 10:04:09 PDT 2015


escha created this revision.
escha added a subscriber: llvm-commits.
escha set the repository for this revision to rL LLVM.

Should be pretty trivial, just a copy-paste of the SELECT case.

Repository:
  rL LLVM

http://reviews.llvm.org/D12437

Files:
  lib/CodeGen/SelectionDAG/SelectionDAG.cpp

Index: lib/CodeGen/SelectionDAG/SelectionDAG.cpp
===================================================================
--- lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -2563,6 +2563,11 @@
     if (Tmp == 1) return 1;  // Early out.
     Tmp2 = ComputeNumSignBits(Op.getOperand(2), Depth+1);
     return std::min(Tmp, Tmp2);
+  case ISD::SELECT_CC:
+    Tmp = ComputeNumSignBits(Op.getOperand(2), Depth+1);
+    if (Tmp == 1) return 1;  // Early out.
+    Tmp2 = ComputeNumSignBits(Op.getOperand(3), Depth+1);
+    return std::min(Tmp, Tmp2);
   case ISD::SMIN:
   case ISD::SMAX:
   case ISD::UMIN:


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D12437.33438.patch
Type: text/x-patch
Size: 643 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150828/b222c8ac/attachment.bin>


More information about the llvm-commits mailing list