[llvm] [X86] Merge BT with a matching BTR/BTS/BTC (PR #193612)
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Thu May 7 03:27:30 PDT 2026
================
@@ -165,6 +165,14 @@ let IsStrictFP = true in {
// X86 bit-test instructions.
def X86bt : SDNode<"X86ISD::BT", SDTX86CmpTest>;
+// X86 bit-test-and-modify instructions: res, EFLAGS = op src, bitno.
+// CF is set from the pre-operation bit value; BT on the same operands is
+// therefore redundant after one of these nodes. The atomic (locked) variants
+// live under X86ISD::LBTR/LBTS/LBTC.
+def X86btr_flag : SDNode<"X86ISD::BTR", SDTBinaryArithWithFlags>;
+def X86bts_flag : SDNode<"X86ISD::BTS", SDTBinaryArithWithFlags>;
+def X86btc_flag : SDNode<"X86ISD::BTC", SDTBinaryArithWithFlags>;
----------------
RKSimon wrote:
Drop the _flag postfix?
https://github.com/llvm/llvm-project/pull/193612
More information about the llvm-commits
mailing list