Skip to content

Commit 099c13c

Browse files
authored
[CIR] Simplify bool constant lowering (#1573)
1 parent 3b2053c commit 099c13c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1760,7 +1760,7 @@ mlir::LogicalResult CIRToLLVMConstantOpLowering::matchAndRewrite(
17601760
// during a pass as long as they don't live past the end of the pass.
17611761
attr = op.getValue();
17621762
} else if (mlir::isa<cir::BoolType>(op.getType())) {
1763-
int value = (op.getValue() == cir::BoolAttr::get(getContext(), true));
1763+
int value = mlir::cast<cir::BoolAttr>(op.getValue()).getValue();
17641764
attr = rewriter.getIntegerAttr(typeConverter->convertType(op.getType()),
17651765
value);
17661766
} else if (mlir::isa<cir::IntType>(op.getType())) {

0 commit comments

Comments
 (0)