diff options
| author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2017-02-02 01:20:34 +0000 |
|---|---|---|
| committer | Matt Arsenault <Matthew.Arsenault@amd.com> | 2017-02-02 01:20:34 +0000 |
| commit | 8e190b2f235d0943362e847fea983991c839171c (patch) | |
| tree | 0c1f04da5ea65308c619ac48893c62ec869baeac /llvm/lib/Target | |
| parent | f5d560bc84ca0203ad5a1d8f4586fcaf5e18fc6c (diff) | |
| download | bcm5719-llvm-8e190b2f235d0943362e847fea983991c839171c.tar.gz bcm5719-llvm-8e190b2f235d0943362e847fea983991c839171c.zip | |
NVPTX: Fix not preserving volatile when expanding memset
llvm-svn: 293851
Diffstat (limited to 'llvm/lib/Target')
| -rw-r--r-- | llvm/lib/Target/NVPTX/NVPTXLowerAggrCopies.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/Target/NVPTX/NVPTXLowerAggrCopies.cpp b/llvm/lib/Target/NVPTX/NVPTXLowerAggrCopies.cpp index b925b632ee4..cbb60a004e1 100644 --- a/llvm/lib/Target/NVPTX/NVPTXLowerAggrCopies.cpp +++ b/llvm/lib/Target/NVPTX/NVPTXLowerAggrCopies.cpp @@ -204,8 +204,8 @@ void convertMemMoveToLoop(Instruction *ConvertedInst, Value *SrcAddr, // Lower memset to loop. void convertMemSetToLoop(Instruction *ConvertedInst, Value *DstAddr, - Value *CopyLen, Value *SetValue, LLVMContext &Context, - Function &F) { + Value *CopyLen, Value *SetValue, + bool IsVolatile, LLVMContext &Context, Function &F) { BasicBlock *OrigBB = ConvertedInst->getParent(); BasicBlock *NewBB = ConvertedInst->getParent()->splitBasicBlock(ConvertedInst, "split"); @@ -226,7 +226,7 @@ void convertMemSetToLoop(Instruction *ConvertedInst, Value *DstAddr, LoopBuilder.CreateStore( SetValue, LoopBuilder.CreateInBoundsGEP(SetValue->getType(), DstAddr, LoopIndex), - false); + IsVolatile); Value *NewIndex = LoopBuilder.CreateAdd(LoopIndex, ConstantInt::get(CopyLen->getType(), 1)); @@ -325,6 +325,7 @@ bool NVPTXLowerAggrCopies::runOnFunction(Function &F) { /* DstAddr */ Memset->getRawDest(), /* CopyLen */ Memset->getLength(), /* SetValue */ Memset->getValue(), + /* IsVolatile */ Memset->isVolatile(), /* Context */ Context, /* Function F */ F); } |

