[PATCH] D34905: Modify constraints in `llvm::canReplaceOperandWithVariable`

Leo Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 5 14:13:27 PDT 2017


aoli updated this revision to Diff 105337.
aoli added a comment.

Add `Instruction::Alloca` back.


https://reviews.llvm.org/D34905

Files:
  lib/Transforms/Utils/Local.cpp


Index: lib/Transforms/Utils/Local.cpp
===================================================================
--- lib/Transforms/Utils/Local.cpp
+++ lib/Transforms/Utils/Local.cpp
@@ -2182,10 +2182,13 @@
   case Instruction::ShuffleVector:
     // Shufflevector masks are constant.
     return OpIdx != 2;
+  case Instruction::Switch:
   case Instruction::ExtractValue:
-  case Instruction::InsertValue:
     // All operands apart from the first are constant.
     return OpIdx == 0;
+  case Instruction::InsertValue:
+    // All operands apart from the first and the second are constant.
+    return OpIdx < 2;
   case Instruction::Alloca:
     return false;
   case Instruction::GetElementPtr:


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34905.105337.patch
Type: text/x-patch
Size: 692 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170705/1a8cf591/attachment.bin>


More information about the llvm-commits mailing list