Skip to content

Commit

Permalink
fixup! Put back some freezes that I should't have removed.
Browse files Browse the repository at this point in the history
  • Loading branch information
topperc committed Mar 6, 2024
1 parent 3b50859 commit 78e48c9
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 48 deletions.
6 changes: 3 additions & 3 deletions llvm/lib/Target/RISCV/RISCVISelLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7290,13 +7290,13 @@ static SDValue combineSelectToBinOp(SDNode *N, SelectionDAG &DAG,
// (select !x, x, y) -> x & y
if (std::optional<bool> MatchResult = matchSetCC(LHS, RHS, CC, TrueV)) {
return DAG.getNode(*MatchResult ? ISD::OR : ISD::AND, DL, VT, TrueV,
FalseV);
DAG.getFreeze(FalseV));
}
// (select x, y, x) -> x & y
// (select !x, y, x) -> x | y
if (std::optional<bool> MatchResult = matchSetCC(LHS, RHS, CC, FalseV)) {
return DAG.getNode(*MatchResult ? ISD::AND : ISD::OR, DL, VT, TrueV,
FalseV);
return DAG.getNode(*MatchResult ? ISD::AND : ISD::OR, DL, VT,
DAG.getFreeze(TrueV), FalseV);
}
}

Expand Down
2 changes: 1 addition & 1 deletion llvm/test/CodeGen/RISCV/forced-atomics.ll
Original file line number Diff line number Diff line change
Expand Up @@ -3567,8 +3567,8 @@ define i64 @rmw64_umax_seq_cst(ptr %p) nounwind {
; RV32-NEXT: # in Loop: Header=BB51_2 Depth=1
; RV32-NEXT: neg a3, a0
; RV32-NEXT: and a3, a3, a1
; RV32-NEXT: sw a4, 0(sp)
; RV32-NEXT: sw a1, 4(sp)
; RV32-NEXT: sw a4, 0(sp)
; RV32-NEXT: mv a1, sp
; RV32-NEXT: li a4, 5
; RV32-NEXT: li a5, 5
Expand Down
88 changes: 44 additions & 44 deletions llvm/test/CodeGen/RISCV/iabs.ll
Original file line number Diff line number Diff line change
Expand Up @@ -302,56 +302,56 @@ define i128 @abs128(i128 %x) {
; RV32I-LABEL: abs128:
; RV32I: # %bb.0:
; RV32I-NEXT: lw a2, 12(a1)
; RV32I-NEXT: lw a3, 4(a1)
; RV32I-NEXT: lw a4, 0(a1)
; RV32I-NEXT: lw a3, 0(a1)
; RV32I-NEXT: lw a4, 4(a1)
; RV32I-NEXT: lw a1, 8(a1)
; RV32I-NEXT: bgez a2, .LBB8_2
; RV32I-NEXT: # %bb.1:
; RV32I-NEXT: neg a5, a1
; RV32I-NEXT: or a6, a4, a3
; RV32I-NEXT: snez a6, a6
; RV32I-NEXT: sltu a7, a5, a6
; RV32I-NEXT: snez a6, a4
; RV32I-NEXT: snez a7, a3
; RV32I-NEXT: or a6, a7, a6
; RV32I-NEXT: sltu t0, a5, a6
; RV32I-NEXT: snez a1, a1
; RV32I-NEXT: add a1, a2, a1
; RV32I-NEXT: neg a1, a1
; RV32I-NEXT: sub a2, a1, a7
; RV32I-NEXT: sub a2, a1, t0
; RV32I-NEXT: sub a1, a5, a6
; RV32I-NEXT: snez a5, a4
; RV32I-NEXT: neg a3, a3
; RV32I-NEXT: sub a3, a3, a5
; RV32I-NEXT: neg a4, a4
; RV32I-NEXT: sub a4, a4, a7
; RV32I-NEXT: neg a3, a3
; RV32I-NEXT: .LBB8_2:
; RV32I-NEXT: sw a4, 0(a0)
; RV32I-NEXT: sw a3, 0(a0)
; RV32I-NEXT: sw a4, 4(a0)
; RV32I-NEXT: sw a1, 8(a0)
; RV32I-NEXT: sw a3, 4(a0)
; RV32I-NEXT: sw a2, 12(a0)
; RV32I-NEXT: ret
;
; RV32ZBB-LABEL: abs128:
; RV32ZBB: # %bb.0:
; RV32ZBB-NEXT: lw a2, 12(a1)
; RV32ZBB-NEXT: lw a3, 4(a1)
; RV32ZBB-NEXT: lw a4, 0(a1)
; RV32ZBB-NEXT: lw a3, 0(a1)
; RV32ZBB-NEXT: lw a4, 4(a1)
; RV32ZBB-NEXT: lw a1, 8(a1)
; RV32ZBB-NEXT: bgez a2, .LBB8_2
; RV32ZBB-NEXT: # %bb.1:
; RV32ZBB-NEXT: neg a5, a1
; RV32ZBB-NEXT: or a6, a4, a3
; RV32ZBB-NEXT: snez a6, a6
; RV32ZBB-NEXT: sltu a7, a5, a6
; RV32ZBB-NEXT: snez a6, a4
; RV32ZBB-NEXT: snez a7, a3
; RV32ZBB-NEXT: or a6, a7, a6
; RV32ZBB-NEXT: sltu t0, a5, a6
; RV32ZBB-NEXT: snez a1, a1
; RV32ZBB-NEXT: add a1, a2, a1
; RV32ZBB-NEXT: neg a1, a1
; RV32ZBB-NEXT: sub a2, a1, a7
; RV32ZBB-NEXT: sub a2, a1, t0
; RV32ZBB-NEXT: sub a1, a5, a6
; RV32ZBB-NEXT: snez a5, a4
; RV32ZBB-NEXT: neg a3, a3
; RV32ZBB-NEXT: sub a3, a3, a5
; RV32ZBB-NEXT: neg a4, a4
; RV32ZBB-NEXT: sub a4, a4, a7
; RV32ZBB-NEXT: neg a3, a3
; RV32ZBB-NEXT: .LBB8_2:
; RV32ZBB-NEXT: sw a4, 0(a0)
; RV32ZBB-NEXT: sw a3, 0(a0)
; RV32ZBB-NEXT: sw a4, 4(a0)
; RV32ZBB-NEXT: sw a1, 8(a0)
; RV32ZBB-NEXT: sw a3, 4(a0)
; RV32ZBB-NEXT: sw a2, 12(a0)
; RV32ZBB-NEXT: ret
;
Expand Down Expand Up @@ -384,56 +384,56 @@ define i128 @select_abs128(i128 %x) {
; RV32I-LABEL: select_abs128:
; RV32I: # %bb.0:
; RV32I-NEXT: lw a2, 12(a1)
; RV32I-NEXT: lw a3, 4(a1)
; RV32I-NEXT: lw a4, 0(a1)
; RV32I-NEXT: lw a3, 0(a1)
; RV32I-NEXT: lw a4, 4(a1)
; RV32I-NEXT: lw a1, 8(a1)
; RV32I-NEXT: bgez a2, .LBB9_2
; RV32I-NEXT: # %bb.1:
; RV32I-NEXT: neg a5, a1
; RV32I-NEXT: or a6, a4, a3
; RV32I-NEXT: snez a6, a6
; RV32I-NEXT: sltu a7, a5, a6
; RV32I-NEXT: snez a6, a4
; RV32I-NEXT: snez a7, a3
; RV32I-NEXT: or a6, a7, a6
; RV32I-NEXT: sltu t0, a5, a6
; RV32I-NEXT: snez a1, a1
; RV32I-NEXT: add a1, a2, a1
; RV32I-NEXT: neg a1, a1
; RV32I-NEXT: sub a2, a1, a7
; RV32I-NEXT: sub a2, a1, t0
; RV32I-NEXT: sub a1, a5, a6
; RV32I-NEXT: snez a5, a4
; RV32I-NEXT: neg a3, a3
; RV32I-NEXT: sub a3, a3, a5
; RV32I-NEXT: neg a4, a4
; RV32I-NEXT: sub a4, a4, a7
; RV32I-NEXT: neg a3, a3
; RV32I-NEXT: .LBB9_2:
; RV32I-NEXT: sw a4, 0(a0)
; RV32I-NEXT: sw a3, 0(a0)
; RV32I-NEXT: sw a4, 4(a0)
; RV32I-NEXT: sw a1, 8(a0)
; RV32I-NEXT: sw a3, 4(a0)
; RV32I-NEXT: sw a2, 12(a0)
; RV32I-NEXT: ret
;
; RV32ZBB-LABEL: select_abs128:
; RV32ZBB: # %bb.0:
; RV32ZBB-NEXT: lw a2, 12(a1)
; RV32ZBB-NEXT: lw a3, 4(a1)
; RV32ZBB-NEXT: lw a4, 0(a1)
; RV32ZBB-NEXT: lw a3, 0(a1)
; RV32ZBB-NEXT: lw a4, 4(a1)
; RV32ZBB-NEXT: lw a1, 8(a1)
; RV32ZBB-NEXT: bgez a2, .LBB9_2
; RV32ZBB-NEXT: # %bb.1:
; RV32ZBB-NEXT: neg a5, a1
; RV32ZBB-NEXT: or a6, a4, a3
; RV32ZBB-NEXT: snez a6, a6
; RV32ZBB-NEXT: sltu a7, a5, a6
; RV32ZBB-NEXT: snez a6, a4
; RV32ZBB-NEXT: snez a7, a3
; RV32ZBB-NEXT: or a6, a7, a6
; RV32ZBB-NEXT: sltu t0, a5, a6
; RV32ZBB-NEXT: snez a1, a1
; RV32ZBB-NEXT: add a1, a2, a1
; RV32ZBB-NEXT: neg a1, a1
; RV32ZBB-NEXT: sub a2, a1, a7
; RV32ZBB-NEXT: sub a2, a1, t0
; RV32ZBB-NEXT: sub a1, a5, a6
; RV32ZBB-NEXT: snez a5, a4
; RV32ZBB-NEXT: neg a3, a3
; RV32ZBB-NEXT: sub a3, a3, a5
; RV32ZBB-NEXT: neg a4, a4
; RV32ZBB-NEXT: sub a4, a4, a7
; RV32ZBB-NEXT: neg a3, a3
; RV32ZBB-NEXT: .LBB9_2:
; RV32ZBB-NEXT: sw a4, 0(a0)
; RV32ZBB-NEXT: sw a3, 0(a0)
; RV32ZBB-NEXT: sw a4, 4(a0)
; RV32ZBB-NEXT: sw a1, 8(a0)
; RV32ZBB-NEXT: sw a3, 4(a0)
; RV32ZBB-NEXT: sw a2, 12(a0)
; RV32ZBB-NEXT: ret
;
Expand Down

0 comments on commit 78e48c9

Please sign in to comment.