It was recently discovered that the handling of CC values was actually broken since overflow was not properly handled.
Add and sub instructions have now a new target specific instruction flag called SystemZII::CCIfNoSWrapOnly. This means that the CC result can be used instead of a compare with 0 only if the instruction has the 'nsw' flag set. Without 'nsw', the compare can not be eliminated.
Load complement/negative/positive can also overflow which means they should as well not be used for compare-with-0 elimination.