Martinez, Javier E
2010-Aug-25 00:58 UTC
[LLVMdev] [Patch] Fix for ExpandShiftWithUnknownAmountBit when shift amount is zero
Hello, A while back I submitted a patch for this function. The patch, added in revision 90482, left the case of a shift by zero undefined. Attached is another patch to deal with that condition. Thanks, Javier -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100824/a66bd3d8/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: LegalizeIntegerTypes.cpp.patch Type: application/octet-stream Size: 3491 bytes Desc: LegalizeIntegerTypes.cpp.patch URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100824/a66bd3d8/attachment.obj>
Chris Lattner
2010-Oct-04 16:34 UTC
[LLVMdev] [Patch] Fix for ExpandShiftWithUnknownAmountBit when shift amount is zero
On Aug 24, 2010, at 5:58 PM, Martinez, Javier E wrote:> Hello, > > A while back I submitted a patch for this function. The patch, added in revision 90482, left the case of a shift by zero undefined. Attached is another patch to deal with that condition. >Hi Javier, This patch seems ok, but it will pessimize all of the existing targets, which produce an undefined result on overflow instead of performing an undefined operation. Does your target really produce undefined behavior on this condition, or does it just produce an undefined result? If you really need to get this in, please add a new TargetLowering hook (along the same lines of getShiftAmountTy() which would return an enum indicating the behavior on overflow. The legalize code can then use this hook to determine if it needs to generate the extra code. Thanks! -Chris -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20101004/7df18508/attachment.html>
Reasonably Related Threads
- [LLVMdev] Possible bug in ExpandShiftWithUnknownAmountBit
- [LLVMdev] Possible bug in ExpandShiftWithUnknownAmountBit
- [LLVMdev] Possible bug in ExpandShiftWithUnknownAmountBit
- [LLVMdev] Possible bug in ExpandShiftWithUnknownAmountBit
- [LLVMdev] Possible bug in ExpandShiftWithUnknownAmountBit