Sanjoy Das
2015-Apr-06 18:26 UTC
[LLVMdev] inconsistent wording in the LangRef regarding "shl nsw"
> I wouldn't be surprised if InstSimplify were relying on (1) to implement > some of its optimizations: > http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/InstructionSimplify.cpp?revision=233938&view=markup#l2298Yup! It looks like LLVM really implements (1) and (2) is just a misleading anecdote. So I'll change my vote from "remove (1)" to "remove (2)". :) -- Sanjoy
David Majnemer
2015-Apr-06 22:34 UTC
[LLVMdev] inconsistent wording in the LangRef regarding "shl nsw"
On Mon, Apr 6, 2015 at 11:26 AM, Sanjoy Das <sanjoy at playingwithpointers.com> wrote:> > I wouldn't be surprised if InstSimplify were relying on (1) to implement > > some of its optimizations: > > > http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/InstructionSimplify.cpp?revision=233938&view=markup#l2298 > > Yup! It looks like LLVM really implements (1) and (2) is just a > misleading anecdote. So I'll change my vote from "remove (1)" to > "remove (2)". :) >I wrote those optimizations with an understanding that (1) was the one true way. Would you be apposed to switching to (2)? I have examples where implementing (1) creates real regressions where (2) does not.> > -- Sanjoy >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150406/3f42a5fe/attachment.html>
Sanjoy Das
2015-Apr-06 22:56 UTC
[LLVMdev] inconsistent wording in the LangRef regarding "shl nsw"
> I wrote those optimizations with an understanding that (1) was the one true > way. Would you be apposed to switching to (2)? I have examples where > implementing (1) creates real regressions where (2) does not.I don't have fundamental reasons to favor (1) over (2). I assumed finding and fixing all the places within LLVM that implement and assume (1) will be difficult and bug-prone, and therefore sticking with (1) is the more pragmatic option. I do think (2) is easier to reason in, so if you think switching LLVM to consistently use (2) is doable then I too will prefer (2). In any case we should let this thread linger for a while before changing anything, in case there are others with differing opinions. -- Sanjoy