[llvm] 39819cc - Use concrete natural type alignment for masked load/store operations instead of 0.

Guillaume Chatelet via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 24 14:42:17 PDT 2020


Author: Guillaume Chatelet
Date: 2020-06-24T21:42:05Z
New Revision: 39819ccd36b6dd61c9decd29df64fd4e8a7ee9ad

URL: https://github.com/llvm/llvm-project/commit/39819ccd36b6dd61c9decd29df64fd4e8a7ee9ad
DIFF: https://github.com/llvm/llvm-project/commit/39819ccd36b6dd61c9decd29df64fd4e8a7ee9ad.diff

LOG: Use concrete natural type alignment for masked load/store operations instead of 0.

Added: 
    

Modified: 
    llvm/include/llvm/CodeGen/BasicTTIImpl.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/CodeGen/BasicTTIImpl.h b/llvm/include/llvm/CodeGen/BasicTTIImpl.h
index 4962c0d5f896..5194332bcd3d 100644
--- a/llvm/include/llvm/CodeGen/BasicTTIImpl.h
+++ b/llvm/include/llvm/CodeGen/BasicTTIImpl.h
@@ -1388,11 +1388,12 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
     case Intrinsic::sideeffect:
       return 0;
     case Intrinsic::masked_store:
-      return ConcreteTTI->getMaskedMemoryOpCost(Instruction::Store, Tys[0], 0,
+      return ConcreteTTI->getMaskedMemoryOpCost(Instruction::Store, Tys[0],
+                                                DL.getABITypeAlignment(Tys[0]),
                                                 0, CostKind);
     case Intrinsic::masked_load:
-      return ConcreteTTI->getMaskedMemoryOpCost(Instruction::Load, RetTy, 0, 0,
-                                                CostKind);
+      return ConcreteTTI->getMaskedMemoryOpCost(
+          Instruction::Load, RetTy, DL.getABITypeAlignment(RetTy), 0, CostKind);
     case Intrinsic::experimental_vector_reduce_add:
       return ConcreteTTI->getArithmeticReductionCost(Instruction::Add, VecOpTy,
                                                      /*IsPairwiseForm=*/false,


        


More information about the llvm-commits mailing list