mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-04-01 12:43:47 +00:00
[X86] combineAddOrSubToADCOrSBB/combineCarryThroughADD - use oneuse for entire SDNode
Fix issue noted in D57281 that only tested the one use for the SDValue (the result flag), not the entire SUB. I've added the getNode() to make it clearer what is intended than just the -> redirection. llvm-svn: 352291
This commit is contained in:
parent
64c3fe9103
commit
a914fa4dd8
@ -34901,7 +34901,8 @@ static SDValue combineCarryThroughADD(SDValue EFLAGS, SelectionDAG &DAG) {
|
||||
// Do not flip "e > c", where "c" is a constant, because Cmp
|
||||
// instruction cannot take an immediate as its first operand.
|
||||
//
|
||||
if (CarryOp1.getOpcode() == X86ISD::SUB && CarryOp1.hasOneUse() &&
|
||||
if (CarryOp1.getOpcode() == X86ISD::SUB &&
|
||||
CarryOp1.getNode()->hasOneUse() &&
|
||||
CarryOp1.getValueType().isInteger() &&
|
||||
!isa<ConstantSDNode>(CarryOp1.getOperand(1))) {
|
||||
SDValue SubCommute =
|
||||
@ -40716,7 +40717,7 @@ static SDValue combineAddOrSubToADCOrSBB(SDNode *N, SelectionDAG &DAG) {
|
||||
// Do not flip "e > c", where "c" is a constant, because Cmp instruction
|
||||
// cannot take an immediate as its first operand.
|
||||
//
|
||||
if (EFLAGS.getOpcode() == X86ISD::SUB && EFLAGS.hasOneUse() &&
|
||||
if (EFLAGS.getOpcode() == X86ISD::SUB && EFLAGS.getNode()->hasOneUse() &&
|
||||
EFLAGS.getValueType().isInteger() &&
|
||||
!isa<ConstantSDNode>(EFLAGS.getOperand(1))) {
|
||||
SDValue NewSub = DAG.getNode(X86ISD::SUB, SDLoc(EFLAGS),
|
||||
|
Loading…
x
Reference in New Issue
Block a user