Simplify ~mask codegen to emit single XOR like other places in the code.
This commit is contained in:
8
ctx.cpp
8
ctx.cpp
@@ -554,7 +554,9 @@ FunctionEmitContext::EndIf() {
|
||||
}
|
||||
|
||||
llvm::Value *notBreakOrContinue =
|
||||
NotOperator(bcLanes, "!(break|continue)_lanes");
|
||||
BinaryOperator(llvm::Instruction::Xor,
|
||||
bcLanes, LLVMMaskAllOn,
|
||||
"!(break|continue)_lanes");
|
||||
llvm::Value *oldMask = GetInternalMask();
|
||||
llvm::Value *newMask =
|
||||
BinaryOperator(llvm::Instruction::And, oldMask,
|
||||
@@ -659,7 +661,9 @@ FunctionEmitContext::restoreMaskGivenReturns(llvm::Value *oldMask) {
|
||||
// newMask = (oldMask & ~returnedLanes)
|
||||
llvm::Value *returnedLanes = LoadInst(returnedLanesPtr,
|
||||
"returned_lanes");
|
||||
llvm::Value *notReturned = NotOperator(returnedLanes, "~returned_lanes");
|
||||
llvm::Value *notReturned = BinaryOperator(llvm::Instruction::Xor,
|
||||
returnedLanes, LLVMMaskAllOn,
|
||||
"~returned_lanes");
|
||||
llvm::Value *newMask = BinaryOperator(llvm::Instruction::And,
|
||||
oldMask, notReturned, "new_mask");
|
||||
SetInternalMask(newMask);
|
||||
|
||||
Reference in New Issue
Block a user