diff options
author | Tobias Grosser <tobias@grosser.es> | 2015-08-01 09:07:57 +0000 |
---|---|---|
committer | Tobias Grosser <tobias@grosser.es> | 2015-08-01 09:07:57 +0000 |
commit | 45e7944bcfbcb8ef9739f6ef42fb50693f96ef22 (patch) | |
tree | 319d95a9f4d237d3a4a29c584203c881cf03ff60 /llvm/lib | |
parent | d3f21833b90055ec18c82c2736b80eb44d39e3b9 (diff) | |
download | bcm5719-llvm-45e7944bcfbcb8ef9739f6ef42fb50693f96ef22.tar.gz bcm5719-llvm-45e7944bcfbcb8ef9739f6ef42fb50693f96ef22.zip |
Only use instructions as insert locations for SCEVExpander
SCEVExpander, which we are using during code generation, only allows
instructions as insert locations, but breaks in case BasicBlock->end() iterators
are passed to it due to it trying to obtain the basic block in which code should
be generated by calling Instruction->getParent(), which is not defined for
->end() iterators.
This change adds an assert to Polly that ensures we only pass valid instructions
to SCEVExpander and it fixes one case, where we used IRBuilder->SetInsertBlock()
to set an ->end() insert location which was later passed to SCEVExpander.
In general, Polly is always trying to build up the CFG first, before we actually
insert instructions into the CFG sceleton. As a result, each basic block should
already have at least one branch instruction before we start adding code. Hence,
always requiring the IRBuilder insert location to be set to a real instruction
should always be possible.
Thanks Utpal Bora <cs14mtech11017@iith.ac.in> for his help with test case
reduction.
llvm-svn: 243830
Diffstat (limited to 'llvm/lib')
0 files changed, 0 insertions, 0 deletions