[llvm-commits] [llvm] r172535 - /llvm/trunk/include/llvm/IR/Instructions.h

Nadav Rotem nrotem at apple.com
Tue Jan 15 12:42:58 PST 2013


Just for context, the change in the ICMP code was to support vectors of pointers. I think that we should use 'getScalarType()' before checking 'isPointerTy()'

Thanks,
Nadav

On Jan 15, 2013, at 10:44 AM, Evgeniy Stepanov <eugeni.stepanov at gmail.com> wrote:

> No and no. One function of asserts is documenting the code, and this one was misleading and wrong.
> 
> Or did i misunderstood something? This difference between constructors was added in Nadav's change about a year ago, I assumed it's a mistake.
> 
> On Jan 15, 2013 9:47 PM, "David Blaikie" <dblaikie at gmail.com> wrote:
> On Tue, Jan 15, 2013 at 7:30 AM, Evgeniy Stepanov
> <eugeni.stepanov at gmail.com> wrote:
> > Author: eugenis
> > Date: Tue Jan 15 09:30:33 2013
> > New Revision: 172535
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=172535&view=rev
> > Log:
> > Fix operand type conditions in one of ICmpInst constructors.
> >
> > It was out of sync with the conditions in the other two constructors.
> 
> Is there a case where this assert used to erroneously fire? Do you
> have a test case for that?
> 
> >
> > Modified:
> >     llvm/trunk/include/llvm/IR/Instructions.h
> >
> > Modified: llvm/trunk/include/llvm/IR/Instructions.h
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/Instructions.h?rev=172535&r1=172534&r2=172535&view=diff
> > ==============================================================================
> > --- llvm/trunk/include/llvm/IR/Instructions.h (original)
> > +++ llvm/trunk/include/llvm/IR/Instructions.h Tue Jan 15 09:30:33 2013
> > @@ -953,7 +953,7 @@
> >            "Both operands to ICmp instruction are not of the same type!");
> >      // Check that the operands are the right type
> >      assert((getOperand(0)->getType()->isIntOrIntVectorTy() ||
> > -            getOperand(0)->getType()->isPointerTy()) &&
> > +            getOperand(0)->getType()->getScalarType()->isPointerTy()) &&
> >             "Invalid operand types for ICmp instruction");
> >    }
> >
> >
> >
> > _______________________________________________
> > llvm-commits mailing list
> > llvm-commits at cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130115/5e273f05/attachment.html>


More information about the llvm-commits mailing list