diff options
| author | Scott McMurray <scottmcm@users.noreply.github.com> | 2025-01-20 00:00:44 -0800 |
|---|---|---|
| committer | Scott McMurray <scottmcm@users.noreply.github.com> | 2025-01-31 22:29:08 -0800 |
| commit | 4ee1602eab2cdc88172d4a98f927613ab64b4cf0 (patch) | |
| tree | 4c1cbd4da1c08bb3f668c3c08bb08acd4c309741 /compiler/rustc_codegen_llvm/src/builder.rs | |
| parent | f23025305f88cf4d822452960dd707d5abee555f (diff) | |
| download | rust-4ee1602eab2cdc88172d4a98f927613ab64b4cf0.tar.gz rust-4ee1602eab2cdc88172d4a98f927613ab64b4cf0.zip | |
Override `disjoint_or` in the LLVM backend
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/builder.rs')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/builder.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_llvm/src/builder.rs b/compiler/rustc_codegen_llvm/src/builder.rs index 2d007416263..6e1eec4f0fc 100644 --- a/compiler/rustc_codegen_llvm/src/builder.rs +++ b/compiler/rustc_codegen_llvm/src/builder.rs @@ -421,6 +421,14 @@ impl<'a, 'll, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> { unchecked_umul(x, y) => LLVMBuildNUWMul, } + fn or_disjoint(&mut self, a: &'ll Value, b: &'ll Value) -> &'ll Value { + unsafe { + let or = llvm::LLVMBuildOr(self.llbuilder, a, b, UNNAMED); + llvm::LLVMSetIsDisjoint(or, True); + or + } + } + set_math_builder_methods! { fadd_fast(x, y) => (LLVMBuildFAdd, LLVMRustSetFastMath), fsub_fast(x, y) => (LLVMBuildFSub, LLVMRustSetFastMath), |
