File tree Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Original file line number Diff line number Diff line change @@ -102,6 +102,53 @@ bool ARMTTIImpl::areInlineCompatible(const Function *Caller,
102102 // the callers'.
103103 bool MatchSubset = ((CallerBits & CalleeBits) & InlineFeaturesAllowed) ==
104104 (CalleeBits & InlineFeaturesAllowed);
105+
106+ LLVM_DEBUG ({
107+ dbgs () << " === Inline compatibility debug ===\n " ;
108+ dbgs () << " Caller: " << Caller->getName () << " \n " ;
109+ dbgs () << " Callee: " << Callee->getName () << " \n " ;
110+
111+ // Bit diffs
112+ FeatureBitset MissingInCaller = CalleeBits & ~CallerBits; // callee-only
113+ FeatureBitset ExtraInCaller = CallerBits & ~CalleeBits; // caller-only
114+
115+ // Counts
116+ dbgs () << " Only-in-caller bit count: " << ExtraInCaller.count () << " \n " ;
117+ dbgs () << " Only-in-callee bit count: " << MissingInCaller.count () << " \n " ;
118+
119+ dbgs () << " Only-in-caller feature indices [" ;
120+ {
121+ bool First = true ;
122+ for (size_t I = 0 , E = ExtraInCaller.size (); I < E; ++I) {
123+ if (ExtraInCaller.test (I)) {
124+ if (!First)
125+ dbgs () << " , " ;
126+ dbgs () << I;
127+ First = false ;
128+ }
129+ }
130+ }
131+ dbgs () << " ]\n " ;
132+
133+ dbgs () << " Only-in-callee feature indices [" ;
134+ {
135+ bool First = true ;
136+ for (size_t I = 0 , E = MissingInCaller.size (); I < E; ++I) {
137+ if (MissingInCaller.test (I)) {
138+ if (!First)
139+ dbgs () << " , " ;
140+ dbgs () << I;
141+ First = false ;
142+ }
143+ }
144+ }
145+ dbgs () << " ]\n " ;
146+
147+ // Indicies map to features as found in
148+ // llvm-project/(your_build)/lib/Target/ARM/ARMGenSubtargetInfo.inc
149+ dbgs () << " MatchExact=" << (MatchExact ? " true" : " false" )
150+ << " MatchSubset=" << (MatchSubset ? " true" : " false" ) << " \n " ;
151+ });
105152 return MatchExact && MatchSubset;
106153}
107154
You can’t perform that action at this time.
0 commit comments