[llvm] [CodeGen] Generate mem intrinsic address calculations with nuw (PR #80184)

via llvm-commits llvm-commits at lists.llvm.org
Sat Feb 3 06:47:40 PST 2024


SingleAccretion wrote:

> can we just unconditionally assume that the pointers are dereferenceable and always use nuw?

A bit more evidence in favor of this - aggregate stores already use the optimal form ([godbolt link](https://godbolt.org/#g:!((g:!((g:!((h:codeEditor,i:(filename:'1',fontScale:14,fontUsePx:'0',j:1,lang:llvm,selection:(endColumn:2,endLineNumber:4,positionColumn:2,positionLineNumber:4,selectionStartColumn:2,selectionStartLineNumber:4,startColumn:2,startLineNumber:4),source:'define+void+ at suboptimal_memset(ptr)+%7B%0A++++store+%5B2+x+i64%5D+%5Bi64+42,+i64+74%5D,+ptr+%250%0A++++ret+void%0A%7D%0A'),l:'5',n:'0',o:'LLVM+IR+source+%231',t:'0')),k:47.608626786201654,l:'4',n:'0',o:'',s:0,t:'0'),(g:!((h:compiler,i:(compiler:irclangtrunk,filters:(b:'0',binary:'1',binaryObject:'1',commentOnly:'0',debugCalls:'1',demangle:'0',directives:'0',execute:'1',intel:'0',libraryCode:'1',trim:'1'),flagsViewOpen:'1',fontScale:14,fontUsePx:'0',j:2,lang:llvm,libs:!(),options:'-target+wasm32+-O2',overrides:!(),selection:(endColumn:27,endLineNumber:6,positionColumn:27,positionLineNumber:6,selectionStartColumn:27,selectionStartLineNumber:6,startColumn:27,startLineNumber:6),source:1),l:'5',n:'0',o:'+clang+(trunk)+(Editor+%231)',t:'0')),k:52.39137321379835,l:'4',m:100,n:'0',o:'',s:0,t:'0')),l:'2',n:'0',o:'',t:'0')),version:4)).

https://github.com/llvm/llvm-project/pull/80184


More information about the llvm-commits mailing list