]> granicus.if.org Git - llvm/commit
[X86] Add a one use check on the setcc to the min/max canonicalization code in combin...
authorCraig Topper <craig.topper@intel.com>
Sun, 13 Oct 2019 06:48:05 +0000 (06:48 +0000)
committerCraig Topper <craig.topper@intel.com>
Sun, 13 Oct 2019 06:48:05 +0000 (06:48 +0000)
commit213f1f4cbf26f46d676ae61b8bb667a11cd96736
tree557527b73cf3c054f444167caf03dc0325ab413c
parente166f9ed844a67ec9e70bc425af72731f1b6bbac
[X86] Add a one use check on the setcc to the min/max canonicalization code in combineSelect.

This seems to improve std::midpoint code where we have a min and
a max with the same condition. If we split the setcc we can end
up with two compares if the one of the operands is a constant.
Since we aggressively canonicalize compares with constants.
For non-constants it can interfere with our ability to share
control flow if we need to expand cmovs into control flow.

I'm also not sure I understand this min/max canonicalization code.
The motivating case talks about comparing with 0. But we don't
check for 0 explicitly.

Removes one instruction from the codegen for PR43658.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374706 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86ISelLowering.cpp
test/CodeGen/X86/midpoint-int.ll