consts: remove dead code around i1
constant values
`LLVMConstZext` recently got deleted, and it turns out (thanks to @nikic for knowing!) that this is dead code. Tests all pass for me without this logic, and per nikic: > We always generate constants in "relocatable bag of bytes" > representation, so you're never going to get a plain bool. So this should be a safe thing to do. r? @nikic @rustbot label: +llvm-main
This commit is contained in:
parent
adda05fe3e
commit
f8daa7d4f6
@ -374,15 +374,7 @@ impl<'ll> StaticMethods for CodegenCx<'ll, '_> {
|
|||||||
|
|
||||||
let g = self.get_static(def_id);
|
let g = self.get_static(def_id);
|
||||||
|
|
||||||
// boolean SSA values are i1, but they have to be stored in i8 slots,
|
let val_llty = self.val_ty(v);
|
||||||
// otherwise some LLVM optimization passes don't work as expected
|
|
||||||
let mut val_llty = self.val_ty(v);
|
|
||||||
let v = if val_llty == self.type_i1() {
|
|
||||||
val_llty = self.type_i8();
|
|
||||||
llvm::LLVMConstZExt(v, val_llty)
|
|
||||||
} else {
|
|
||||||
v
|
|
||||||
};
|
|
||||||
|
|
||||||
let instance = Instance::mono(self.tcx, def_id);
|
let instance = Instance::mono(self.tcx, def_id);
|
||||||
let ty = instance.ty(self.tcx, ty::ParamEnv::reveal_all());
|
let ty = instance.ty(self.tcx, ty::ParamEnv::reveal_all());
|
||||||
|
@ -969,7 +969,6 @@ extern "C" {
|
|||||||
ConstantIndices: *const &'a Value,
|
ConstantIndices: *const &'a Value,
|
||||||
NumIndices: c_uint,
|
NumIndices: c_uint,
|
||||||
) -> &'a Value;
|
) -> &'a Value;
|
||||||
pub fn LLVMConstZExt<'a>(ConstantVal: &'a Value, ToType: &'a Type) -> &'a Value;
|
|
||||||
pub fn LLVMConstPtrToInt<'a>(ConstantVal: &'a Value, ToType: &'a Type) -> &'a Value;
|
pub fn LLVMConstPtrToInt<'a>(ConstantVal: &'a Value, ToType: &'a Type) -> &'a Value;
|
||||||
pub fn LLVMConstIntToPtr<'a>(ConstantVal: &'a Value, ToType: &'a Type) -> &'a Value;
|
pub fn LLVMConstIntToPtr<'a>(ConstantVal: &'a Value, ToType: &'a Type) -> &'a Value;
|
||||||
pub fn LLVMConstBitCast<'a>(ConstantVal: &'a Value, ToType: &'a Type) -> &'a Value;
|
pub fn LLVMConstBitCast<'a>(ConstantVal: &'a Value, ToType: &'a Type) -> &'a Value;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user