[llvm-dev] disable loop unrolling for store of large objects?

Bagel via llvm-dev llvm-dev at lists.llvm.org
Mon Oct 29 10:08:02 PDT 2018


If a store has a type which is "large", the code generated is loop unrolled.
For example:

%R = type {i32, [255 x i32]}
@a = global %R zeroinitializer, align 4
define void @foo(%R* %y$) nounwind {
L.0:
	%y = alloca %R*
	store %R* %y$, %R** %y
	%0 = load %R*, %R** %y
	%1 = load %R, %R* %0
	store %R %1, %R* @a
	br label %return
return:
	ret void
}

generates a huge number of instructions.  Is there a flag somewhere (I couldn't
find one) that which cause this store loop not to be unrolled.

Thanks, brian


More information about the llvm-dev mailing list