]> granicus.if.org Git - llvm/commitdiff
[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)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359160 91177308-0d34-0410-b5e6-96231b3b80d8

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

index b1bb9281ea2c4ccb001adb0d2f27553e8582bbe2..fbdc1b778219d19cfc8c7757042fc1ea1b9571b8 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 0488f7bd07adb4563554281c13b7732bf94db759..27b8ea81ec0962dafa2aa99afffdd3b617bc3266 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