[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cfe-commits
Subject:    Re: [PATCH] D12087: always_inline codegen rewrite
From:       Reid Kleckner via cfe-commits <cfe-commits () lists ! llvm ! org>
Date:       2015-08-31 21:02:39
Message-ID: c96d915e6336fedbfa13c155e9eb2685 () localhost ! localdomain
[Download RAW message or body]

rnk added a subscriber: rnk.

================
Comment at: lib/CodeGen/CodeGenModule.cpp:469-470
@@ +468,4 @@
+  llvm::LLVMContext &Ctx = getModule().getContext();
+  llvm::Function *StubFn =
+      llvm::Function::Create(FT, Fn->getLinkage(), Name, &getModule());
+  assert(StubFn->getName() == Name && "name was uniqued!");
----------------
This is a lot of work to do for every always_inline function that got called. Can we do this like:
1. Build SmallVector<Use*> of all non-direct call uses of Fn
2. Return if there are no such uses
3. Build the stub function replacement
4. `for (Use *U : IndirectUses) U->set(StubFn)`

================
Comment at: test/CodeGen/2008-05-19-AlwaysInline.c:1
@@ -1,2 +1,2 @@
-// RUN: %clang_cc1 %s -emit-llvm -o - | not grep sabrina
+// RUN: %clang_cc1 %s -emit-llvm -o - | not grep 'call.*sabrina('
 
----------------
FileCheck?

================
Comment at: test/CodeGenCXX/dllimport.cpp:247-250
@@ -246,1 +246,6 @@
 // MSC2-NOT: @"\01?alwaysInline@@YAXXZ"()
+// MSC2:     declare dllimport void @"\01?alwaysInline@@YAXXZ"()
+// MSC2-NOT: @"\01?alwaysInline@@YAXXZ"()
+
+// GNU2-NOT: @_Z12alwaysInlinev()
+// GNU2:     define linkonce_odr void @_Z12alwaysInlinev()
----------------
This change will go away if you only create the decl when its used indirectly.


http://reviews.llvm.org/D12087



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic