[clang] [llvm] [AMDGPU] Improve selection of ballot.i64 intrinsic in wave32 mode. (PR #71556)

Jay Foad via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 21 05:25:09 PST 2023


================
@@ -2314,9 +2314,8 @@ void AMDGPUDAGToDAGISel::SelectBRCOND(SDNode *N) {
     SDValue VCMP = Cond->getOperand(0);
     auto CC = cast<CondCodeSDNode>(Cond->getOperand(2))->get();
     auto *CRHS = dyn_cast<ConstantSDNode>(Cond->getOperand(1));
-    if ((CC == ISD::SETEQ || CC == ISD::SETNE) && CRHS && CRHS->isZero() &&
-        // TODO: make condition below an assert after fixing ballot bitwidth.
-        VCMP.getValueType().getSizeInBits() == ST->getWavefrontSize()) {
+    if ((CC == ISD::SETEQ || CC == ISD::SETNE) && CRHS && CRHS->isZero()) {
+      assert(VCMP.getValueType().getSizeInBits() == ST->getWavefrontSize());
----------------
jayfoad wrote:

You are asserting that instcombine has been run? That seems wrong. What about -O0 compiles?

https://github.com/llvm/llvm-project/pull/71556


More information about the cfe-commits mailing list