[llvm] r190233 - Remove verifier check that attribute 'builtin' is only applied to calls to

Richard Smith richard-llvm at metafoo.co.uk
Fri Sep 6 17:25:48 PDT 2013


Author: rsmith
Date: Fri Sep  6 19:25:48 2013
New Revision: 190233

URL: http://llvm.org/viewvc/llvm-project?rev=190233&view=rev
Log:
Remove verifier check that attribute 'builtin' is only applied to calls to
functions marked 'nobuiltin'. That approach doesn't play well with LTO, and
there's no harm in marking a call as 'builtin' if it was going to be a builtin
regardless.

Modified:
    llvm/trunk/lib/IR/Verifier.cpp
    llvm/trunk/test/Assembler/attribute-builtin.ll

Modified: llvm/trunk/lib/IR/Verifier.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Verifier.cpp?rev=190233&r1=190232&r2=190233&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Verifier.cpp (original)
+++ llvm/trunk/lib/IR/Verifier.cpp Fri Sep  6 19:25:48 2013
@@ -1553,14 +1553,6 @@ void Verifier::VerifyCallSite(CallSite C
               "Function has metadata parameter but isn't an intrinsic", I);
   }
 
-  // If the call site has the 'builtin' attribute, verify that it's applied to a
-  // direct call to a function with the 'nobuiltin' attribute.
-  if (CS.hasFnAttr(Attribute::Builtin))
-    Assert1(CS.getCalledFunction() &&
-            CS.getCalledFunction()->hasFnAttribute(Attribute::NoBuiltin),
-            "Attribute 'builtin' can only be used in a call to a function with "
-            "the 'nobuiltin' attribute.", I);
-
   visitInstruction(*I);
 }
 

Modified: llvm/trunk/test/Assembler/attribute-builtin.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/attribute-builtin.ll?rev=190233&r1=190232&r2=190233&view=diff
==============================================================================
--- llvm/trunk/test/Assembler/attribute-builtin.ll (original)
+++ llvm/trunk/test/Assembler/attribute-builtin.ll Fri Sep  6 19:25:48 2013
@@ -28,8 +28,6 @@ define i8* @bar(i8* %x) {
 
 ; RUN: not llvm-as <%s 2>&1  | FileCheck -check-prefix=CHECK-BAD %s
 
-; CHECK-BAD: Attribute 'builtin' can only be used in a call to a function with the 'nobuiltin' attribute.
-; CHECK-BAD-NEXT: %y = call i8* @lar(i8* %x) #1
 ; CHECK-BAD: Attribute 'builtin' can only be applied to a callsite.
 ; CHECK-BAD-NEXT: i8* (i8*)* @car
 ; CHECK-BAD: Attribute 'builtin' can only be applied to a callsite.





More information about the llvm-commits mailing list