From 5c10ac71efe0aa774fd9dbe6c5286d553d00425a Mon Sep 17 00:00:00 2001 From: David Green Date: Wed, 22 May 2024 19:25:01 +0100 Subject: [PATCH] Address comments --- llvm/lib/CodeGen/SelectOptimize.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/llvm/lib/CodeGen/SelectOptimize.cpp b/llvm/lib/CodeGen/SelectOptimize.cpp index 27de238cbe2d1e..0a5f0a861d48ba 100644 --- a/llvm/lib/CodeGen/SelectOptimize.cpp +++ b/llvm/lib/CodeGen/SelectOptimize.cpp @@ -159,7 +159,7 @@ class SelectOptimizeImpl { /// Invert the select by inverting the condition and switching the operands. void setInverted() { - assert(!Inverted && "Trying to invert and inverted SelectLike"); + assert(!Inverted && "Trying to invert an inverted SelectLike"); assert(isa(getCondition()) && cast(getCondition())->getOpcode() == Instruction::Xor); @@ -193,6 +193,8 @@ class SelectOptimizeImpl { /// condition of a select or c in `or(zext(c), x)` Value *getCondition() const { Value *CC = getNonInvertedCondition(); + // For inverted conditions the CC is checked when created to be a not + // (xor) instruction. if (Inverted) return cast(CC)->getOperand(0); return CC;