[PATCH] [TargetInstrInfo] Add new hook: AnalyzeBranchPredicate.
Sanjoy Das
sanjoy at playingwithpointers.com
Fri Jun 12 16:50:21 PDT 2015
================
Comment at: lib/Target/X86/X86InstrInfo.cpp:3640-3641
@@ +3639,4 @@
+ MBP.ConditionDef = &*DefFlagsI;
+ MBP.SingleUseCondition = CondBranches.size() == 1 &&
+ CondBranches[0]->killsRegister(X86::EFLAGS, TRI);
+
----------------
atrick wrote:
> This looks strange to me. Do you really need to prove that the ConditionDef only has a single use? If so, I think you should:
>
> - check that EFLAGS is not live into any successors
>
> - Walk backward from the branch looking for a Def of EFLAGS before any other use of EFLAGS.
>
> You may have EFLAGS readers other than conditional branches.
> killsRegister is a crutch that should be avoided whenever possible. It might not be accurate.
> Do you really need to prove that the ConditionDef only has a single use?
Preferably. I'd like to remove the test instruction as part of the implicit null check optimization.
I'll make the change you suggested.
http://reviews.llvm.org/D10200
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
More information about the llvm-commits
mailing list