[llvm] r331976 - [CFLGraph] Fixed Select instruction handling

David Bolvansky via llvm-commits llvm-commits at lists.llvm.org
Thu May 10 04:47:36 PDT 2018


Author: xbolva00
Date: Thu May 10 04:47:36 2018
New Revision: 331976

URL: http://llvm.org/viewvc/llvm-project?rev=331976&view=rev
Log:
[CFLGraph] Fixed Select instruction handling

Summary:
Operand 0 is the condition, not the true value.

Use op 1 and op 2 as the correct values.

Reviewers: george.burgess.iv, nlopes, efriedma

Reviewed By: george.burgess.iv

Subscribers: craig.topper, rjmccall, lebedev.ri, llvm-commits

Differential Revision: https://reviews.llvm.org/D46343

Modified:
    llvm/trunk/lib/Analysis/CFLGraph.h

Modified: llvm/trunk/lib/Analysis/CFLGraph.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/CFLGraph.h?rev=331976&r1=331975&r2=331976&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/CFLGraph.h (original)
+++ llvm/trunk/lib/Analysis/CFLGraph.h Thu May 10 04:47:36 2018
@@ -541,6 +541,12 @@ template <typename CFLAA> class CFLGraph
         break;
       }
 
+      case Instruction::Select: {
+        addAssignEdge(CE->getOperand(1), CE);
+        addAssignEdge(CE->getOperand(2), CE);
+        break;
+      }
+
       case Instruction::InsertElement:
       case Instruction::InsertValue: {
         addAssignEdge(CE->getOperand(0), CE);
@@ -573,7 +579,6 @@ template <typename CFLAA> class CFLGraph
       case Instruction::AShr:
       case Instruction::ICmp:
       case Instruction::FCmp:
-      case Instruction::Select:
       case Instruction::ShuffleVector: {
         addAssignEdge(CE->getOperand(0), CE);
         addAssignEdge(CE->getOperand(1), CE);




More information about the llvm-commits mailing list