Thanks for using Compiler Explorer
Sponsors
Jakt
C++
Ada
Algol68
Analysis
Android Java
Android Kotlin
Assembly
C
C3
Carbon
C with Coccinelle
C++ with Coccinelle
C++ (Circle)
CIRCT
Clean
CMake
CMakeScript
COBOL
C++ for OpenCL
MLIR
Cppx
Cppx-Blue
Cppx-Gold
Cpp2-cppfront
Crystal
C#
CUDA C++
D
Dart
Elixir
Erlang
Fortran
F#
GLSL
Go
Haskell
HLSL
Hook
Hylo
IL
ispc
Java
Julia
Kotlin
LLVM IR
LLVM MIR
Modula-2
Mojo
Nim
Numba
Nix
Objective-C
Objective-C++
OCaml
Odin
OpenCL C
Pascal
Pony
PTX
Python
Racket
Raku
Ruby
Rust
Sail
Snowball
Scala
Slang
Solidity
Spice
SPIR-V
Swift
LLVM TableGen
Toit
Triton
TypeScript Native
V
Vala
Visual Basic
Vyper
WASM
Zig
Javascript
GIMPLE
Ygen
sway
llvm source #1
Output
Compile to binary object
Link to binary
Execute the code
Intel asm syntax
Demangle identifiers
Verbose demangling
Filters
Unused labels
Library functions
Directives
Comments
Horizontal whitespace
Debug intrinsics
Compiler
clang (assertions trunk)
clang (trunk)
clang 10.0.0
clang 10.0.1
clang 11.0.0
clang 11.0.1
clang 12.0.0
clang 12.0.1
clang 13.0.0
clang 14.0.0
clang 15.0.0
clang 16.0.0
clang 17.0.1
clang 18.1.0
clang 19.1.0
clang 20.1.0
clang 21.1.0
clang 4.0.1
clang 5.0.0
clang 6.0.0
clang 7.0.0
clang 8.0.0
clang 9.0.0
hexagon-clang 16.0.5
llc (assertions trunk)
llc (trunk)
llc 10.0.0
llc 10.0.1
llc 11.0.0
llc 11.0.1
llc 12.0.0
llc 12.0.1
llc 13.0.0
llc 14.0.0
llc 15.0.0
llc 16.0.0
llc 17.0.1
llc 18.1.0
llc 19.1.0
llc 20.1.0
llc 21.1.0
llc 3.2
llc 3.3
llc 3.9.1
llc 4.0.0
llc 4.0.1
llc 5.0.0
llc 6.0.0
llc 7.0.0
llc 8.0.0
llc 9.0.0
opt (assertions trunk)
opt (trunk)
opt 10.0.0
opt 10.0.1
opt 11.0.0
opt 11.0.1
opt 12.0.0
opt 12.0.1
opt 13.0.0
opt 14.0.0
opt 15.0.0
opt 16.0.0
opt 17.0.1
opt 18.1.0
opt 19.1.0
opt 20.1.0
opt 21.1.0
opt 3.2
opt 3.3
opt 3.9.1
opt 4.0.0
opt 4.0.1
opt 5.0.0
opt 6.0.0
opt 7.0.0
opt 8.0.0
opt 9.0.0
Options
Source code
; ModuleID = 'enum_early_otherwise_branch.54653d479f073ac5-cgu.0' source_filename = "enum_early_otherwise_branch.54653d479f073ac5-cgu.0" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" ; Function Attrs: nonlazybind uwtable define noundef zeroext i1 @foo(ptr noalias noundef readonly align 4 dereferenceable(8) %lhs, ptr noalias noundef readonly align 4 dereferenceable(8) %rhs) unnamed_addr #0 { start: %rhs6 = alloca ptr, align 8 %lhs5 = alloca ptr, align 8 %rhs4 = alloca ptr, align 8 %lhs3 = alloca ptr, align 8 %rhs2 = alloca ptr, align 8 %lhs1 = alloca ptr, align 8 %_0 = alloca i8, align 1 %0 = load i32, ptr %lhs, align 4, !range !3, !noundef !4 %_3 = zext i32 %0 to i64 %1 = load i32, ptr %rhs, align 4, !range !3, !noundef !4 %_28 = zext i32 %1 to i64 %_29 = icmp ne i64 %_3, %_28 br i1 %_29, label %bb1, label %bb7 bb7: ; preds = %start switch i64 %_3, label %bb6 [ i64 0, label %bb2 i64 1, label %bb3 i64 2, label %bb4 ] bb1: ; preds = %start store i8 0, ptr %_0, align 1 br label %bb5 bb6: ; preds = %bb7 unreachable bb2: ; preds = %bb7 call void @llvm.lifetime.start.p0(i64 8, ptr %lhs1) %2 = getelementptr inbounds i8, ptr %lhs, i64 4 store ptr %2, ptr %lhs1, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr %rhs2) %3 = getelementptr inbounds i8, ptr %rhs, i64 4 store ptr %3, ptr %rhs2, align 8 %self = load ptr, ptr %lhs1, align 8, !nonnull !4, !align !5, !noundef !4 %other = load ptr, ptr %rhs2, align 8, !nonnull !4, !align !5, !noundef !4 %_18 = load i32, ptr %self, align 4, !noundef !4 %_19 = load i32, ptr %other, align 4, !noundef !4 %4 = icmp eq i32 %_18, %_19 %5 = zext i1 %4 to i8 store i8 %5, ptr %_0, align 1 call void @llvm.lifetime.end.p0(i64 8, ptr %rhs2) call void @llvm.lifetime.end.p0(i64 8, ptr %lhs1) br label %bb5 bb3: ; preds = %bb7 call void @llvm.lifetime.start.p0(i64 8, ptr %lhs3) %6 = getelementptr inbounds i8, ptr %lhs, i64 4 store ptr %6, ptr %lhs3, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr %rhs4) %7 = getelementptr inbounds i8, ptr %rhs, i64 4 store ptr %7, ptr %rhs4, align 8 %self7 = load ptr, ptr %lhs3, align 8, !nonnull !4, !align !5, !noundef !4 %other8 = load ptr, ptr %rhs4, align 8, !nonnull !4, !align !5, !noundef !4 %_22 = load i32, ptr %self7, align 4, !noundef !4 %_23 = load i32, ptr %other8, align 4, !noundef !4 %8 = icmp eq i32 %_22, %_23 %9 = zext i1 %8 to i8 store i8 %9, ptr %_0, align 1 call void @llvm.lifetime.end.p0(i64 8, ptr %rhs4) call void @llvm.lifetime.end.p0(i64 8, ptr %lhs3) br label %bb5 bb4: ; preds = %bb7 call void @llvm.lifetime.start.p0(i64 8, ptr %lhs5) %10 = getelementptr inbounds i8, ptr %lhs, i64 4 store ptr %10, ptr %lhs5, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr %rhs6) %11 = getelementptr inbounds i8, ptr %rhs, i64 4 store ptr %11, ptr %rhs6, align 8 %self9 = load ptr, ptr %lhs5, align 8, !nonnull !4, !align !5, !noundef !4 %other10 = load ptr, ptr %rhs6, align 8, !nonnull !4, !align !5, !noundef !4 %_26 = load i32, ptr %self9, align 4, !noundef !4 %_27 = load i32, ptr %other10, align 4, !noundef !4 %12 = icmp eq i32 %_26, %_27 %13 = zext i1 %12 to i8 store i8 %13, ptr %_0, align 1 call void @llvm.lifetime.end.p0(i64 8, ptr %rhs6) call void @llvm.lifetime.end.p0(i64 8, ptr %lhs5) br label %bb5 bb5: ; preds = %bb1, %bb4, %bb3, %bb2 %14 = load i8, ptr %_0, align 1, !range !6, !noundef !4 %15 = trunc i8 %14 to i1 ret i1 %15 } ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nonlazybind uwtable "probe-stack"="inline-asm" "target-cpu"="x86-64" } attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } !llvm.module.flags = !{!0, !1} !llvm.ident = !{!2} !0 = !{i32 8, !"PIC Level", i32 2} !1 = !{i32 2, !"RtLibUseGOT", i32 1} !2 = !{!"rustc version 1.79.0-dev"} !3 = !{i32 0, i32 3} !4 = !{} !5 = !{i64 4} !6 = !{i8 0, i8 2}
Become a Patron
Sponsor on GitHub
Donate via PayPal
Compiler Explorer Shop
Source on GitHub
Mailing list
Installed libraries
Wiki
Report an issue
How it works
Contact the author
CE on Mastodon
CE on Bluesky
Statistics
Changelog
Version tree