Skip to content

Commit 869d997

Browse files
committed
Replace ConstProp by DataflowConstProp.
1 parent c416699 commit 869d997

File tree

259 files changed

+1920
-4292
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

259 files changed

+1920
-4292
lines changed

compiler/rustc_codegen_llvm/src/common.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,9 @@ impl<'ll, 'tcx> ConstMethods<'tcx> for CodegenCx<'ll, 'tcx> {
233233
})
234234
}
235235

236+
#[instrument(level = "trace", skip(self), ret)]
236237
fn scalar_to_backend(&self, cv: Scalar, layout: abi::Scalar, llty: &'ll Type) -> &'ll Value {
237-
let bitsize = if layout.is_bool() { 1 } else { layout.size(self).bits() };
238+
let bitsize = if llty == self.type_i1() { 1 } else { layout.size(self).bits() };
238239
match cv {
239240
Scalar::Int(int) => {
240241
let data = int.assert_bits(layout.size(self));

compiler/rustc_codegen_ssa/src/mir/operand.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ impl<'a, 'tcx, V: CodegenObject> OperandRef<'tcx, V> {
8484
OperandRef { val: OperandValue::ZeroSized, layout }
8585
}
8686

87+
#[instrument(level = "debug", skip(bx))]
8788
pub fn from_const<Bx: BuilderMethods<'a, 'tcx, Value = V>>(
8889
bx: &mut Bx,
8990
val: mir::ConstValue<'tcx>,
@@ -125,6 +126,7 @@ impl<'a, 'tcx, V: CodegenObject> OperandRef<'tcx, V> {
125126
OperandRef { val, layout }
126127
}
127128

129+
#[instrument(level = "debug", skip(bx), ret)]
128130
fn from_const_alloc<Bx: BuilderMethods<'a, 'tcx, Value = V>>(
129131
bx: &mut Bx,
130132
layout: TyAndLayout<'tcx>,
@@ -560,13 +562,12 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
560562
bx.load_operand(place)
561563
}
562564

565+
#[instrument(level = "debug", skip(self, bx))]
563566
pub fn codegen_operand(
564567
&mut self,
565568
bx: &mut Bx,
566569
operand: &mir::Operand<'tcx>,
567570
) -> OperandRef<'tcx, Bx::Value> {
568-
debug!("codegen_operand(operand={:?})", operand);
569-
570571
match *operand {
571572
mir::Operand::Copy(ref place) | mir::Operand::Move(ref place) => {
572573
self.codegen_consume(bx, place.as_ref())

0 commit comments

Comments
 (0)