File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,10 @@ static cl::opt<unsigned int> MaxAccumulatorWidth(
5656 " acc-max-width" , cl::Hidden, cl::init(3 ),
5757 cl::desc(" Maximum number of branches in the accumulator tree" ));
5858
59+ static cl::opt<bool > AllowNTRemat (
60+ " allow-none-trival-remat" , cl::init(true ), cl::Hidden,
61+ cl::desc(" Allow non-trivial rematerialization by default" ));
62+
5963TargetInstrInfo::~TargetInstrInfo () = default ;
6064
6165const TargetRegisterClass *
@@ -1657,6 +1661,14 @@ bool TargetInstrInfo::isReMaterializableImpl(
16571661 // same virtual register, though.
16581662 if (MO.isDef () && Reg != DefReg)
16591663 return false ;
1664+
1665+ // Don't allow any virtual-register uses. Rematting an instruction with
1666+ // virtual register uses would length the live ranges of the uses, which
1667+ // is not necessarily a good idea, certainly not "trivial".
1668+ if (!AllowNTRemat) {
1669+ if (MO.isUse ())
1670+ return false ;
1671+ }
16601672 }
16611673
16621674 // Everything checked out.
You can’t perform that action at this time.
0 commit comments