Skip to content

Instantly share code, notes, and snippets.

@minglotus-6
Created December 8, 2021 18:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save minglotus-6/1e6b93d52687e7fbbb43942563134117 to your computer and use it in GitHub Desktop.
Save minglotus-6/1e6b93d52687e7fbbb43942563134117 to your computer and use it in GitHub Desktop.
*** IR Dump After SROA on _Z5ParsebPF6RetValvE ***
; Function Attrs: mustprogress uwtable
define dso_local i64 @_Z5ParsebPF6RetValvE(i1 zeroext %test, i64 ()* %p) #0 {
entry:
%frombool = zext i1 %test to i8
%tobool = trunc i8 %frombool to i1
br i1 %tobool, label %if.then, label %if.end
if.then: ; preds = %entry
br label %return
if.end: ; preds = %entry
%call = call i64 %p()
%retval.sroa.0.0.extract.trunc = trunc i64 %call to i32
%retval.sroa.3.0.extract.shift = lshr i64 %call, 32
%retval.sroa.3.0.extract.trunc = trunc i64 %retval.sroa.3.0.extract.shift to i32
br label %return
return: ; preds = %if.end, %if.then
%retval.sroa.0.0 = phi i32 [ 0, %if.then ], [ %retval.sroa.0.0.extract.trunc, %if.end ]
%retval.sroa.3.0 = phi i32 [ 0, %if.then ], [ %retval.sroa.3.0.extract.trunc, %if.end ]
%retval.sroa.3.0.insert.ext = zext i32 %retval.sroa.3.0 to i64
%retval.sroa.3.0.insert.shift = shl i64 %retval.sroa.3.0.insert.ext, 32
%retval.sroa.3.0.insert.mask = and i64 undef, 4294967295
%retval.sroa.3.0.insert.insert = or i64 %retval.sroa.3.0.insert.mask, %retval.sroa.3.0.insert.shift
%retval.sroa.0.0.insert.ext = zext i32 %retval.sroa.0.0 to i64
%retval.sroa.0.0.insert.mask = and i64 %retval.sroa.3.0.insert.insert, -4294967296
%retval.sroa.0.0.insert.insert = or i64 %retval.sroa.0.0.insert.mask, %retval.sroa.0.0.insert.ext
ret i64 %retval.sroa.0.0.insert.insert
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment