llvm.org GIT mirror llvm / 9f68948
Try trivial remat before the coalescer gives up on a vr / physreg coalescing for fear of tying up a physical register. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99575 91177308-0d34-0410-b5e6-96231b3b80d8 Evan Cheng 9 years ago
4 changed file(s) with 24 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
16631663 if (JoinPInt.ranges.size() > 1000) {
16641664 mri_->setRegAllocationHint(JoinVInt.reg, 0, JoinPReg);
16651665 ++numAborts;
1666 DEBUG(dbgs() << "\tPhysical register too complicated, abort!\n");
1666 DEBUG(dbgs()
1667 << "\tPhysical register live interval too complicated, abort!\n");
16671668 return false;
16681669 }
16691670
16741675 if (Length > Threshold &&
16751676 (((float)std::distance(mri_->use_nodbg_begin(JoinVReg),
16761677 mri_->use_nodbg_end()) / Length) < Ratio)) {
1678 // Before giving up coalescing, if definition of source is defined by
1679 // trivial computation, try rematerializing it.
1680 if (ReMaterializeTrivialDef(SrcInt, DstReg, DstSubIdx, CopyMI))
1681 return true;
1682
16771683 mri_->setRegAllocationHint(JoinVInt.reg, 0, JoinPReg);
16781684 ++numAborts;
16791685 DEBUG(dbgs() << "\tMay tie down a physical register, abort!\n");
0 ; RUN: llc < %s -march=x86-64 -mattr=+sse3 -stats |& grep {2 machine-licm}
1 ; RUN: llc < %s -march=x86-64 -mattr=+sse3 | FileCheck %s
12 ; rdar://6627786
3 ; rdar://7792037
24
35 target triple = "x86_64-apple-darwin10.0"
46 %struct.Key = type { i64 }
1012 br label %bb4
1113
1214 bb4: ; preds = %bb.i, %bb26, %bb4, %entry
15 ; CHECK: %bb4
16 ; CHECK: xorb
17 ; CHECK: callq
18 ; CHECK: movq
19 ; CHECK: xorl
20 ; CHECK: xorb
21
1322 %0 = call i32 (...)* @xxGetOffsetForCode(i32 undef) nounwind ; [#uses=0]
1423 %ins = or i64 %p, 2097152 ; [#uses=1]
1524 %1 = call i32 (...)* @xxCalculateMidType(%struct.Key* %desc, i32 0) nounwind ; [#uses=1]
None ; RUN: llc < %s -march=x86 | grep mov | count 6
0 ; RUN: llc < %s -march=x86 | grep mov | count 5
11 ; PR2659
22
33 define i32 @binomial(i32 %n, i32 %k) nounwind {
None ; RUN: llc < %s -march=x86 -mtriple=i686-apple-darwin9.4.0 | grep movl | count 6
0 ; RUN: llc < %s -march=x86 -mtriple=i686-apple-darwin9.4.0 | grep movl | count 5
1 ; RUN: llc < %s -march=x86 -mtriple=i686-apple-darwin9.4.0 | FileCheck %s
12 ; PR2659
23
34 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
1112 forcond.preheader: ; preds = %entry
1213 %cmp44 = icmp eq i32 %k, 0 ; [#uses=1]
1314 br i1 %cmp44, label %afterfor, label %forbody
15
16 ; CHECK: %forcond.preheader.forbody_crit_edge
17 ; CHECK: movl $1
18 ; CHECK-NOT: xorl
19 ; CHECK-NEXT: movl $1
1420
1521 ifthen: ; preds = %entry
1622 ret i32 0