[PATCH] D14475: [Sink] Don't move landingpads

David Majnemer via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 7 08:57:55 PST 2015


majnemer accepted this revision.
majnemer added a comment.
This revision is now accepted and ready to land.

LGTM with tweaks


================
Comment at: lib/Transforms/Scalar/Sink.cpp:172-173
@@ -171,3 +171,4 @@
 
-  if (isa<TerminatorInst>(Inst) || isa<PHINode>(Inst))
+  if (isa<TerminatorInst>(Inst) || isa<PHINode>(Inst) ||
+      isa<LandingPadInst>(Inst) || isa<CleanupPadInst>(Inst))
     return false;
----------------
This can be made more concise by writing it as `isa<TerminatorInst>(Inst) || isa<PHINode(Inst) || Inst->isEHPad()`

================
Comment at: test/Transforms/Sink/landingpad.ll:4
@@ +3,3 @@
+
+define void @_ZNSt3__124__put_character_sequenceIcNS_11char_traitsIcEEEERNS_13basic_ostreamIT_T0_EES7_PKS4_m() #0 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
+entry:
----------------
Would you mind renaming these functions something like `f`, `g`, and `h` ?

================
Comment at: test/Transforms/Sink/landingpad.ll:38-39
@@ +37,3 @@
+
+attributes #0 = { "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="0" "stackrealign" "target-cpu"="ivybridge" "target-features"="+aes,+avx,+cx16,+f16c,+fsgsbase,+fxsr,+mmx,+pclmul,+popcnt,+rdrnd,+sse,+sse2,+sse3,+sse4.1,+sse4.2,+ssse3,+xsave,+xsaveopt" "unsafe-fp-math"="false" "use-soft-float"="false" }
+attributes #1 = { alwaysinline "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="0" "stackrealign" "target-cpu"="ivybridge" "target-features"="+aes,+avx,+cx16,+f16c,+fsgsbase,+fxsr,+mmx,+pclmul,+popcnt,+rdrnd,+sse,+sse2,+sse3,+sse4.1,+sse4.2,+ssse3,+xsave,+xsaveopt" "unsafe-fp-math"="false" "use-soft-float"="false" }
----------------
These attributes are not really relevant to this test case.


Repository:
  rL LLVM

http://reviews.llvm.org/D14475





More information about the llvm-commits mailing list