[InstCombine] Be consistent w/handling of masked intrinsics style wise [NFC]
authorPhilip Reames <listmail@philipreames.com>
Thu, 25 Apr 2019 01:18:56 +0000 (01:18 +0000)
committerPhilip Reames <listmail@philipreames.com>
Thu, 25 Apr 2019 01:18:56 +0000 (01:18 +0000)
llvm-svn: 359160

llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
llvm/lib/Transforms/InstCombine/InstCombineInternal.h

index b1bb928..fbdc1b7 100644 (file)
@@ -1179,8 +1179,7 @@ static APInt possiblyDemandedEltsInMask(Value *Mask) {
 
 // TODO, Obvious Missing Transforms:
 // * Narrow width by halfs excluding zero/undef lanes
-static Value *simplifyMaskedLoad(const IntrinsicInst &II,
-                                 InstCombiner::BuilderTy &Builder) {
+Value *InstCombiner::simplifyMaskedLoad(IntrinsicInst &II) {
   Value *LoadPtr = II.getArgOperand(0);
   unsigned Alignment = cast<ConstantInt>(II.getArgOperand(1))->getZExtValue();
 
@@ -1241,7 +1240,7 @@ Instruction *InstCombiner::simplifyMaskedStore(IntrinsicInst &II) {
 // * Narrow width by halfs excluding zero/undef lanes
 // * Vector splat address w/known mask -> scalar load
 // * Vector incrementing address -> vector masked load
-static Instruction *simplifyMaskedGather(IntrinsicInst &II, InstCombiner &IC) {
+Instruction *InstCombiner::simplifyMaskedGather(IntrinsicInst &II) {
   return nullptr;
 }
 
@@ -2018,13 +2017,13 @@ Instruction *InstCombiner::visitCallInst(CallInst &CI) {
     break;
   }
   case Intrinsic::masked_load:
-    if (Value *SimplifiedMaskedOp = simplifyMaskedLoad(*II, Builder))
+    if (Value *SimplifiedMaskedOp = simplifyMaskedLoad(*II))
       return replaceInstUsesWith(CI, SimplifiedMaskedOp);
     break;
   case Intrinsic::masked_store:
     return simplifyMaskedStore(*II);
   case Intrinsic::masked_gather:
-    return simplifyMaskedGather(*II, *this);
+    return simplifyMaskedGather(*II);
   case Intrinsic::masked_scatter:
     return simplifyMaskedScatter(*II);
   case Intrinsic::launder_invariant_group:
index 0488f7b..27b8ea8 100644 (file)
@@ -478,7 +478,9 @@ private:
   Instruction *transformCallThroughTrampoline(CallBase &Call,
                                               IntrinsicInst &Tramp);
 
+  Value *simplifyMaskedLoad(IntrinsicInst &II);
   Instruction *simplifyMaskedStore(IntrinsicInst &II);
+  Instruction *simplifyMaskedGather(IntrinsicInst &II);
   Instruction *simplifyMaskedScatter(IntrinsicInst &II);
   
   /// Transform (zext icmp) to bitwise / integer operations in order to