[PATCH] D12053: [Polly] Workaround for SDiv/SRem referenced from SCEVExpander

Tobias Grosser via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 16 13:05:00 PDT 2015


grosser added a comment.

Hi Michael,

I just committed another test case (test/Isl/CodeGen/inner_scev_2.ll) that has a similar problem, but unfortunately still fails with this patch applied.

In general, I think your approach of moving the relevant instructions out of the scop is a good one, but just seems to be a little incomplete.

One very similar approach could be to go

codgenSCEV(SCEV S)

1. Scan S for SCEV Unknowns X that refer to instructions in SCoP
2. for each operand Op of X: a) get SCEV of Op b) codegenSCEV(SCEV of Op) c) create new instruction that uses the newly code generated operands as input
3. Replace all X with new instructions
4. Only now SCEVExpand the SCEV (after we know it has no problematic SCEUnknowns any more)

Maybe this gives you some inspiration of how to go ahead.

Best,
Tobias


http://reviews.llvm.org/D12053





More information about the llvm-commits mailing list