[llvm-dev] What kind of testcases should be required to test IPRA?

Mehdi Amini via llvm-dev llvm-dev at lists.llvm.org
Sat Jun 4 20:26:38 PDT 2016

> On Jun 4, 2016, at 7:56 PM, vivek pandya <vivekvpandya at gmail.com> wrote:
> Hello Mehdi Amini,
> Sorry for slow progress this week but it was due to interesting mistake of mine. I had build llvm with ipra enable by default and that build files were on my path ! Due to that next time I tried to build llvm it was terribly slow  (almost 1 hour for 10% build ). I spend to much time on fixing this by playing around with environment variables, cmake options etc.
> But I think this is a serious concern, we need to think verify this time complexity other wise building a large software with IPRA enable would be very time consuming.

Did you build your own clang in release mode or debug? That makes a very important difference...

> I studied tets case suggest by you on phabricator, for RegUsageInfo passes I am thinking to print clobbered registers and verify that with FileCheck as expected clobbered register for a particular test-case. Is this approach fine?
> I did not find function call to CostModelAnalysis::print() , Is opt -analyze making that call ?

(In general, if you find yourself in a situation where you can find the caller for a function, run in a debugger and set a breakpoint)

> I am not able to find similar option in llc.

That's an issue. Looks it may not be feasible to test the analysis in llc with the current infrastructure.

> I can't use info printed with dbgs() function as release build do not add -debug-only option to llc executable. 
> For the testcase sent by you earlier I have modified it as following :
> ;;;;; ip-regallco-simple.ll
> ; RUN: llc < %s | FileCheck %s -check-prefix=NOIPRA
> ; RUN: llc < %s -enable-ipra | FileCheck %s
> ; NOIPRA: foo:

should be NOIPRA-LABEL:

> ; NOIPRA: pushq	%r10
> ; NOIPRA: pushq	%r9
> ; NOIPRA: pushq	%r8 
> ; NOIPRA: calls bar1

If this is an exact sequence you want to match, you may use NOIPRA-NEXT:

> ; CHECK: foo:
> ; CHECK-NOT: pushq %r10
> ; CHECK-NOT: pushq %r9
> ; CHECK-NOT: pushq %r8

You can just write "CHECK-NOT: push"

> ; CHECK: callq bar1
> target triple = "x86_64-unknown-unknown"
> define void @bar1() {
> 	ret void
> }
> define preserve_allcc void @foo()#0 {
> 	call void @bar1()
> 	call void @bar2()
> 	ret void
> }
> define void @bar2() {
> 	ret void
> }
> attributes #0 = {nounwind}
> Is this correct approach to verify spills?



More information about the llvm-dev mailing list