summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
diff options
context:
space:
mode:
authorArnold Schwaighofer <aschwaighofer@apple.com>2014-10-10 01:27:02 +0000
committerArnold Schwaighofer <aschwaighofer@apple.com>2014-10-10 01:27:02 +0000
commitd7d010eb2a1fbe7830190646af5f28b8825cce1e (patch)
tree61fad3bdd3123b30e1279709aa718a1912692307 /llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
parent2c77a427ab7a1c33962a6c190facae33aa499b81 (diff)
downloadbcm5719-llvm-d7d010eb2a1fbe7830190646af5f28b8825cce1e.tar.gz
bcm5719-llvm-d7d010eb2a1fbe7830190646af5f28b8825cce1e.zip
SimplifyCFG: Don't convert phis into selects if we could remove undef behavior
instead We used to transform this: define void @test6(i1 %cond, i8* %ptr) { entry: br i1 %cond, label %bb1, label %bb2 bb1: br label %bb2 bb2: %ptr.2 = phi i8* [ %ptr, %entry ], [ null, %bb1 ] store i8 2, i8* %ptr.2, align 8 ret void } into this: define void @test6(i1 %cond, i8* %ptr) { %ptr.2 = select i1 %cond, i8* null, i8* %ptr store i8 2, i8* %ptr.2, align 8 ret void } because the simplifycfg transformation into selects would happen to happen before the simplifycfg transformation that removes unreachable control flow (We have 'unreachable control flow' due to the store to null which is undefined behavior). The existing transformation that removes unreachable control flow in simplifycfg is: /// If BB has an incoming value that will always trigger undefined behavior /// (eg. null pointer dereference), remove the branch leading here. static bool removeUndefIntroducingPredecessor(BasicBlock *BB) Now we generate: define void @test6(i1 %cond, i8* %ptr) { store i8 2, i8* %ptr.2, align 8 ret void } I did not see any impact on the test-suite + externals. rdar://18596215 llvm-svn: 219462
Diffstat (limited to 'llvm/lib/Transforms/Vectorize/LoopVectorize.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud