-
Notifications
You must be signed in to change notification settings - Fork 15.4k
[PreISelIntrinsicLowering] Zext/trunc count parameter as necessary for memset_pattern16 emission #129239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PreISelIntrinsicLowering] Zext/trunc count parameter as necessary for memset_pattern16 emission #129239
Changes from 1 commit
d6f19cd
a2fdab8
d528757
9fa61c8
1de9cef
7f92827
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -394,11 +394,12 @@ bool PreISelIntrinsicLowering::expandMemIntrinsicUses(Function &F) const { | |
| Module *M = Memset->getModule(); | ||
| const DataLayout &DL = Memset->getDataLayout(); | ||
|
|
||
| Type *DestPtrTy = Memset->getRawDest()->getType(); | ||
| Type *IntIdxTy = DL.getIndexType(DestPtrTy); | ||
| StringRef FuncName = "memset_pattern16"; | ||
| FunctionCallee MSP = getOrInsertLibFunc( | ||
| M, TLI, LibFunc_memset_pattern16, Builder.getVoidTy(), | ||
| Memset->getRawDest()->getType(), Builder.getPtrTy(), | ||
| Memset->getLength()->getType()); | ||
| FunctionCallee MSP = getOrInsertLibFunc(M, TLI, LibFunc_memset_pattern16, | ||
| Builder.getVoidTy(), DestPtrTy, | ||
| Builder.getPtrTy(), IntIdxTy); | ||
| inferNonMandatoryLibFuncAttrs(M, FuncName, TLI); | ||
|
|
||
| // Otherwise we should form a memset_pattern16. PatternValue is known | ||
|
|
@@ -415,9 +416,10 @@ bool PreISelIntrinsicLowering::expandMemIntrinsicUses(Function &F) const { | |
| GV->setAlignment(Align(16)); | ||
| Value *PatternPtr = GV; | ||
| Value *NumBytes = Builder.CreateMul( | ||
| Builder.getInt64(DL.getTypeSizeInBits(Memset->getValue()->getType()) / | ||
| 8), | ||
| Memset->getLength()); | ||
| ConstantInt::get(IntIdxTy, | ||
| DL.getTypeSizeInBits(Memset->getValue()->getType()) / | ||
|
||
| 8), | ||
| Builder.CreateZExtOrTrunc(Memset->getLength(), IntIdxTy)); | ||
| CallInst *MemsetPattern16Call = | ||
| Builder.CreateCall(MSP, {Memset->getRawDest(), PatternPtr, NumBytes}); | ||
| MemsetPattern16Call->setAAMetadata(Memset->getAAMetadata()); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.