[TargetInstrInfo] Fix the implementation of commuteInstruction to match the
authorQuentin Colombet <qcolombet@apple.com>
Thu, 8 May 2014 23:12:27 +0000 (23:12 +0000)
committerQuentin Colombet <qcolombet@apple.com>
Thu, 8 May 2014 23:12:27 +0000 (23:12 +0000)
commit8d53407abba2fb328edea4aa3079827f348ec41f
treee8d6329f564396c950f34494d0861c32f22d058c
parent8ec421c2557f437e14cb0246fefee9cda16a06ef
[TargetInstrInfo] Fix the implementation of commuteInstruction to match the
comment of the API.

Relaxes the behavior of TargetInstrInfo::commuteInstruction when
TargetInstrInfo::findCommutedOpIndices returns false.

Previously TargetInstrInfo triggered a fatal error in such situation whereas based
on the comment in the API it should just return nullptr. Indeed the only
precondition that should be ensured is that the instruction must be commutable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208371 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/TargetInstrInfo.cpp