Skip to content

Instantly share code, notes, and snippets.

@AlexDenisov
Last active November 8, 2016 21:58
Show Gist options
  • Save AlexDenisov/57cbe32cdeb5b6818bc3ab5fe63ce01b to your computer and use it in GitHub Desktop.
Save AlexDenisov/57cbe32cdeb5b6818bc3ab5fe63ce01b to your computer and use it in GitHub Desktop.
diff --git a/1.ll b/1.ll
index 1932029..81d3e51 100644
--- a/1.ll
+++ b/1.ll
@@ -35,10 +35,7 @@ if.end: ; preds = %if.then, %entry
sw.bb: ; preds = %if.end
%call = call zeroext i1 @_ZNK4llvm7APFloat10isNegativeEv(%"class.llvm::APFloat"* %this1),
- br i1 %call, label %if.end3, label %if.then2,
-
-if.then2: ; preds = %sw.bb
- br label %sw.epilog,
+ br i1 %call, label %if.end3, label %sw.epilog,
if.end3: ; preds = %sw.bb
call void @_ZN4llvm7APFloat11makeLargestEb(%"class.llvm::APFloat"* %this1, i1 zeroext true),
@@ -46,15 +43,12 @@ if.end3: ; preds = %sw.bb
sw.bb4: ; preds = %if.end
%call5 = call zeroext i1 @_ZNK4llvm7APFloat11isSignalingEv(%"class.llvm::APFloat"* %this1),
- br i1 %call5, label %if.then6, label %if.end8,
+ br i1 %call5, label %if.then6, label %sw.epilog,
if.then6: ; preds = %sw.bb4
store i32 1, i32* %result, align 4,
%call7 = call zeroext i1 @_ZNK4llvm7APFloat10isNegativeEv(%"class.llvm::APFloat"* %this1),
call void @_ZN4llvm7APFloat7makeNaNEbbPKNS_5APIntE(%"class.llvm::APFloat"* %this1, i1 zeroext false, i1 zeroext %call7, %"class.llvm::APInt"* null),
- br label %if.end8,
-
-if.end8: ; preds = %if.then6, %sw.bb4
br label %sw.epilog,
sw.bb9: ; preds = %if.end
@@ -98,10 +92,10 @@ if.then23: ; preds = %land.lhs.true21
%bf.load27 = load i8, i8* %category26, align 2,
%bf.clear28 = and i8 %bf.load27, -8,
store i8 %bf.clear28, i8* %category26, align 2,
- %semantics = getelementptr inbounds %"class.llvm::APFloat", %"class.llvm::APFloat"* %this1, i32 0, i32 0,
- %1 = load %"struct.llvm::fltSemantics"*, %"struct.llvm::fltSemantics"** %semantics, align 8,
- %maxExponent = getelementptr inbounds %"struct.llvm::fltSemantics", %"struct.llvm::fltSemantics"* %1, i32 0, i32 0,
- %2 = load i16, i16* %maxExponent, align 4,
+ %semantics1 = bitcast %"class.llvm::APFloat"* %this1 to %"struct.llvm::fltSemantics"**
+ %1 = load %"struct.llvm::fltSemantics"*, %"struct.llvm::fltSemantics"** %semantics1, align 8,
+ %maxExponent2 = bitcast %"struct.llvm::fltSemantics"* %1 to i16*
+ %2 = load i16, i16* %maxExponent2, align 4,
%conv = sext i16 %2 to i32,
%add = add nsw i32 %conv, 1,
%conv29 = trunc i32 %add to i16,
@@ -117,8 +111,8 @@ if.then33: ; preds = %if.end31
%exponent34 = getelementptr inbounds %"class.llvm::APFloat", %"class.llvm::APFloat"* %this1, i32 0, i32 2,
%3 = load i16, i16* %exponent34, align 8,
%conv35 = sext i16 %3 to i32,
- %semantics36 = getelementptr inbounds %"class.llvm::APFloat", %"class.llvm::APFloat"* %this1, i32 0, i32 0,
- %4 = load %"struct.llvm::fltSemantics"*, %"struct.llvm::fltSemantics"** %semantics36, align 8,
+ %semantics363 = bitcast %"class.llvm::APFloat"* %this1 to %"struct.llvm::fltSemantics"**
+ %4 = load %"struct.llvm::fltSemantics"*, %"struct.llvm::fltSemantics"** %semantics363, align 8,
%minExponent = getelementptr inbounds %"struct.llvm::fltSemantics", %"struct.llvm::fltSemantics"* %4, i32 0, i32 1,
%5 = load i16, i16* %minExponent, align 2,
%conv37 = sext i16 %5 to i32,
@@ -140,12 +134,12 @@ land.end: ; preds = %land.rhs, %if.then3
%call42 = call i64 @_ZN4llvm5APInt11tcDecrementEPyj(i64* %7, i32 %call41),
%8 = load i8, i8* %WillCrossBinadeBoundary, align 1,
%tobool43 = trunc i8 %8 to i1,
- br i1 %tobool43, label %if.then44, label %if.end47,
+ br i1 %tobool43, label %if.then44, label %sw.epilog,
if.then44: ; preds = %land.end
%9 = load i64*, i64** %Parts, align 8,
- %semantics45 = getelementptr inbounds %"class.llvm::APFloat", %"class.llvm::APFloat"* %this1, i32 0, i32 0,
- %10 = load %"struct.llvm::fltSemantics"*, %"struct.llvm::fltSemantics"** %semantics45, align 8,
+ %semantics454 = bitcast %"class.llvm::APFloat"* %this1 to %"struct.llvm::fltSemantics"**
+ %10 = load %"struct.llvm::fltSemantics"*, %"struct.llvm::fltSemantics"** %semantics454, align 8,
%precision = getelementptr inbounds %"struct.llvm::fltSemantics", %"struct.llvm::fltSemantics"* %10, i32 0, i32 2,
%11 = load i32, i32* %precision, align 4,
%sub = sub i32 %11, 1,
@@ -154,10 +148,7 @@ if.then44: ; preds = %land.end
%12 = load i16, i16* %exponent46, align 8,
%dec = add i16 %12, -1,
store i16 %dec, i16* %exponent46, align 8,
- br label %if.end47,
-
-if.end47: ; preds = %if.then44, %land.end
- br label %if.end74,
+ br label %sw.epilog,
if.else: ; preds = %if.end31
%call49 = call zeroext i1 @_ZNK4llvm7APFloat10isDenormalEv(%"class.llvm::APFloat"* %this1),
@@ -182,8 +173,8 @@ if.then55: ; preds = %land.end52
%call58 = call i32 @_ZNK4llvm7APFloat9partCountEv(%"class.llvm::APFloat"* %this1),
call void @_ZN4llvm5APInt5tcSetEPyyj(i64* %15, i64 0, i32 %call58),
%16 = load i64*, i64** %Parts56, align 8,
- %semantics59 = getelementptr inbounds %"class.llvm::APFloat", %"class.llvm::APFloat"* %this1, i32 0, i32 0,
- %17 = load %"struct.llvm::fltSemantics"*, %"struct.llvm::fltSemantics"** %semantics59, align 8,
+ %semantics595 = bitcast %"class.llvm::APFloat"* %this1 to %"struct.llvm::fltSemantics"**
+ %17 = load %"struct.llvm::fltSemantics"*, %"struct.llvm::fltSemantics"** %semantics595, align 8,
%precision60 = getelementptr inbounds %"struct.llvm::fltSemantics", %"struct.llvm::fltSemantics"* %17, i32 0, i32 2,
%18 = load i32, i32* %precision60, align 4,
%sub61 = sub i32 %18, 1,
@@ -191,10 +182,10 @@ if.then55: ; preds = %land.end52
%exponent62 = getelementptr inbounds %"class.llvm::APFloat", %"class.llvm::APFloat"* %this1, i32 0, i32 2,
%19 = load i16, i16* %exponent62, align 8,
%conv63 = sext i16 %19 to i32,
- %semantics64 = getelementptr inbounds %"class.llvm::APFloat", %"class.llvm::APFloat"* %this1, i32 0, i32 0,
- %20 = load %"struct.llvm::fltSemantics"*, %"struct.llvm::fltSemantics"** %semantics64, align 8,
- %maxExponent65 = getelementptr inbounds %"struct.llvm::fltSemantics", %"struct.llvm::fltSemantics"* %20, i32 0, i32 0,
- %21 = load i16, i16* %maxExponent65, align 4,
+ %semantics646 = bitcast %"class.llvm::APFloat"* %this1 to %"struct.llvm::fltSemantics"**
+ %20 = load %"struct.llvm::fltSemantics"*, %"struct.llvm::fltSemantics"** %semantics646, align 8,
+ %maxExponent657 = bitcast %"struct.llvm::fltSemantics"* %20 to i16*
+ %21 = load i16, i16* %maxExponent657, align 4,
%conv66 = sext i16 %21 to i32,
%cmp67 = icmp ne i32 %conv63, %conv66,
br i1 %cmp67, label %land.rhs68, label %land.end69,
@@ -205,37 +196,26 @@ land.rhs68: ; preds = %if.then55
land.end69: ; preds = %land.rhs68, %if.then55
%22 = phi i1 [ false, %if.then55 ], [ true, %land.rhs68 ]
%lnot = xor i1 %22, true,
- br i1 %lnot, label %cond.true, label %cond.false,
+ br i1 %lnot, label %cond.true, label %cond.end,
cond.true: ; preds = %land.end69
call void @__assert_rtn(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__._ZN4llvm7APFloat4nextEb, i32 0, i32 0), i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i32 0, i32 0), i32 3917, i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str.88, i32 0, i32 0)) #9,
unreachable,
- ; No predecessors!
- br label %cond.end,
-cond.false: ; preds = %land.end69
- br label %cond.end,
-
-cond.end: ; preds = %cond.false, %23
+cond.end: ; preds = %land.end69
%exponent71 = getelementptr inbounds %"class.llvm::APFloat", %"class.llvm::APFloat"* %this1, i32 0, i32 2,
- %24 = load i16, i16* %exponent71, align 8,
- %inc = add i16 %24, 1,
+ %23 = load i16, i16* %exponent71, align 8,
+ %inc = add i16 %23, 1,
store i16 %inc, i16* %exponent71, align 8,
- br label %if.end73,
+ br label %sw.epilog,
if.else72: ; preds = %land.end52
call void @_ZN4llvm7APFloat20incrementSignificandEv(%"class.llvm::APFloat"* %this1),
- br label %if.end73
-
-if.end73: ; preds = %if.else72, %cond.end
- br label %if.end74
-
-if.end74: ; preds = %if.end73, %if.end47
- br label %sw.epilog,
+ br label %sw.epilog
-sw.epilog: ; preds = %if.end, %if.end74, %if.then23, %if.then13, %sw.bb9, %if.end8, %if.end3, %if.then2
- %25 = load i8, i8* %nextDown.addr, align 1,
- %tobool75 = trunc i8 %25 to i1,
+sw.epilog: ; preds = %if.then44, %land.end, %if.else72, %cond.end, %sw.bb4, %if.then6, %sw.bb, %if.end, %if.then23, %if.then13, %sw.bb9, %if.end3
+ %24 = load i8, i8* %nextDown.addr, align 1,
+ %tobool75 = trunc i8 %24 to i1,
br i1 %tobool75, label %if.then76, label %if.end77,
if.then76: ; preds = %sw.epilog
@@ -243,6 +223,6 @@ if.then76: ; preds = %sw.epilog
br label %if.end77,
if.end77: ; preds = %if.then76, %sw.epilog
- %26 = load i32, i32* %result, align 4,
- ret i32 %26,
+ %25 = load i32, i32* %result, align 4,
+ ret i32 %25,
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment