CondOpt pass does not check for destination register liveness of subs (alias with cmp) instructions. Our internal test reveals such case should not be transformed: cmp x17, #3 b.lt .LBB10_15 ... subs x12, x12, #1 b.gt .LBB10_1 where x12 is a liveout, becomes: cmp x17, #2 b.le .LBB10_15 ... subs x12, x12, #2 b.ge .LBB10_1
Details
Details
Diff Detail
Diff Detail
Event Timeline
Comment Actions
Hi,
Somehow from instruction reference and comments I mistakenly assumed that
such instructions won't occur with liveout destinations, but now I see it
should be checked. I tried to make a test-case for a couple hours, but
had no luck here.
Thanks for catching this!
Regards,
Sergey
lib/Target/AArch64/AArch64ConditionOptimizer.cpp | ||
---|---|---|
130 | There is INITIALIZE_PASS_BEGIN...INITIALIZE_PASS_END above (not full context, by the way), LiveIntervals should be added there as well or just drop lines from namespace llvm { to INITIALIZE_PASS_END (might be preferred). |
There is INITIALIZE_PASS_BEGIN...INITIALIZE_PASS_END above (not full context, by the way), LiveIntervals should be added there as well or just drop lines from namespace llvm { to INITIALIZE_PASS_END (might be preferred).