[PATCH] D73555: [SVE] Fix bug in simplification of scalable vector instructions

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 28 16:16:21 PST 2020


efriedma added inline comments.


================
Comment at: llvm/lib/Analysis/InstructionSimplify.cpp:4079
   else if (VectorType *VT = dyn_cast<VectorType>(Ops[1]->getType()))
-    GEPTy = VectorType::get(GEPTy, VT->getNumElements());
+    GEPTy = VectorType::get(GEPTy, VT->getElementCount());
 
----------------
Missing testcase?


================
Comment at: llvm/lib/Analysis/InstructionSimplify.cpp:4463
+
+  if (!Scalable) {
+    // Canonicalization: If mask does not select elements from an input vector,
----------------
Redundant "if"?


================
Comment at: llvm/lib/Analysis/InstructionSimplify.cpp:4486
+  if (!Scalable && Op0Const && Op1Const)
     return ConstantFoldShuffleVectorInstruction(Op0Const, Op1Const, Mask);
 
----------------
ConstantFoldShuffleVectorInstruction should be fine?  Or is this temporary to work around some other issue?


================
Comment at: llvm/lib/Analysis/InstructionSimplify.cpp:4529
         OpShuf->getMask()->getSplatValue())
       return Op0;
 
----------------
Can you rearrange this code so you can put the early return earlier?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D73555/new/

https://reviews.llvm.org/D73555





More information about the llvm-commits mailing list