[llvm] r356536 - [instcombine] Add todos describing missing transforms for masked.* intrinsics

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 19 20:36:05 PDT 2019


Author: reames
Date: Tue Mar 19 20:36:05 2019
New Revision: 356536

URL: http://llvm.org/viewvc/llvm-project?rev=356536&view=rev
Log:
[instcombine] Add todos describing missing transforms for masked.* intrinsics


Modified:
    llvm/trunk/lib/Transforms/InstCombine/InstCombineCalls.cpp

Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineCalls.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineCalls.cpp?rev=356536&r1=356535&r2=356536&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/InstCombine/InstCombineCalls.cpp (original)
+++ llvm/trunk/lib/Transforms/InstCombine/InstCombineCalls.cpp Tue Mar 19 20:36:05 2019
@@ -1175,6 +1175,9 @@ static bool maskIsAllOneOrUndef(Value *M
   return true;
 }
 
+// TODO, Obvious Missing Transforms:
+// * Dereferenceable address -> speculative load/select
+// * Narrow width by halfs excluding zero/undef lanes
 static Value *simplifyMaskedLoad(const IntrinsicInst &II,
                                  InstCombiner::BuilderTy &Builder) {
   // If the mask is all ones or undefs, this is a plain vector load of the 1st
@@ -1189,6 +1192,10 @@ static Value *simplifyMaskedLoad(const I
   return nullptr;
 }
 
+// TODO, Obvious Missing Transforms:
+// * SimplifyDemandedVectorElts
+// * Single constant active lane -> store
+// * Narrow width by halfs excluding zero/undef lanes
 static Instruction *simplifyMaskedStore(IntrinsicInst &II, InstCombiner &IC) {
   auto *ConstMask = dyn_cast<Constant>(II.getArgOperand(3));
   if (!ConstMask)
@@ -1208,6 +1215,11 @@ static Instruction *simplifyMaskedStore(
   return nullptr;
 }
 
+// TODO, Obvious Missing Transforms:
+// * Single constant active lane load -> load
+// * Dereferenceable address & few lanes -> scalarize speculative load/selects
+// * Adjacent vector addresses -> masked.load
+// * Narrow width by halfs excluding zero/undef lanes
 static Instruction *simplifyMaskedGather(IntrinsicInst &II, InstCombiner &IC) {
   // If the mask is all zeros, return the "passthru" argument of the gather.
   auto *ConstMask = dyn_cast<Constant>(II.getArgOperand(2));
@@ -1251,6 +1263,11 @@ static Instruction *simplifyInvariantGro
   return cast<Instruction>(Result);
 }
 
+// TODO, Obvious Missing Transforms:
+// * SimplifyDemandedVectorElts
+// * Single constant active lane -> store
+// * Adjacent vector addresses -> masked.store
+// * Narrow store width by halfs excluding zero/undef lanes
 static Instruction *simplifyMaskedScatter(IntrinsicInst &II, InstCombiner &IC) {
   // If the mask is all zeros, a scatter does nothing.
   auto *ConstMask = dyn_cast<Constant>(II.getArgOperand(3));




More information about the llvm-commits mailing list