From cee313d288a4faf0355d76fb6e0e927e211d08a5 Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Wed, 17 Apr 2019 04:52:47 +0000 Subject: Revert "Temporarily Revert "Add basic loop fusion pass."" The reversion apparently deleted the test/Transforms directory. Will be re-reverting again. llvm-svn: 358552 --- llvm/test/Transforms/SampleProfile/inline-act.ll | 72 ++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 llvm/test/Transforms/SampleProfile/inline-act.ll (limited to 'llvm/test/Transforms/SampleProfile/inline-act.ll') diff --git a/llvm/test/Transforms/SampleProfile/inline-act.ll b/llvm/test/Transforms/SampleProfile/inline-act.ll new file mode 100644 index 00000000000..f5438701146 --- /dev/null +++ b/llvm/test/Transforms/SampleProfile/inline-act.ll @@ -0,0 +1,72 @@ +; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/inline-act.prof + +; Sample profile should have non-empty ACT passed to inliner + +; int t; +; bool foo(int value) { +; switch(value) { +; case 0: +; case 1: +; case 3: +; return true; +; default: +; return false; +; } +; } +; void bar(int i) { +; if (foo(i)) +; t *= 2; +; } + +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" + +@t = global i32 0, align 4 + +; Function Attrs: nounwind uwtable +define zeroext i1 @_Z3fooi(i32) #0 { + %switch.tableidx = sub i32 %0, 0 + %2 = icmp ult i32 %switch.tableidx, 4 + br i1 %2, label %switch.lookup, label %3 + +switch.lookup: ; preds = %1 + %switch.cast = trunc i32 %switch.tableidx to i4 + %switch.shiftamt = mul i4 %switch.cast, 1 + %switch.downshift = lshr i4 -5, %switch.shiftamt + %switch.masked = trunc i4 %switch.downshift to i1 + ret i1 %switch.masked + +;