[PATCH] [llgo] Optimize comparisons to empty string.
Peter Collingbourne
peter at pcc.me.uk
Mon Dec 8 17:02:58 PST 2014
REPOSITORY
rL LLVM
================
Comment at: irgen/strings.go:29-31
@@ +28,5 @@
+ len := fr.builder.CreateExtractValue(v, 1, "")
+ zero := llvm.ConstNull(len.Type())
+ result := fr.builder.CreateICmp(llvm.IntEQ, len, zero, "")
+ result = fr.builder.CreateZExt(result, llvm.Int8Type(), "")
+ return newValue(result, types.Typ[types.Bool])
----------------
axw wrote:
> result := fr.builder.CreateIsNull(len, "")
> ?
Done.
http://reviews.llvm.org/D6569
More information about the llvm-commits
mailing list