]> granicus.if.org Git - llvm/commitdiff
[PM] Teach the inliner in the new PM to merge attributes after inlining.
authorChandler Carruth <chandlerc@gmail.com>
Tue, 27 Dec 2016 03:39:54 +0000 (03:39 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Tue, 27 Dec 2016 03:39:54 +0000 (03:39 +0000)
Also enable the new PM in the attributes test case which caught this
issue.

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

lib/Transforms/IPO/Inliner.cpp
test/Transforms/Inline/attributes.ll

index ff534a19e53e329af70c9e8e073ec3e0bed560a0..af26681df46b96dc0cb02e779a4809081c833b8e 100644 (file)
@@ -842,6 +842,9 @@ PreservedAnalyses InlinerPass::run(LazyCallGraph::SCC &InitialC,
           if (!NewCallee->isDeclaration())
             Calls.push_back(CS);
 
+      // Merge the attributes based on the inlining.
+      AttributeFuncs::mergeAttributesForInlining(F, Callee);
+
       // For local functions, check whether this makes the callee trivially
       // dead. In that case, we can drop the body of the function eagerly
       // which may reduce the number of callers of other functions to one,
index c1c5e7c70c7d297c7c9ac46fa50f77ff240db2c9..1cc64b784326e3edc2544b372c291463997d03cc 100644 (file)
@@ -1,4 +1,5 @@
 ; RUN: opt < %s -inline -S | FileCheck %s
+; RUN: opt < %s -passes='cgscc(inline)' -S | FileCheck %s
 target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128"
 
 define i32 @noattr_callee(i32 %i) {
@@ -305,4 +306,4 @@ define i32 @test_no-use-jump-tables3(i32 %i) "no-jump-tables"="true" {
 ; CHECK: attributes [[FPMAD_FALSE]] = { "less-precise-fpmad"="false" }
 ; CHECK: attributes [[FPMAD_TRUE]] = { "less-precise-fpmad"="true" }
 ; CHECK: attributes [[NOIMPLICITFLOAT]] = { noimplicitfloat }
-; CHECK: attributes [[NOUSEJUMPTABLES]] = { "no-jump-tables"="true" }
\ No newline at end of file
+; CHECK: attributes [[NOUSEJUMPTABLES]] = { "no-jump-tables"="true" }