Skip to content

Commit 734289b

Browse files
committed
fixup! fixup! [AMDGPU] Use wider loop lowering type for LowerMemIntrinsics
Remove StoreSize==AllocSize assertions and add a test where they would be violated.
1 parent eae6914 commit 734289b

File tree

3 files changed

+764
-13
lines changed

3 files changed

+764
-13
lines changed

llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ static cl::opt<size_t> InlineMaxBB(
7979
static cl::opt<unsigned> MemcpyLoopUnroll(
8080
"amdgpu-memcpy-loop-unroll",
8181
cl::desc("Unroll factor (affecting 4x32-bit operations) to use for memory "
82-
"operations when lowering memcpy as a loop, must be a power of 2"),
82+
"operations when lowering memcpy as a loop"),
8383
cl::init(16), cl::Hidden);
8484

8585
static bool dependsOnLocalPhi(const Loop *L, const Value *Cond,

llvm/lib/Transforms/Utils/LowerMemIntrinsics.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,6 @@ void llvm::createMemCpyLoopKnownSize(
4848
Ctx, CopyLen, SrcAS, DstAS, SrcAlign, DstAlign, AtomicElementSize);
4949
assert((!AtomicElementSize || !LoopOpType->isVectorTy()) &&
5050
"Atomic memcpy lowering is not supported for vector operand type");
51-
assert((DL.getTypeStoreSize(LoopOpType) == DL.getTypeAllocSize(LoopOpType)) &&
52-
"Bytes are missed if store and alloc size of the LoopOpType do not "
53-
"match");
5451

5552
Type *Int8Type = Type::getInt8Ty(Ctx);
5653
unsigned LoopOpSize = DL.getTypeStoreSize(LoopOpType);
@@ -203,9 +200,6 @@ void llvm::createMemCpyLoopUnknownSize(
203200
Ctx, CopyLen, SrcAS, DstAS, SrcAlign, DstAlign, AtomicElementSize);
204201
assert((!AtomicElementSize || !LoopOpType->isVectorTy()) &&
205202
"Atomic memcpy lowering is not supported for vector operand type");
206-
assert((DL.getTypeStoreSize(LoopOpType) == DL.getTypeAllocSize(LoopOpType)) &&
207-
"Bytes are missed if store and alloc size of the LoopOpType do not "
208-
"match");
209203
unsigned LoopOpSize = DL.getTypeStoreSize(LoopOpType);
210204
assert((!AtomicElementSize || LoopOpSize % *AtomicElementSize == 0) &&
211205
"Atomic memcpy lowering is not supported for selected operand size");
@@ -420,9 +414,6 @@ static void createMemMoveLoopUnknownSize(Instruction *InsertBefore,
420414

421415
Type *LoopOpType = TTI.getMemcpyLoopLoweringType(Ctx, CopyLen, SrcAS, DstAS,
422416
SrcAlign, DstAlign);
423-
assert((DL.getTypeStoreSize(LoopOpType) == DL.getTypeAllocSize(LoopOpType)) &&
424-
"Bytes are missed if store and alloc size of the LoopOpType do not "
425-
"match");
426417
unsigned LoopOpSize = DL.getTypeStoreSize(LoopOpType);
427418
Type *Int8Type = Type::getInt8Ty(Ctx);
428419
bool LoopOpIsInt8 = LoopOpType == Int8Type;
@@ -681,9 +672,6 @@ static void createMemMoveLoopKnownSize(Instruction *InsertBefore,
681672

682673
Type *LoopOpType = TTI.getMemcpyLoopLoweringType(Ctx, CopyLen, SrcAS, DstAS,
683674
SrcAlign, DstAlign);
684-
assert((DL.getTypeStoreSize(LoopOpType) == DL.getTypeAllocSize(LoopOpType)) &&
685-
"Bytes are missed if store and alloc size of the LoopOpType do not "
686-
"match");
687675
unsigned LoopOpSize = DL.getTypeStoreSize(LoopOpType);
688676
Type *Int8Type = Type::getInt8Ty(Ctx);
689677

0 commit comments

Comments
 (0)