Remove verifier check that attribute 'builtin' is only applied to calls to
authorRichard Smith <richard-llvm@metafoo.co.uk>
Sat, 7 Sep 2013 00:25:48 +0000 (00:25 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Sat, 7 Sep 2013 00:25:48 +0000 (00:25 +0000)
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190233 91177308-0d34-0410-b5e6-96231b3b80d8

lib/IR/Verifier.cpp
test/Assembler/attribute-builtin.ll

index 3d296405b1874e1e0695b4b9fb8e7a78d5cb610a..64b7aaa9a754af60592413c00c890cfcc20576ac 100644 (file)
@@ -1553,14 +1553,6 @@ void Verifier::VerifyCallSite(CallSite CS) {
               "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);
 }
 
index f31596ce69d0cb851d1e33389ef4e72dde04c5bc..01c8a6bd8653e5bd05c259f2a5d548fe243485f6 100644 (file)
@@ -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.