Open rotateright opened 6 years ago
Interestingly, the bug isn't visible if I remove the BB label ("entry") and rename the temp variables. Also, I don't think this is a mac-specific bug, but you're correct that I'm testing on a Mac with a release+asserts build of llc.
There's still a bug here. It won't repro for an x86 target now that the transform doesn't fire there, but I still assert when targeting aarch64 for example:
$ llc -o - 37060func.ll -debug -mtriple=aarch64
...
Combining: t12: i32 = and t10, Constant:i32<255> Backwards propagate AND: t12: i32 = and t10, Constant:i32<255> First, need to fix up: t21: i32 = mul t20, t4 Creating new node: t36: i32 = and t21, Constant:i32<255> Propagate AND back to: t9: i32,ch = load<(load 4 from %ir.Assertion failed: (F && "No function incorporated"), function getLocalSlot, file /Users/spatel/myllvm/llvm/lib/IR/AsmWriter.cpp, line 844
Hi Sanjay,
Do you still have this issue? If so, I'll get on my mac and have a look.
Extended Description
I was trying to view debug output for the test in bug 37060, but that asserts:
@c = external local_unnamed_addr constant i32, align 4 @d = external local_unnamed_addr global i32*, align 8 @e = external local_unnamed_addr global i32, align 4
define void @tf_0_foo() { entry: %0 = load i32, i32 @c, align 4 %rem = srem i32 -1, %0 %1 = load i32, i32* @d, align 8 %2 = load i32, i32 %1, align 4 %xor = xor i32 %2, %rem %conv3 = and i32 %xor, 255 store i32 %conv3, i32* @e, align 4 ret void }
$ llc -o - 37060func.ll -debug
...
Propagate AND back to: t9: i32,ch = load<(load 4 from %ir.Assertion failed: (F && "No function incorporated"), function getLocalSlot, file /llvm/lib/IR/AsmWriter.cpp, line 844. Stack dump: