Skip to content

Commit 7aaeda4

Browse files
committed
fixup! [RISCV] Select and/or/xor with certain constants to Zbb ANDN/ORN/XNOR
1 parent aa65022 commit 7aaeda4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3253,10 +3253,10 @@ bool RISCVDAGToDAGISel::selectInvLogicImm(SDValue N, SDValue &Val) {
32533253
// For 64-bit constants, the instruction sequences get complex,
32543254
// so we select inverted only if it's cheaper.
32553255
if (!isInt<32>(Imm)) {
3256-
int OrigImmCost = RISCVMatInt::getIntMatCost(
3257-
APInt(64, Imm), 64, *Subtarget, /*CompressionCost=*/true);
3258-
int NegImmCost = RISCVMatInt::getIntMatCost(
3259-
APInt(64, ~Imm), 64, *Subtarget, /*CompressionCost=*/true);
3256+
int OrigImmCost = RISCVMatInt::getIntMatCost(APInt(64, Imm), 64, *Subtarget,
3257+
/*CompressionCost=*/true);
3258+
int NegImmCost = RISCVMatInt::getIntMatCost(APInt(64, ~Imm), 64, *Subtarget,
3259+
/*CompressionCost=*/true);
32603260
if (OrigImmCost <= NegImmCost)
32613261
return false;
32623262
}

0 commit comments

Comments
 (0)