[llvm-commits] [llvm] r55227 - /llvm/trunk/lib/VMCore/Verifier.cpp

Gordon Henriksen gordonhenriksen at me.com
Sat Aug 23 18:19:41 PDT 2008


Yup. The code in question verifies more than the prototypes.

> -        Assert1(isa<AllocaInst>(CI.getOperand(1)- 
> >stripPointerCasts()),
> -                "llvm.gcroot parameter #1 must be an alloca.", &CI);
> -        Assert1(isa<Constant>(CI.getOperand(2)),
> -                "llvm.gcroot parameter #2 must be a constant.", &CI);


> -      Assert1(CI.getParent()->getParent()->hasGC(),
> -              "Enclosing function does not use GC.",
> -              &CI);

The rest is a holdover from when these intrinsics allowed arbitrary  
types.

We could verify these 3 cases and fall through to the default case for  
the rest; or just drop the type checks if the prototypes are already  
verified.

On Aug 23, 2008, at 05:45, Bill Wendling wrote:

> I think that this patch broke the regression tests. Reverting for now.
>
> -bw
>
> Here's what I'm getting:
>
> Running /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.HEAD.src/
> test/Verifier/dg.exp ...
> FAIL: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.HEAD.src/
> test/Verifier/gcread-ptrptr.ll for PR1633
> Failed with exit(1) at line 1
> while running: not llvm-as < /Volumes/Sandbox/Buildbot/llvm/full-llvm/
> build/llvm.HEAD.src/test/Verifier/gcread-ptrptr.ll >& /dev/null
> child process exited abnormally
> FAIL: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.HEAD.src/
> test/Verifier/gcroot-alloca.ll for PR1633
> Failed with exit(1) at line 1
> while running: not llvm-as < /Volumes/Sandbox/Buildbot/llvm/full-llvm/
> build/llvm.HEAD.src/test/Verifier/gcroot-alloca.ll >& /dev/null
> child process exited abnormally
> FAIL: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.HEAD.src/
> test/Verifier/gcroot-meta.ll for PR1633
> Failed with exit(1) at line 1
> while running: not llvm-as < /Volumes/Sandbox/Buildbot/llvm/full-llvm/
> build/llvm.HEAD.src/test/Verifier/gcroot-meta.ll >& /dev/null
> child process exited abnormally
> FAIL: ndbox/Buildbot/llvm/full-llvm/build/llvm.HEAD.src/test/Verifier/
> gcroot-ptrptr.ll for PR1633
> Failed with exit(1) at line 1
> while running: not llvm-as < /Volumes/Sandbox/Buildbot/llvm/full-llvm/
> build/llvm.HEAD.src/test/Verifier/gcroot-ptrptr.ll >& /dev/null
> child process exited abnormally
> FAIL: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.HEAD.src/
> test/Verifier/gcwrite-ptrptr.ll for PR1633
> Failed with exit(1) at line 1
> while running: not llvm-as < /Volumes/Sandbox/Buildbot/llvm/full-llvm/
> build/llvm.HEAD.src/test/Verifier/gcwrite-ptrptr.ll >& /dev/null
> child process exited abnormally
>
> 		===  Summary ===
>
> # of expected passes		3021
> # of unexpected failures	6
> # of expected failures		16
> make[1]: *** [check-local] Error 1
> make: *** [check] Error 2
>
> On Aug 22, 2008, at 10:26 PM, Chris Lattner wrote:
>
>> Author: lattner
>> Date: Sat Aug 23 00:26:35 2008
>> New Revision: 55227
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=55227&view=rev
>> Log:
>> remove verification for gc intrinsic argument types.  it was
>> indented wrong
>> and tblgen now knows intrinsic prototypes.
>>
>> Modified:
>>   llvm/trunk/lib/VMCore/Verifier.cpp
>>
>> Modified: llvm/trunk/lib/VMCore/Verifier.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Verifier.cpp?rev=55227&r1=55226&r2=55227&view=diff
>>
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> = 
>> =====================================================================
>> --- llvm/trunk/lib/VMCore/Verifier.cpp (original)
>> +++ llvm/trunk/lib/VMCore/Verifier.cpp Sat Aug 23 00:26:35 2008
>> @@ -1273,45 +1273,6 @@
>>  switch (ID) {
>>  default:
>>    break;
>> -  case Intrinsic::gcroot:
>> -  case Intrinsic::gcwrite:
>> -  case Intrinsic::gcread: {
>> -      Type *PtrTy    = PointerType::getUnqual(Type::Int8Ty),
>> -           *PtrPtrTy = PointerType::getUnqual(PtrTy);
>> -
>> -      switch (ID) {
>> -      default:
>> -        break;
>> -      case Intrinsic::gcroot:
>> -        Assert1(CI.getOperand(1)->getType() == PtrPtrTy,
>> -                "Intrinsic parameter #1 is not i8**.", &CI);
>> -        Assert1(CI.getOperand(2)->getType() == PtrTy,
>> -                "Intrinsic parameter #2 is not i8*.", &CI);
>> -        Assert1(isa<AllocaInst>(CI.getOperand(1)-
>>> stripPointerCasts()),
>> -                "llvm.gcroot parameter #1 must be an alloca.", &CI);
>> -        Assert1(isa<Constant>(CI.getOperand(2)),
>> -                "llvm.gcroot parameter #2 must be a constant.",  
>> &CI);
>> -        break;
>> -      case Intrinsic::gcwrite:
>> -        Assert1(CI.getOperand(1)->getType() == PtrTy,
>> -                "Intrinsic parameter #1 is not a i8*.", &CI);
>> -        Assert1(CI.getOperand(2)->getType() == PtrTy,
>> -                "Intrinsic parameter #2 is not a i8*.", &CI);
>> -        Assert1(CI.getOperand(3)->getType() == PtrPtrTy,
>> -                "Intrinsic parameter #3 is not a i8**.", &CI);
>> -        break;
>> -      case Intrinsic::gcread:
>> -        Assert1(CI.getOperand(1)->getType() == PtrTy,
>> -                "Intrinsic parameter #1 is not a i8*.", &CI);
>> -        Assert1(CI.getOperand(2)->getType() == PtrPtrTy,
>> -                "Intrinsic parameter #2 is not a i8**.", &CI);
>> -        break;
>> -      }
>> -
>> -      Assert1(CI.getParent()->getParent()->hasGC(),
>> -              "Enclosing function does not use GC.",
>> -              &CI);
>> -    } break;
>>  case Intrinsic::init_trampoline:
>>    Assert1(isa<Function>(CI.getOperand(2)->stripPointerCasts()),
>>            "llvm.init_trampoline parameter #2 must resolve to a
>> function.",
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits



— Gordon

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20080823/8cbeab28/attachment.html>


More information about the llvm-commits mailing list